installer

This commit is contained in:
2024-05-26 23:25:59 +02:00
parent 0dea53d8f5
commit f4ace7efa3
7 changed files with 69 additions and 7 deletions

View File

@@ -22,10 +22,10 @@ def sort_pictures(images:list, dst:str, logger:logging.Logger):
image:ExifData
if not image: continue
path = os.path.join(dst, str(image.make), str(image.year), str(image.month), str(image.day))
if not os.path.exists(path): os.makedirs(path)
image_dst = os.path.join(path, image.name)
if not os.path.exists(path): os.makedirs(path, exist_ok=True)
stat_info = os.stat(image.path)
image_dst = f"{path}{os.sep}{image.name}"
shutil.move(src=image.path, dst=image_dst)
# os.chmod(path=f"{path}/{image.name}", mode=stat_info.st_mode)
logger.info(f"Moved {image.path} -> {image_dst}")