installer
This commit is contained in:
@@ -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}")
|
||||
|
||||
Reference in New Issue
Block a user