fix(dl): handle cross-device moves when temp and downloads differ

This commit is contained in:
Andy
2026-02-22 10:52:04 -07:00
parent 4814ba9144
commit 8a4399665e

View File

@@ -2296,7 +2296,12 @@ class dl:
final_path = final_dir / f"{final_filename.rstrip()}{sep}{i}{muxed_path.suffix}" final_path = final_dir / f"{final_filename.rstrip()}{sep}{i}{muxed_path.suffix}"
i += 1 i += 1
try:
os.replace(muxed_path, final_path) 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) used_final_paths.add(final_path)
tags.tag_file(final_path, title, self.tmdb_id) tags.tag_file(final_path, title, self.tmdb_id)