-
Notifications
You must be signed in to change notification settings - Fork 105
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
Add option to bypass checking for .osxphotos_export.db in the export folder. #1774
Comments
This seems reasonable. I see a few things that are related. There's already a
This is a for a different use case (user ran Thus, you'd add a check to the call to osxphotos/osxphotos/cli/export.py Lines 1754 to 1780 in f840086
While you're at it, it would be good to short-circuit ❯ rg find_files_in_branch
osxphotos/cli/export.py
1772: other_db_files = find_files_in_branch(dest, OSXPHOTOS_EXPORT_DB)
3003:def find_files_in_branch(pathname, filename): osxphotos/osxphotos/cli/export.py Lines 3003 to 3036 in f840086
|
…t.db in the export folder. (#1775) * enhancement-1774: first adjustments. Missing adjustment to find_first_file_in_branch. * enhancement-1774: Adjustment to find_first_file_in_branch to return list of first file found. * * Reusing option --ignore-exportdb * Removed exclusivity of options --update and --ignore-exportdb * Search for files logic will also **not be done** in case options --exportdb or --no-exportdb are used. * Adjusted option definition. Maybe a bit lengthy 😞 ! * Renamed function find_files_in_branch into find_first_file_in_branch and revised logic to return on first occurrence found, when --ignore-exportdb is not active. * When --update is not used, added warnings when --ignore-exportdb is in use to make it compatible with interactive questions. * Addressing topics: - find_first_file_in_branch should now return either None or a single str with the file path instead of a list or empty list. - Change other_db_files to other_db_file and the subsequent warning that lists out the files to now say "file" vs "files". * adjusted test "test_export_update_parent_folder" and "test_export_update_child_folder" * * Error in Tests: [Fatal Python error: Segmentation fault](https://github.com/RhetTbull/osxphotos/actions/runs/12612637331/job/35149593923#step:9:261) * Unable to re-run Tests up-stream :( * Adjusting some long lines and forcing commit!
Is your feature request related to a problem? Please describe.
Slow start of export taking ~12 minutes while searching for .osxphotos_export.db files in the export destination folder (which is SMB remotely mounted and is composed of thousands of folders).
Describe the solution you'd like
For expert users which are certain no other export.db exists in the export folder have an option to bypass this check.
Other than that, optimize the os.walk in some way and maybe stop as soon as the first occurrence of a .osxphotos_export.db fileis found?
osxphotos/osxphotos/cli/export.py
Line 1772 in f840086
If you agree in adding an option like --no-check-exportdb -- open to other suggestions 😄 -- I could try to build up a PR.
Describe alternatives you've considered
Maybe add a warning in case a .osxphotos_export.db is found while running the delete code for --update. Hmm, not applicable on all cases 😞 !
Additional context
N/A
The text was updated successfully, but these errors were encountered: