Force ani-cli headless download mode

This commit is contained in:
Codex
2026-07-21 12:00:33 +02:00
parent ce8ca1d4fb
commit 629cf8dcb6
5 changed files with 12 additions and 2 deletions
+5
View File
@@ -1,5 +1,10 @@
# Changelog # 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 ## 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. - Ignored the local `_backup_/` folder in git and Docker build contexts so temporary backups do not get committed or copied into images.
+2 -1
View File
@@ -2,7 +2,7 @@
Local web UI for a system-wide `ani-cli` install. Local web UI for a system-wide `ani-cli` install.
Current version: `0.49.7` Current version: `0.49.8`
## What it does ## What it does
@@ -117,6 +117,7 @@ Docker notes:
- Queue jobs can use any checked combination of `ani-cli`, `anipy-cli`, and `animdl` - 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` - 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 - 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` - 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 - Docker images install `anipy-cli` and `animdl` automatically; non-Docker installs should provide the selected tools in `PATH` themselves
+1 -1
View File
@@ -1 +1 @@
0.49.7 0.49.8
+1
View File
@@ -1518,6 +1518,7 @@ class DownloadQueue:
"env": { "env": {
**os.environ.copy(), **os.environ.copy(),
"ANI_CLI_DOWNLOAD_DIR": str(staging_dir), "ANI_CLI_DOWNLOAD_DIR": str(staging_dir),
"ANI_CLI_PLAYER": "download",
"ANI_CLI_MODE": job["mode"], "ANI_CLI_MODE": job["mode"],
"ANI_CLI_QUALITY": job["quality"], "ANI_CLI_QUALITY": job["quality"],
"TERM": os.environ.get("TERM", "xterm-256color"), "TERM": os.environ.get("TERM", "xterm-256color"),
+3
View File
@@ -1094,6 +1094,7 @@ class DownloadQueueWorkerFailureTests(unittest.TestCase):
) )
job = queue.add({"query": "Queue Show", "title": "Queue Show", "season": "1", "episodes": "1"}) job = queue.add({"query": "Queue Show", "title": "Queue Show", "season": "1", "episodes": "1"})
commands = [] commands = []
envs = []
class FakeProc: class FakeProc:
def __init__(self, pid, stdout, exit_code): def __init__(self, pid, stdout, exit_code):
@@ -1112,6 +1113,7 @@ class DownloadQueueWorkerFailureTests(unittest.TestCase):
def fake_popen(command, **kwargs): def fake_popen(command, **kwargs):
commands.append(command) commands.append(command)
envs.append(kwargs.get("env", {}))
return processes.pop(0) return processes.pop(0)
with mock.patch.object(queue_jobs, "cli_executable_exists", return_value=True), mock.patch.object( 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.assertEqual(stored["status"], "done")
self.assertTrue(stored["fallback_used"]) 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([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"]) self.assertIn("Fallback download completed with animdl.", stored["log"])