From 8a4399665e6c57d4b84202f159efea8597af51ea Mon Sep 17 00:00:00 2001 From: Andy Date: Sun, 22 Feb 2026 10:52:04 -0700 Subject: [PATCH] fix(dl): handle cross-device moves when temp and downloads differ --- unshackle/commands/dl.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/unshackle/commands/dl.py b/unshackle/commands/dl.py index 2baf820..2a9ed33 100644 --- a/unshackle/commands/dl.py +++ b/unshackle/commands/dl.py @@ -2296,7 +2296,12 @@ class dl: final_path = final_dir / f"{final_filename.rstrip()}{sep}{i}{muxed_path.suffix}" i += 1 - os.replace(muxed_path, final_path) + try: + os.replace(muxed_path, final_path) + except OSError: + if final_path.exists(): + final_path.unlink() + shutil.move(muxed_path, final_path) used_final_paths.add(final_path) tags.tag_file(final_path, title, self.tmdb_id)