diff --git a/handle_imported_video.py b/handle_imported_video.py index a3b6ad4..cdc60f4 100644 --- a/handle_imported_video.py +++ b/handle_imported_video.py @@ -86,7 +86,7 @@ for o, a in opts: - +_BACKUP = [] #print(_FULL_PATH) @@ -179,19 +179,26 @@ def flip_videos(_DEV,_SOURCE_DIR,_DAY_DIRS): print(output) time.sleep(2) try: - print("Moving file to processed") src = _FULL_PATH + filename + "_original" dest = _PROCESSED + "/" + filename - print(f"Source : {src}") - print(f"Destination : {dest}") - shutil.move(src, dest) - # shutil.move(export_name, export_name) - + if os.path.exists(dest): + os.remove(filename) + else: + print("Moving file to processed") + + + print(f"Source : {src}") + print(f"Destination : {dest}") + shutil.move(src, dest) + # shutil.move(export_name, export_name) + filedate.File(filename).set( created = create_date["created"], modified = create_date["modified"], accessed = create_date["accessed"] ) + + except ValueError as e: print(e) print(f"Failed to move {export_name}")