feat(dl): add --latest-episodes N to download the N newest episodes

Split episodes count once. Exposed as latest_episodes on the REST API. Closes #159.
This commit is contained in:
imSp4rky
2026-09-28 09:01:40 -06:00
parent c81c99fd96
commit 37e2b59bce
9 changed files with 140 additions and 24 deletions
+2 -1
View File
@@ -55,6 +55,7 @@ DEFAULT_DOWNLOAD_PARAMS = {
"no_atmos": False,
"wanted": [],
"latest_episode": False,
"latest_episodes": None,
"lang": ["orig"],
"v_lang": [],
"a_lang": [],
@@ -1871,7 +1872,7 @@ def validate_download_parameters(data: Dict[str, Any]) -> Optional[str]:
if not isinstance(data["downloads"], int) or data["downloads"] <= 0:
return "downloads must be a positive integer"
for name in ("tmdb_id", "tvdb_id"):
for name in ("tmdb_id", "tvdb_id", "latest_episodes"):
if data.get(name) is not None:
value = data[name]
if isinstance(value, bool) or not isinstance(value, int) or value <= 0: