Open oPromessa opened 1 month ago
Good suggestions.
For location, it obviously can't be merged so the behavior would need to be determined for what happens if user uses --merge location
. Currently the code doesn't have separate lists of properties for --set
or --merge
. I would recommend the behavior be the same as it is for favorite
: if --merge
and property is set in the destination then no action is taken; if property is not set in the destination but is set in the source, then the value is copied to destination.
The location
field would need to be added to SYNC_IMPORT_TYPES
:
Then the import_metadata_for_photo
function would need to be updated to handle this, either in a separate block like albums are handled:
Or in _set_metadata_for_photo
and _merge_metadata_for_photo
functions.
The folders/albums
feature will take a bit more work and I'll have to dig in a bit more when I get a chance.
FYI only....
While trying to run --tests-sync
I bumped into the get_os_version
code in tests/conftest.py
expecting to get my current OS version Sonoma's 14.6.1. I got 10.16 instead!!. Explained here: pythons-platform-mac-ver-reports-incorrect-macos-version.
I'm pretty sure you @RhetTbull are aware of SYSTEM_VERSION_COMPAT mode variable:
$ SYSTEM_VERSION_COMPAT=0 python3.11 -c 'import platform; print(platform.mac_ver())'
('14.6.1', ('', '', ''), 'x86_64')
$ SYSTEM_VERSION_COMPAT=1 python3.11 -c 'import platform; print(platform.mac_ver())'
('10.16', ('', '', ''), 'x86_64')
For now I'll edit tests/conftest.py
to also accept OS_VER[1] == 16
to allow me to run the --tests-sync
option locally.
https://github.com/RhetTbull/osxphotos/blob/9a07c29e50dd45c178eba5d890314729fa048997/tests/conftest.py#L70-L72
- Working on set/merge location... Compare branches Rhet's main - oPromessa's sync-location branch
- What's the best strategy to update test_cli_sync.py to cover this scenario? Update:
- I'm moving along nicely.
- Changed sync.py and sync_results.py
- Found issue #1641.
- Changed
conftest.py
- Added location tests that run successfully locally with
python -m pytest -vv --test-sync tests/test_cli_sync.py
- Tests
python -m pytest -vv
PASS locally (python 3.11)- 🛑 But the Actions tests fail when running automatically on or around (weird!)
tests/test_catalina_10_15_7.py::test_asdict
. But re-running them one-by-one they PASS (for Mac... and Ubuntu). https://github.com/RhetTbull/osxphotos/blob/9a07c29e50dd45c178eba5d890314729fa048997/tests/test_catalina_10_15_7.py#L1506
Great! I'll take a look at the failing tests when I get a chance. I responded to #1641 -- I don't believe it's actually a bug but intended behavior.
--set / --merge location feature added via #1642
Thanks! Should be merged in 0.68.5. I will work on the folder path part as I have time. Currently working on some changes to date handling so OSXPhotos can access the original date of an image even if it's been changed by the user in Photos.
Thanks! Should be merged in 0.68.5. I will work on the folder path part as I have time. Currently working on some changes to date handling so OSXPhotos can access the original date of an image even if it's been changed by the user in Photos.
Cool. Now that you mention dates; I was also thinking if sync should also set dates coming from the original database ?
Yes that's a good idea.
I'll work on adding the date + folder structure soon. Finishing some re-factoring of the date/time code to allow retrieval of the original date even if user has changed it. (Will allow osxphotos timewarp
to reset dates, for example). I need to finish that code first.
My plan at the moment is to have albums
or all
sync folder structure by default as this avoids conflicts if user has Folder1/Album1
in one library and Album1
as a top level album in another -- photos get synced to the "right" album. With the code I posted to #1650 I could also remove photos from albums...make make that a separate option.
Is your feature request related to a problem? Please describe.
osxphotos sync --import db --set all
or--merge all
the GPS location is not carried over from the original DB into the sync'ed DB.osxphotos import
does not ignore.Describe the solution you'd like
osxphotos --set / --merge all
to also consider locationosxphotos --set / --merge location
osxphotos --set / --merge all
to also consider folder structure by defaultosxphotos --set / --merge folder
optionosxphotos --set / --merge album/all --folder
optionDescribe alternatives you've considered
osxphotos import --exportdb
does this wonderfully, with the exceptions of i) taking some time and ii) AppleScript returning errors on import (some time overcome with rerun and --resue, sometimes not)osxphotos import
none I could thing of.Additional context