Fix TV episode finalization numbering
This commit is contained in:
+29
@@ -851,6 +851,35 @@ class QueueApiTests(unittest.TestCase):
|
||||
self.assertTrue(Path(moved[0]).exists())
|
||||
self.assertTrue(Path(moved[1]).exists())
|
||||
|
||||
def test_tv_finalizer_preserves_episode_number_from_season_episode_filename(self):
|
||||
with tempfile.TemporaryDirectory() as temp_root:
|
||||
job = APP.app_support.build_job(
|
||||
{
|
||||
"query": "Jobless Reincarnation",
|
||||
"title": "Jobless Reincarnation",
|
||||
"anime_name": "Jobless Reincarnation",
|
||||
"media_type": "tv",
|
||||
"mode": "sub",
|
||||
"quality": "best",
|
||||
"episodes": "6",
|
||||
"download_dir": temp_root,
|
||||
"season": "3",
|
||||
},
|
||||
{"mode": "sub", "quality": "best", "download_dir": temp_root},
|
||||
)
|
||||
staging_dir = APP.app_support.job_staging_dir(job)
|
||||
staging_dir.mkdir(parents=True, exist_ok=True)
|
||||
source = staging_dir / "Jobless Reincarnation - S01E06.mp4"
|
||||
source.write_bytes(b"ep6")
|
||||
|
||||
moved = APP.app_support.finalize_library_files(job)
|
||||
|
||||
self.assertEqual(
|
||||
moved,
|
||||
[f"{temp_root}/tv/Jobless Reincarnation/Season 03/Jobless Reincarnation - S03E06.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