feat(api): forward exact_lang to the service context

The remote-dl client sends exact_lang in dl_params, and REST download jobs set it in the service ctx, so a service can skip the manifests of close-match languages.
This commit is contained in:
imSp4rky
2026-10-13 15:07:01 -06:00
parent 3e64a7d684
commit 4fbaf2a61a
9 changed files with 38 additions and 17 deletions
+12 -4
View File
@@ -192,10 +192,17 @@ class _CapturedCtx(Exception):
@pytest.mark.parametrize(
("params", "expected"),
[
({}, (["orig"], [], [], [], False)),
({}, (["orig"], [], [], [], False, False)),
(
{"lang": ["es-419"], "v_lang": ["en"], "a_lang": ["ja"], "acodec": "AAC,EC3", "forced_subs": True},
(["es-419"], ["en"], ["ja"], ["AAC", "EC3"], True),
{
"lang": ["es-419"],
"v_lang": ["en"],
"a_lang": ["ja"],
"acodec": "AAC,EC3",
"forced_subs": True,
"exact_lang": True,
},
(["es-419"], ["en"], ["ja"], ["AAC", "EC3"], True, True),
),
],
)
@@ -224,7 +231,8 @@ def test_perform_download_puts_the_lang_selection_in_the_service_ctx(
ctx = exc.value.args[0]
p = ctx.params
assert (p["lang"], p["v_lang"], p["a_lang"], [c.name for c in p["acodec"]], p["forced_subs"]) == expected
selection = (p["lang"], p["v_lang"], p["a_lang"], [c.name for c in p["acodec"]], p["forced_subs"], p["exact_lang"])
assert selection == expected
def test_perform_download_passes_latest_episodes_to_dl_result(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None: