mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-11-25 18:35:07 +00:00
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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user