From 9835f45b1bd59f939b798cb26600f46a2b451cf3 Mon Sep 17 00:00:00 2001 From: imSp4rky Date: Wed, 1 Jul 2026 23:18:53 -0600 Subject: [PATCH] fix(api): pass track-selection params to service context Jobs ran with default [SDR] TrackRequest, breaking HYBRID/HDR downloads. --- .gitignore | 1 + unshackle/core/api/download_manager.py | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 466c00df..aa04693f 100644 --- a/.gitignore +++ b/.gitignore @@ -31,6 +31,7 @@ unshackle/cookies/ unshackle/certs/ unshackle/WVDs/ unshackle/PRDs/ +unshackle/exports/ temp/ logs/ services/ diff --git a/unshackle/core/api/download_manager.py b/unshackle/core/api/download_manager.py index 70ba0782..aa4aac64 100644 --- a/unshackle/core/api/download_manager.py +++ b/unshackle/core/api/download_manager.py @@ -419,14 +419,20 @@ def _perform_download( "output_dir": Path(params["output_dir"]) if params.get("output_dir") else None, "no_cache": params.get("no_cache", False), "reset_cache": params.get("reset_cache", False), + # Track-selection params read by Service.__init__ via ctx.parent.params + "quality": params.get("quality", []), + "vcodec": params.get("vcodec", []), + "range_": params.get("range", [Video.Range.SDR]), + "best_available": params.get("best_available", False), } # Hand-built context: record parameter sources so service dl overrides # apply to defaults but never clobber client-sent values. from click.core import ParameterSource for param_name in ctx.params: + source_key = "range" if param_name == "range_" else param_name ctx.set_parameter_source( - param_name, ParameterSource.COMMANDLINE if param_name in params else ParameterSource.DEFAULT + param_name, ParameterSource.COMMANDLINE if source_key in params else ParameterSource.DEFAULT ) dl_instance = dl(