os.rename → shutil.move

This commit is contained in:
2024-07-10 21:40:25 +02:00
parent 761d3d2fba
commit 4402c31c48

View File

@@ -91,7 +91,7 @@ def generate_thumbnail(arguments: Tuple[str, str, str, bool]) -> None:
oldpath = os.path.join(root_directory, ".thumbnails", folder.removeprefix(root_directory), os.path.splitext(item)[0]) + ".jpg" oldpath = os.path.join(root_directory, ".thumbnails", folder.removeprefix(root_directory), os.path.splitext(item)[0]) + ".jpg"
if os.path.exists(oldpath): if os.path.exists(oldpath):
try: try:
os.rename(oldpath, path) shutil.move(oldpath, path)
except FileNotFoundError: except FileNotFoundError:
pass pass
if not os.path.exists(path) or regenerate_thumbnails: if not os.path.exists(path) or regenerate_thumbnails: