RhetTbull / osxphotos

Python app to work with pictures and associated metadata from Apple Photos on macOS. Also includes a package to provide programmatic access to the Photos library, pictures, and metadata.
MIT License
1.84k stars 94 forks source link

True sync when updating #1580

Closed last-voice closed 2 weeks ago

last-voice commented 2 weeks ago

Hi Rhet,

at first my compliments for your great piece of work. Quite a project you developed! <3

I use osxphotos now for a few days, since the random wallpaper background in OSX won't work with albums in Photos. A problem that exists for many years now.

osxphotos is the very best workaround imho. See here: https://discussions.apple.com/thread/255110179?answerId=259695506022&sortBy=best#259695506022

But!

When executing

rm -rf /Users/xxx/Pictures/bg.osxphotos/*
/Users/xxx/.local/bin/osxphotos` export /Users/xxx/Pictures/bg.osxphotos --skip-original-if-edited --update --keyword "bg" 2>&1

the folder with my background photos is empty for some seconds, and if something goes wrong it even will still stay empty and OSX will change the wallpaper settings back to default when no pics are found.

SOLUTION:

A new command line option --sync in addition to --update which will delete pictures in the destination directory which are no longer found in the source in Photos. So if I delete pictures in Photos these will also no longer be exported but even deleted in the destination folder.

Thanks for taking this under consideration and THANKS again for this superb piece of software!

Greetings from Germany

tlv

oPromessa commented 2 weeks ago

@last-voice

Checkout the --cleanup option coupled with the --update option and see if it meets your needs.

Please note --cleanup will delete any and all files not related to export. If you want to keep some particular files use the --keep option. Try it with --dry-run and --verbose to see the changes to be done without applying them.

last-voice commented 2 weeks ago

Perfect! I full text searched the documentaion for delete and remove and sync and didn't find anything. So I didn't recognize this helpful option. Thank you!

last-voice commented 2 weeks ago

Tried it. Works perfect.

last-voice commented 2 weeks ago

ty!

RhetTbull commented 2 weeks ago

@last-voice osxphotos help has built in subtopic search. So in the future, you could search like this:

osxphotos help export delete

This searches the help for osxphotos export for the word delete.