Fix anipy fallback episode numbering
Use the queued episode spec when finalizing anipy-cli fallback TV downloads so retries keep the requested episode numbers instead of being renumbered from 1, and update tests plus release docs for the fix.
This commit is contained in:
+30
@@ -589,6 +589,36 @@ class QueueApiTests(unittest.TestCase):
|
||||
self.assertTrue(Path(moved[0]).exists())
|
||||
self.assertTrue(Path(moved[1]).exists())
|
||||
|
||||
def test_tv_finalizer_uses_requested_episode_numbers_for_anipy_fallback(self):
|
||||
with tempfile.TemporaryDirectory() as temp_root:
|
||||
job = APP.app_support.build_job(
|
||||
{
|
||||
"query": "Fallback Show",
|
||||
"title": "Fallback Show",
|
||||
"anime_name": "Fallback Show",
|
||||
"media_type": "tv",
|
||||
"mode": "sub",
|
||||
"quality": "best",
|
||||
"episodes": "11",
|
||||
"download_dir": temp_root,
|
||||
"season": "2",
|
||||
},
|
||||
{"mode": "sub", "quality": "best", "download_dir": temp_root},
|
||||
)
|
||||
job["download_backend"] = "anipy-cli"
|
||||
staging_dir = APP.app_support.job_staging_dir(job)
|
||||
staging_dir.mkdir(parents=True, exist_ok=True)
|
||||
source = staging_dir / "Fallback Show - S02E01.mp4"
|
||||
source.write_bytes(b"fallback")
|
||||
|
||||
moved = APP.app_support.finalize_library_files(job)
|
||||
|
||||
self.assertEqual(
|
||||
moved,
|
||||
[f"{temp_root}/tv/Fallback Show/Season 02/Fallback Show - S02E11.mp4"],
|
||||
)
|
||||
self.assertTrue(Path(moved[0]).exists())
|
||||
|
||||
def test_shutdown_wait_cancels_active_process_for_deterministic_teardown(self):
|
||||
queue = object.__new__(APP.DownloadQueue)
|
||||
queue.lock = threading.RLock()
|
||||
|
||||
Reference in New Issue
Block a user