Fix non-interactive anikoto backup downloads

- force anikoto-cli backup runs to auto-select the queued anime title through fzf filter options
- add a regression test for the backup retry environment
- bump the project version to 0.46.3 and document the fix in the changelog and README
This commit is contained in:
Dymas
2026-07-09 13:28:36 +02:00
parent 65a1bc1233
commit 897e12e019
5 changed files with 36 additions and 4 deletions
+14 -1
View File
@@ -695,7 +695,15 @@ class DownloadQueueWorkerFailureTests(unittest.TestCase):
def wait(self):
return 0
with mock.patch.object(queue_jobs.subprocess, "Popen", side_effect=[FailedProc(), SuccessProc()]), mock.patch.object(
popen_calls = []
def fake_popen(command, **kwargs):
popen_calls.append({"command": command, "env": dict(kwargs.get("env") or {})})
if len(popen_calls) == 1:
return FailedProc()
return SuccessProc()
with mock.patch.object(queue_jobs.subprocess, "Popen", side_effect=fake_popen), mock.patch.object(
queue, "_command_available", return_value=True
), mock.patch.object(
queue_jobs, "finalize_library_files", return_value=["/tmp/example/tv/Queue Show/Season 01/Queue Show - S01E01.mp4"]
@@ -708,6 +716,11 @@ class DownloadQueueWorkerFailureTests(unittest.TestCase):
self.assertIn("Retrying with backup downloader: anikoto-cli.", log_text)
self.assertIn("anikoto-cli does not support ani-cli quality flags", log_text)
self.assertIn("Download completed.", log_text)
self.assertEqual(len(popen_calls), 2)
self.assertNotIn("FZF_DEFAULT_OPTS", popen_calls[0]["env"])
self.assertIn("--exact", popen_calls[1]["env"]["FZF_DEFAULT_OPTS"])
self.assertIn("--select-1", popen_calls[1]["env"]["FZF_DEFAULT_OPTS"])
self.assertIn("Queue Show", popen_calls[1]["env"]["FZF_DEFAULT_OPTS"])
def test_run_job_marks_post_start_exception_failed_without_killing_worker_state(self):
queue = APP.DownloadQueue(lambda: {"mode": "sub", "quality": "best", "download_dir": "/tmp/example"}, start_worker=False)