mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-03-10 16:39:01 +00:00
fix(dl): handle cross-device moves when temp and downloads differ
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user