From 629cf8dcb6c9a24e62758a4625e5b5fa2dcb7ea4 Mon Sep 17 00:00:00 2001 From: Codex Date: Tue, 21 Jul 2026 12:00:33 +0200 Subject: [PATCH] Force ani-cli headless download mode --- CHANGELOG.md | 5 +++++ README.md | 3 ++- VERSION | 2 +- queue_jobs.py | 1 + test_app.py | 3 +++ 5 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3055f4b..5e2b837 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 0.49.8 - 2026-07-21 + +- Forced queued `ani-cli` attempts into explicit download-player mode with `ANI_CLI_PLAYER=download`, preventing headless Docker jobs from failing the upstream player check when `mpv` or `vlc` are not installed. +- Expanded fallback regression coverage for the `ani-cli` download-mode environment. + ## 0.49.7 - 2026-07-21 - Ignored the local `_backup_/` folder in git and Docker build contexts so temporary backups do not get committed or copied into images. diff --git a/README.md b/README.md index 4b9649e..f190330 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Local web UI for a system-wide `ani-cli` install. -Current version: `0.49.7` +Current version: `0.49.8` ## What it does @@ -117,6 +117,7 @@ Docker notes: - Queue jobs can use any checked combination of `ani-cli`, `anipy-cli`, and `animdl` - Checked methods are tried in this order: `ani-cli`, `anipy-cli`, then `animdl` - Selecting one method disables fallback retry; selecting multiple methods makes later methods automatic fallbacks +- Queue `ani-cli` downloads explicitly run with `ANI_CLI_PLAYER=download` so headless Docker installs do not need `mpv` or `vlc` just to save files - Fallback retries keep the queued episode numbers when fallback downloader filenames are renumbered from `1` - Docker images install `anipy-cli` and `animdl` automatically; non-Docker installs should provide the selected tools in `PATH` themselves diff --git a/VERSION b/VERSION index 41229c2..3174c45 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.49.7 +0.49.8 diff --git a/queue_jobs.py b/queue_jobs.py index 7fc3da7..ff80187 100644 --- a/queue_jobs.py +++ b/queue_jobs.py @@ -1518,6 +1518,7 @@ class DownloadQueue: "env": { **os.environ.copy(), "ANI_CLI_DOWNLOAD_DIR": str(staging_dir), + "ANI_CLI_PLAYER": "download", "ANI_CLI_MODE": job["mode"], "ANI_CLI_QUALITY": job["quality"], "TERM": os.environ.get("TERM", "xterm-256color"), diff --git a/test_app.py b/test_app.py index 5a01886..d70343d 100644 --- a/test_app.py +++ b/test_app.py @@ -1094,6 +1094,7 @@ class DownloadQueueWorkerFailureTests(unittest.TestCase): ) job = queue.add({"query": "Queue Show", "title": "Queue Show", "season": "1", "episodes": "1"}) commands = [] + envs = [] class FakeProc: def __init__(self, pid, stdout, exit_code): @@ -1112,6 +1113,7 @@ class DownloadQueueWorkerFailureTests(unittest.TestCase): def fake_popen(command, **kwargs): commands.append(command) + envs.append(kwargs.get("env", {})) return processes.pop(0) with mock.patch.object(queue_jobs, "cli_executable_exists", return_value=True), mock.patch.object( @@ -1125,6 +1127,7 @@ class DownloadQueueWorkerFailureTests(unittest.TestCase): self.assertEqual(stored["status"], "done") self.assertTrue(stored["fallback_used"]) self.assertEqual([command[0] for command in commands], [APP.app_support.ANI_CLI, APP.app_support.ANIPY_CLI, APP.app_support.ANIMDL]) + self.assertEqual(envs[0]["ANI_CLI_PLAYER"], "download") self.assertIn("Fallback download completed with animdl.", stored["log"])