Harden queue matching and retry behavior
This commit is contained in:
+2
-14
@@ -20,7 +20,7 @@ from uuid import uuid4
|
||||
PROJECT_ROOT = Path(__file__).resolve().parent
|
||||
ANI_CLI = os.environ.get("ANI_CLI_BIN") or shutil.which("ani-cli") or "ani-cli"
|
||||
APP_NAME = "ani-cli-web"
|
||||
VERSION = "0.45.6"
|
||||
VERSION = "0.45.7"
|
||||
ALLANIME_BASE = "allanime.day"
|
||||
ALLANIME_API = f"https://api.{ALLANIME_BASE}"
|
||||
ALLANIME_REFERER = "https://allmanga.to"
|
||||
@@ -941,16 +941,6 @@ def build_job(payload, config):
|
||||
anime_name = sanitize_path_component(payload.get("anime_name") or title)
|
||||
if not query:
|
||||
raise ValueError("Missing search query")
|
||||
raw_index = payload.get("index")
|
||||
if raw_index in (None, ""):
|
||||
index = None
|
||||
else:
|
||||
try:
|
||||
index = int(raw_index)
|
||||
except (TypeError, ValueError) as exc:
|
||||
raise ValueError("Invalid result index") from exc
|
||||
if index < 1:
|
||||
raise ValueError("Result index must be positive")
|
||||
|
||||
mode = str(payload.get("mode") or config["mode"]).lower()
|
||||
quality = str(payload.get("quality") or config["quality"]).lower()
|
||||
@@ -970,7 +960,7 @@ def build_job(payload, config):
|
||||
"season": normalize_season(payload.get("season")),
|
||||
"episode_offset": normalize_episode_offset(payload.get("episode_offset")),
|
||||
"query": query,
|
||||
"result_index": index,
|
||||
"result_index": None,
|
||||
"mode": mode,
|
||||
"quality": quality,
|
||||
"episodes": validate_episode_spec(payload.get("episodes")),
|
||||
@@ -995,8 +985,6 @@ def command_for_job(job):
|
||||
"-e",
|
||||
job["episodes"],
|
||||
]
|
||||
if job.get("result_index"):
|
||||
command.extend(["-S", str(job["result_index"])])
|
||||
if job["mode"] == "dub":
|
||||
command.append("--dub")
|
||||
command.append(job["query"])
|
||||
|
||||
Reference in New Issue
Block a user