Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--cleanup and --limit causes files to be deleted that shouldn't be #1505

Open
RhetTbull opened this issue Apr 8, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@RhetTbull
Copy link
Owner

RhetTbull commented Apr 8, 2024

At the end of the script it started deleting all my files, it seems. Not sure what has changed. Perhaps it cleans up files that were unchanged? That doesn't seem right.

filepath='/Volumes/ExternalData/Users/odedia/Pictures/OSXPhotos/2023/2023-04-19/IMG_8086.HEIC', 
quote=False, caller='export'), replace_keywords=True, rich=True, export_aae=False, sidecar_drop_ext=True, 
sidecar=4, strip=False, timeout=120, touch_file=False, update=True, update_errors=False, 
use_albums_as_keywords=False, use_persons_as_keywords=False, use_photokit=True, use_photos_export=False, 
verbose=<function _verbose_print_function.<locals>.rich_verbose_ at 0x11260fba0>, tmpdir=None, 
favorite_rating=False, fix_orientation=False)) and kwargs: {}
2024-04-08T15:24:43.359676 _should_update_photo returned: False, elapsed time: 0.0004864820002694614 sec
Exported IMG_8086.HEIC to /Volumes/ExternalData/Users/odedia/Pictures/OSXPhotos/2023/2023-04-19/IMG_8086.mov
Skipped up to date XMP sidecar /Volumes/ExternalData/Users/odedia/Pictures/OSXPhotos/2023/2023-04-19/IMG_8086.xmp
Exported new file /Volumes/ExternalData/Users/odedia/Pictures/OSXPhotos/2023/2023-04-19/IMG_8086.mov
Skipped up to date file /Volumes/ExternalData/Users/odedia/Pictures/OSXPhotos/2023/2023-04-19/IMG_8086.HEIC
Exporting 78416 photos (limit = 10) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00
Processed: 78416 photos, exported: 10, updated: 0, skipped: 9808, updated EXIF data: 0, missing: 1, error: 0, limit: 10/10 exported
Elapsed time: 0:06:25
Cleaning up /Volumes/ExternalData/Users/odedia/Pictures/OSXPhotos
Deleting /Volumes/ExternalData/Users/odedia/Pictures/OSXPhotos/2013/2013-04-06/IMG_1226.xmp
Deleting /Volumes/ExternalData/Users/odedia/Pictures/OSXPhotos/2013/2013-04-06/IMG_1227.JPG
Deleting /Volumes/ExternalData/Users/odedia/Pictures/OSXPhotos/2013/2013-04-06/IMG_1226.JPG
Deleting /Volumes/ExternalData/Users/odedia/Pictures/OSXPhotos/2013/2013-04-06/IMG_1227.xmp
Deleting /Volumes/ExternalData/Users/odedia/Pictures/OSXPhotos/2013/2013-04-06/IMG_1225.xmp
Deleting /Volumes/ExternalData/Users/odedia/Pictures/OSXPhotos/2013/2013-04-06/IMG_1224.JPG
Deleting /Volumes/ExternalData/Users/odedia/Pictures/OSXPhotos/2013/2013-04-06/IMG_1225.JPG
Deleting /Volumes/ExternalData/Users/odedia/Pictures/OSXPhotos/2013/2013-04-06/IMG_1224.xmp
Deleting /Volumes/ExternalData/Users/odedia/Pictures/OSXPhotos/2013/2013-04-01/IMG_1202_edited.xmp
Deleting /Volumes/ExternalData/Users/odedia/Pictures/OSXPhotos/2013/2013-04-01/IMG_1202_edited.jpeg
Deleting /Volumes/ExternalData/Users/odedia/Pictures/OSXPhotos/2013/2013-04-01/IMG_1209.JPG
@RhetTbull RhetTbull added the bug Something isn't working label Apr 8, 2024
@RhetTbull
Copy link
Owner Author

This is because --cleanup looks the ExportResults (including files skipped) to see what needs to be kept but with --limit, execution halts and the skipped files are never skipped and thus added to the ExportResults.

It might be better to just preclude the use of --limit with --cleanup as supporting --limit would require pre-computing all the export paths that would have been run or skipping each one because limit has been reached.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant