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
Video keeps being exported on every run even with seemly no changes. Adding suffix "(1)" and deleting the origin file in cycle. #695
Comments
You were on the right track with --breakpoint and _should_update_photo is the right method. That will work but --watch is easier in this case. Use this instead of your
This will show all calls to the function listing values of input arguments and the return value. So in an example where I touched the destination file to change the signature, I got this:
And from DEST_SIG_DIFFERENT as the return value, I can see it was updated because the signature was different. The possible return values of _should_update_photo are:
So add a watch to your export and then try to re-export just that photo (maybe using --selected or You could have done this with breakpoint but it's less convenient. The way osxphotos implements --breakpoint, the function is wrapped in a breakpoint so the break happens right before the function call so you have to s (step) into the actual function then you can use n (next) to step through each line. Or if you just use n (next) as soon as the breakpoint happens you actually step over the function but it shows the return value like this:
In this case you can see the return value is 4 (unfortunately the enum name is truncated) but 4 is "DEST_SIG_DIFFERENT" and in my test, I had touched the destination file so it's signature was different and this is what's expected. |
Running with I've ran with
But I understand I believe I need to find which function and how to osxphotos/osxphotos/cli/export.py Line 1388 in 8e9f279
|
Traced it down up to the following code.
Note: Must still debug when the actual file exported is "MVI_2452" without "(1)" osxphotos/osxphotos/photoexporter.py Lines 1078 to 1093 in 8e9f279
|
Yup, I think that's the issue. Now why only with this file!!! Maybe because the sqlite> select id, filepath_normalized, uuid, digest from export_data where filepath like "%MVI_2452%";
26569|(...)/mvi_2452.mov|828CCC89-AE80-4DD5-B8A1-124C2C30352C|7473cdd72e3ce53d0677e52a08025d51f32bd14c
86041|(...)/mvi_2452 (1).mov|F4A5369A-6553-4933-8805-273F0004A46C|7473cdd72e3ce53d0677e52a08025d51f32bd14c Querying Photos for the uuids only one is valid: 13:18:56 MSP ~[1998]> osxphotos query --uuid 828CCC89-AE80-4DD5-B8A1-124C2C30352C
Using last opened Photos library: /Users/Shared/Pictures/iPhoto Shared Library.photoslibrary
uuid,filename,original_filename,date,description,title,keywords,albums,persons,path,ismissing,hasadjustments,external_edit,favorite,hidden,shared,latitude,longitude,path_edited,isphoto,ismovie,uti,burst,live_photo,path_live_photo,iscloudasset,incloud,date_modified,portrait,screenshot,slow_mo,time_lapse,hdr,selfie,panorama,has_raw,uti_raw,path_raw,intrash
(venv)
Donald#~>
13:19:53 MSP ~[1999]> osxphotos query --uuid F4A5369A-6553-4933-8805-273F0004A46C
Using last opened Photos library: /Users/Shared/Pictures/iPhoto Shared Library.photoslibrary
uuid,filename,original_filename,date,description,title,keywords,albums,persons,path,ismissing,hasadjustments,external_edit,favorite,hidden,shared,latitude,longitude,path_edited,isphoto,ismovie,uti,burst,live_photo,path_live_photo,iscloudasset,incloud,date_modified,portrait,screenshot,slow_mo,time_lapse,hdr,selfie,panorama,has_raw,uti_raw,path_raw,intrash
F4A5369A-6553-4933-8805-273F0004A46C,MVI_2452.MOV,MVI_2452.MOV,2017-05-11T22:02:22+01:00,,,(...), _UNKNOWN_, _UNKNOWN_",/Users/Shared/Pictures/Pictures/iPhoto/2017-06-11-1727-00/MVI_2452.MOV,False,False,False,False,False,False,,,,False,True,com.apple.quicktime-movie,False,False,,False,,,False,False,False,False,False,False,False,False,,,False Will delete |
The duplicate name with wrong UUID would definitely cause the file to be exported with the You can see more information about the mystery uuid using this query:
|
You could also delete the mystery record without deleting the whole database using:
|
In v0.49.3 I've added two new options to the exportdb command that should help debug things like this issue:
prints out the JSON PhotoInfo record for the UUID so you can find out more about which photo it is
Prints out list of all exported files associated with the UUID. |
I guess... what happens is that with the "delete" option osxphotos deletes original file. So it resets it and it's back to the same issue. With a clean 1st run
2nd run
I'm running now the global export (~85K pics so it takes 3.5 hours...) to check. |
Are you using |
Yes... RUN 1> 2022-05-18 06:13:41.213373 -- Exporting MVI_2452.MOV (MVI_2452.MOV) as MVI_2452.MOV (65496/84990)
> 2022-05-18 06:13:41.230449 -- Writing metadata with exiftool for MVI_2452 (1).MOV
> 2022-05-18 06:13:45.708574 -- Exported new file /Volumes/photo-1/(...)/MVI_2452 (1).MOV
> 2022-05-18 06:13:45.709553 -- Touched date on file /Volumes/photo-1/(...)/MVI_2452 (1).MOV
> 2022-05-18 06:59:34.066710 -- Deleting /Volumes/photo-1/(...)/MVI_2452.MOV RUN 2> 2022-05-19 05:45:12.048207 -- Exporting MVI_2452.MOV (MVI_2452.MOV) as MVI_2452.MOV (53069/84990)
> 2022-05-19 05:45:12.051214 -- Writing metadata with exiftool for MVI_2452.MOV
> 2022-05-19 05:45:16.914429 -- Exported new file /Volumes/photo-1/(...)/MVI_2452.MOV
> 2022-05-19 05:45:16.919108 -- Touched date on file /Volumes/photo-1/(...)/MVI_2452.MOV
> 2022-05-19 06:59:53.336335 -- Deleting /Volumes/photo-1/(...)/MVI_2452 (1).MOV |
If you have the full logs for both those runs would be useful to see if any other file with the same name was exported. for example: |
Sure... up to 2022.03.05 with I could try to recover the
From that date onwards it started the loop! I know for a fact I played quiet a lot with
It's possible such changes prompted the wrong entry on the database! I tag in the log with BTW... Waiting for my test to finish! 934791 [notice] --- Start Sat 5 Mar 2022 03:13:00 WET p= 1 LONG=
2022-03-05 03:13:26.791842 -- osxphotos version 0.47.4
Exporting 84831 photos to /Volumes/photo-1/Family.Photos...
2022-03-05 03:57:03.825547 -- Exporting MVI_2452.MOV (MVI_2452.MOV) as MVI_2452.MOV (8121/84831)
2022-03-05 03:57:03.986972 -- Skipped up to date file /Volumes/photo-1/Family.Photos/(...)/MVI_2452 (1).MOV
Processed: 84831 photos, exported: 7, updated: 2379, skipped: 83806, updated EXIF data: 2386, missing: 13, error: 0, touched date: 2386
Elapsed time: 3:25:01
1119787 [notice] --- End Sat 5 Mar 2022 07:02:39 WET p.end= 0
(...)
1124860 [notice] --- Start Sat 5 Mar 2022 16:28:00 WET p= 1 LONG=
2022-03-05 16:28:02.272965 -- osxphotos version 0.47.4
Exporting 84818 photos to /Volumes/photo-1/Family.Photos...
2022-03-05 19:43:00.254763 -- Exporting MVI_2452.MOV (MVI_2452.MOV) as MVI_2452.MOV (60185/84818)
2022-03-05 19:43:00.402055 -- Skipped up to date file /Volumes/photo-1/Family.Photos/(...)/MVI_2452 (1).MOV
Processed: 84818 photos, exported: 0, updated: 693, skipped: 85499, updated EXIF data: 693, missing: 0, error: 0, touched date: 719
Elapsed time: 3:13:31
2022-03-05 20:41:10.103843 -- Deleting /Volumes/photo-1/Family.Photos/(...)/MVI_2452.MOV
Deleted: 4 files, 1 directory
1305962 [notice] --- End Sat 5 Mar 2022 20:47:10 WET p.end= 0
1305963 [notice] --- Start Sun 6 Mar 2022 16:28:00 WET p= 1 LONG=
2022-03-06 16:28:03.322688 -- osxphotos version 0.47.4
Exporting 84818 photos to /Volumes/photo-1/Family.Photos...
2022-03-06 19:13:13.095921 -- Exporting MVI_2452.MOV (MVI_2452.MOV) as MVI_2452.MOV (64353/84818)
2022-03-06 19:13:13.098112 -- Writing metadata with exiftool for MVI_2452.MOV
2022-03-06 19:13:17.918678 -- Exported new file /Volumes/photo-1/Family.Photos/(...)/MVI_2452.MOV
2022-03-06 19:13:17.919041 -- Touched date on file /Volumes/photo-1/Family.Photos/(...)/MVI_2452.MOV
Processed: 84818 photos, exported: 1, updated: 989, skipped: 85202, updated EXIF data: 989, missing: 0, error: 0, touched date: 1016
Elapsed time: 3:31:39
2022-03-06 20:03:38.687133 -- Deleting /Volumes/photo-1/Family.Photos/(...)/MVI_2452 (1).MOV
Deleted: 1 file, 0 directories
1487694 [notice] --- End Sun 6 Mar 2022 20:10:18 WET p.end= 0
1487695 [notice] --- Start Mon 7 Mar 2022 13:32:00 WET p= 1 LONG=
2022-03-07 13:32:02.412506 -- osxphotos version 0.47.4
Exporting 84818 photos to /Volumes/photo-1/Family.Photos...
2022-03-07 13:37:23.222391 -- Exporting MVI_2452.MOV (MVI_2452.MOV) as MVI_2452.MOV (1927/84818)
2022-03-07 13:37:23.241301 -- Writing metadata with exiftool for MVI_2452 (1).MOV
2022-03-07 13:37:27.804058 -- Exported new file /Volumes/photo-1/Family.Photos/(...)/MVI_2452 (1).MOV
2022-03-07 13:37:27.806655 -- Touched date on file /Volumes/photo-1/Family.Photos/(...)/MVI_2452 (1).MOV
Processed: 84818 photos, exported: 1, updated: 974, skipped: 85217, updated EXIF data: 974, missing: 0, error: 0, touched date: 1001
Elapsed time: 3:16:40
2022-03-07 16:51:11.283669 -- Deleting /Volumes/photo-1/Family.Photos/(...)/MVI_2452.MOV
Deleted: 1 file, 0 directories
1669397 [notice] --- End Mon 7 Mar 2022 16:58:17 WET p.end= 0
(...)
6103875 [notice] --- Start Fri 20 May 2022 03:44:00 WEST p= 1 LONG=
2022-05-20 03:44:03.378218 -- osxphotos version 0.49.0
2022-05-20 03:45:05.094638 -- Exporting 84990 photos to /Volumes/photo-1/Family.Photos...
2022-05-20 06:08:21.748926 -- Exporting MVI_2452.MOV (MVI_2452.MOV) as MVI_2452.MOV (55309/84990)
2022-05-20 06:08:21.785689 -- Writing metadata with exiftool for MVI_2452 (1).MOV
2022-05-20 06:08:26.754378 -- Exported new file /Volumes/photo-1/Family.Photos/(...)/MVI_2452 (1).MOV
2022-05-20 06:08:27.427575 -- Touched date on file /Volumes/photo-1/Family.Photos/(...)/MVI_2452 (1).MOV
Exporting 84990 photos ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00
2022-05-20 07:28:07.059193 -- Processed: 84990 photos, exported: 1, updated: 260, skipped: 86102, updated EXIF data: 260, missing: 1, error: 0, touched date: 287
2022-05-20 07:28:07.059932 -- Elapsed time: 3:43:02
2022-05-20 07:30:02.000024 -- Deleting /Volumes/photo-1/Family.Photos/(...)/MVI_2452.MOV
2022-05-20 07:36:44.364708 -- Deleted: 1 file, 0 directories
6369535 [notice] --- End Fri 20 May 2022 07:37:20 WEST p.end= 0
6369536 [notice] --- Start Sat 21 May 2022 03:44:00 WEST p= 1 LONG=
2022-05-21 03:44:02.443207 -- osxphotos version 0.49.0
2022-05-21 03:45:03.056813 -- Exporting 84990 photos to /Volumes/photo-1/Family.Photos...
2022-05-21 03:46:08.768378 -- Exporting MVI_2452.MOV (MVI_2452.MOV) as MVI_2452.MOV (400/84990)
2022-05-21 03:46:08.769519 -- Writing metadata with exiftool for MVI_2452.MOV
2022-05-21 03:46:13.358193 -- Exported new file /Volumes/photo-1/Family.Photos/(...)/MVI_2452.MOV
2022-05-21 03:46:13.358628 -- Touched date on file /Volumes/photo-1/Family.Photos/(...)/MVI_2452.MOV
Exporting 84990 photos ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00
2022-05-21 07:27:44.521930 -- Processed: 84990 photos, exported: 1, updated: 236, skipped: 86126, updated EXIF data: 236, missing: 1, error: 0, touched date: 263
2022-05-21 07:27:44.522639 -- Elapsed time: 3:42:41
2022-05-21 07:29:37.423443 -- Deleting /Volumes/photo-1/Family.Photos/(...)/MVI_2452 (1).MOV
2022-05-21 07:35:27.570016 -- Deleted: 1 file, 0 directories
6635147 [notice] --- End Sat 21 May 2022 07:36:10 WEST p.end= 0 |
Thanks. Nothing jumps out here but I'll look at 0.47.4 and see if anything changed that points to this issue. In research this I did discover another bug? that occurs if you have two files with the same name in the same folder and then delete one. osxphotos can in that instance end up exporting the deleted file over top the one that's still there, then see the uuid is wrong on the next photo and re-export over top again. This is fixed with a subsequent export which correctly sees the the existing file and adds
|
This would cause the UUID to change so that's possibly where the phantom UUID in the export database came from. I'm still not sure why that would cause the cyclical export though. Ideally there would never be duplicate file names in a directory when exported. I've tried to handle all edge cases but it is a tricky problem to track which filename goes with which uuid. |
So I did some forensics investigation:
13:02:02 MSP INVESTIGATION[2331]> sqlite3 .osxphotos_export.20220119.db "select * from files where filepath like '%MVI_2452%';"
26616|(...)/MVI_2452.MOV|(...)/mvi_2452.mov|828CCC89-AE80-4DD5-B8A1-124C2C30352C|32768|314223950|1641699976.0|32768|314224767|1641699976.0
(venv)
13:02:15 MSP INVESTIGATION[2332]> sqlite3 .osxphotos_export.20220203.db "select * from files where filepath like '%MVI_2452%';"
26616|(...)/MVI_2452.MOV|(...)/mvi_2452.mov|828CCC89-AE80-4DD5-B8A1-124C2C30352C|32768|314223950|1643860548.0|32768|314224767|1494536542.0
86126|(...)/MVI_2452 (1).MOV|(...)/mvi_2452 (1).mov|F4A5369A-6553-4933-8805-273F0004A46C|32768|314223950|1643839208.0|32768|314224767|1494536542.0
(venv) I guess I'd still have to test osxphotos behaviour with edited MOVIES. |
Thanks, I'll take a look at this. Since you deleted the backup database and re-exported, has the problem persisted? Is the file being handled correctly or is it still in a loop? |
Getting somewhere....used your config file from #654, created two videos with same name, exported, edited 1 then re-exported and now I've got a loop similar to your situation. Now that I have a test config that can recreate a similar situation I'll see if I can track this down any further. |
Sorry I ended up not updating you.
Side note: Just updated to the latest osxphotos 0.49.6 version Next run will be with this version! osxphotos exportdb .osxphotos_export.db --sql "select * from export_data where filepath like '%MVI_2452%'"
(
86041,
'(...)/mvi_2452 (1).mov',
'(...)/MVI_2452 (1).MOV',
'F4A5369A-6553-4933-8805-273F0004A46C',
32768,
314223950,
1494536542.0,
32768,
314226926,
1494536542.0,
'7473cdd72e3ce53d0677e52a08025d51f32bd14c',
'[{"EXIF:ImageDescription": "(...)", (...) QuickTime:CreationDate": "2017:05:11 22:02:22+01:00", "QuickTime:CreateDate": "2017:05:11 21:02:22",
"QuickTime:ModifyDate": "2017:05:11 21:02:22"}]',
2,
None
)
(
88345,
'(...)/mvi_2452.mov',
'(...)/MVI_2452.MOV',
'F4A5369A-6553-4933-8805-273F0004A46C',
32768,
314223950,
1494536542.0,
32768,
314227519,
1494536542.0,
'68df2be7ed859855a0313fe382559b7b20f7cc47',
'[{"EXIF:ImageDescription": (...) "QuickTime:CreationDate": "2017:05:11 22:02:22+01:00", "QuickTime:CreateDate": "2017:05:11 21:02:22", "QuickTime:ModifyDate": "2017:05:11 21:02:22"}]',
2,
None
)
15:29:54 MSP Logs[2358]> osxphotos exportdb .osxphotos_export.db --sql "select photoinfo from photoinfo where uuid = 'F4A5369A-6553-4933-8805-273F0004A46C'"
(
'{"albums": [(...) "uuid":
"E9961FDE-CCC9-4CD5-9769-E4997849B19A", "yaw": 0.0}], "favorite": false, "filename": "MVI_2452.MOV", "folders": (...)(...)
"uuid": "F4A5369A-6553-4933-8805-273F0004A46C", "width": 1920}',
)
|
Found the problem! Will describe more when I have a chance and work on a solution. |
For this issue to occur, there must be two files with the same name exported to the same directory and at some point one of them must change names or get deleted. And the order matters...you have a 50/50 chance this will occur in the event there are two files with the same name, one of them is deleted or edited (causing name change), and you're using
This:
leads me to believe they were the same file (a duplicate that got deleted) or it was a result of you editing the file with exiftool then re-importing. Here's what I think is going on. This condition only happens with Two files, both with same name, end up in the same directory. run
ExportDB (export_data table) now looks like:
Edit the file associated with UUID_A then run
cleanup now deletes
ExportDB (export_data table) now looks like:
Run
cleanup now deletes Run
Because cleanup now deletes |
I'm still trying to figure out a fix that handles all the edge cases. In this simple case, I could just check the database even if the file is missing from the export directory to see if the target filename is already associated with a UUID and if so, increment the filename. But this fails for the case where you have more than two files in this situation as we'd have to check every permutation of the file ( I think a better solution is to add a new table to the database that is a mapping of (uuid, desired target file name) --> actual target file name. For example:
In this case, when
This means that once a photo is associated with an increment, it would also keep that increment even if the conflicting filename no longer exists in the database. |
I think I found a way to fix this without creating a new table. I implemented a function that searches through the export database for all possible matches of the file (incrementing the file counter) to see if it has been previously associated with the UUID in question and if so, uses the previously used filename. This results in preserving the mapping of UUID -> filename even if other files are added or deleted, so a file exported as As an aside, I think this is going to result in faster exports where there are file conflicts because the code first checks the database, then checks to see if the target file exists instead of what the current code does which is list the files in the directory and listing directories is always slower than checking if a single file exists. |
Give 0.49.8 a try and let me know if it fixes the problem. It might take two runs to synch the current export dir with the database but then should stop doing the cyclical update. |
Hi @RhetTbull
and checking .osxphotos_export.db we have two entries: 21984|(...)/img_2126.jpg|(...)/IMG_2126.JPG|F3070D03-8D56-4575-AA2D-DCCDB3038233|(...)|2|2022-05-26 05:26:22.774
88422|(...)/img_2126 (1).jpg|(...)/IMG_2126 (1).JPG|0EADC2C2-A36F-44CE-A1A6-859B25DBB41E|32768|(...)|2022-05-27 05:23:12.068 and querying Photos with the two UUIDs...one is found and another one not: $ osxphotos query --uuid 0EADC2C2-A36F-44CE-A1A6-859B25DBB41E
Using last opened Photos library: /Users/Shared/Pictures/iPhoto Shared Library.photoslibrary
uuid,filename,original_filename,date,description,title,keywords,albums,persons,path,ismissing,hasadjustments,external_edit,favorite,hidden,shared,latitude,longitude,path_edited,isphoto,ismovie,uti,burst,live_photo,path_live_photo,iscloudasset,incloud,date_modified,portrait,screenshot,slow_mo,time_lapse,hdr,selfie,panorama,has_raw,uti_raw,path_raw,intrash
0EADC2C2-A36F-44CE-A1A6-859B25DBB41E,IMG_2126.JPG,IMG_2126.JPG,2017-03-31T14:00:09+01:00, (...)
$ osxphotos query --uuid F3070D03-8D56-4575-AA2D-DCCDB3038233
Using last opened Photos library: /Users/Shared/Pictures/iPhoto Shared Library.photoslibrary
uuid,filename,original_filename,date,description,title,keywords,albums,persons,path,ismissing,hasadjustments,external_edit,favorite,hidden,shared,latitude,longitude,path_edited,isphoto,ismovie,uti,burst,live_photo,path_live_photo,iscloudasset,incloud,date_modified,portrait,screenshot,slow_mo,time_lapse,hdr,selfie,panorama,has_raw,uti_raw,path_raw,intrash |
@oPromessa yes, I believe this case will be covered by 0.49.8 -- what the code does now is create unique pairings of (UUID, exported file name) so in your example, UUID_B will always be exported as "file (1).mov" after the first time because that name will be associated with the UUID. The export database now is responsible for managing the pairings of UUID and filename instead of the export code trying to guess the right name. Once exported with a certain name, a given UUID will always use that same name when exported with --update and the same directory/filename templates osxphotos/osxphotos/export_db.py Line 217 in 999b16e
|
Thanks! Will try the new version tonight.
|
So you could do this: run with As of version 0.49.0, |
Thank you so much for the support. Sorry to be a pain!!! A. Great tip on the "delete without export". Thanks. B. Further testing with version 0.49.9 after deleting the duplicate entry on the export database: It ended up creating a second entry in the database with the same uuid and the loop is still there. Now with pic IMG_2126. Just wanted to let you know.
C. For my "active" system I'll cleanup things:
D. Will setup a small test for this scenario of replacing files. As I notice I do it on and off after reviewing some pics after loading. |
I'll take a look at the code and see if I can figure out a way to catch this. I can probably have the code that checks the file names always default to the version without (1)... if there's more than one record for a UUID |
Sequence:
1st export. Exports file. OK$ osxphotos export X --exportdb X/.osxphotos_export.db --name "IMG_2126" --load-config Apps/colibri.toml
2022-05-29 00:21:59.520221 -- Loaded options from file Apps/colibri.toml
2022-05-29 00:21:59.520790 -- osxphotos version 0.50.0
2022-05-29 00:21:59.544080 -- exiftool path: /usr/local/bin/exiftool
2022-05-29 00:21:59.561100 -- Created export database X/.osxphotos_export.db
(...)
)2022-05-29 00:22:32.505312 -- Exporting 4 photos to /Users/Shared/Pictures/X...
2022-05-29 00:22:33.838242 -- Exporting IMG_2126.JPG (IMG_2126.JPG) as IMG_2126.JPG (4/4)
2022-05-29 00:22:33.840243 -- Writing metadata with exiftool for IMG_2126.JPG
2022-05-29 00:22:34.233573 -- Exported new file (...)/IMG_2126.JPG
Exporting 4 photos ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00
2022-05-29 00:22:34.238355 -- Processed: 4 photos, exported: 4, updated: 0, skipped: 0, updated EXIF data: 4, missing: 0, error: 0, touched date: 2
2022-05-29 00:22:34.238901 -- Elapsed time: 0:00:01
2022-05-29 00:22:34.239291 -- Cleaning up /Users/Shared/Pictures/X
2022-05-29 00:22:34.240042 -- Deleting /Users/Shared/Pictures/X/2017-05-11 16 Anos Joana/MVI_2452.MOV
2022-05-29 00:22:34.243080 -- Deleted: 1 file, 1 directory 2nd export. Skips file. OK$ osxphotos export X --exportdb X/.osxphotos_export.db --name "IMG_2126" --load-config Apps/colibri.toml
2022-05-29 00:23:43.201950 -- Loaded options from file Apps/colibri.toml
2022-05-29 00:23:43.202510 -- osxphotos version 0.50.0
2022-05-29 00:23:43.220616 -- exiftool path: /usr/local/bin/exiftool
2022-05-29 00:23:43.224274 -- Using export database X/.osxphotos_export.db
2022-05-29 00:24:11.648873 -- Exporting 4 photos to /Users/Shared/Pictures/X...
2022-05-29 00:24:11.652699 -- Exporting IMG_2126.JPG (IMG_2126.JPG) as IMG_2126.JPG (1/4)
2022-05-29 00:24:12.043388 -- Skipped up to date file (...)/IMG_2126.JPG
Exporting 4 photos ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00
2022-05-29 00:24:12.448174 -- Processed: 4 photos, exported: 0, updated: 0, skipped: 4, updated EXIF data: 0, missing: 0, error: 0, touched date: 0
2022-05-29 00:24:12.448804 -- Elapsed time: 0:00:00
2022-05-29 00:24:12.449241 -- Cleaning up /Users/Shared/Pictures/X
2022-05-29 00:24:12.450507 -- Deleted: 0 files, 0 directories Delete file and re/upload in Photos. 3rd export. Exports "(1)" file. and Delete original file.$ osxphotos export X --exportdb X/.osxphotos_export.db --name "IMG_2126" --load-config Apps/colibri.toml
2022-05-29 00:25:05.221959 -- Loaded options from file Apps/colibri.toml
2022-05-29 00:25:05.222513 -- osxphotos version 0.50.0
2022-05-29 00:25:05.240595 -- exiftool path: /usr/local/bin/exiftool
2022-05-29 00:25:05.244442 -- Using export database X/.osxphotos_export.db
2022-05-29 00:25:33.782620 -- Exporting 4 photos to /Users/Shared/Pictures/X...
2022-05-29 00:25:33.786039 -- Exporting IMG_2126.JPG (IMG_2126.JPG) as IMG_2126.JPG (1/4)
2022-05-29 00:25:33.788371 -- Writing metadata with exiftool for IMG_2126 (1).JPG
2022-05-29 00:25:34.429398 -- Exported new file (...)/IMG_2126 (1).JPG
Exporting 4 photos ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00
2022-05-29 00:25:34.843780 -- Processed: 4 photos, exported: 1, updated: 0, skipped: 3, updated EXIF data: 1, missing: 0, error: 0, touched date: 0
2022-05-29 00:25:34.844292 -- Elapsed time: 0:00:01
2022-05-29 00:25:34.844661 -- Cleaning up /Users/Shared/Pictures/X
2022-05-29 00:25:34.845350 -- Deleting (...)/IMG_2126.JPG
2022-05-29 00:25:34.846399 -- Deleted: 1 file, 0 directories 4th export. Indicates to export "IMG_2126" as "IMG_2126" but in reality the existing file is kept "(1)".$ osxphotos export X --exportdb X/.osxphotos_export.db --name "IMG_2126" --load-config Apps/colibri.toml
2022-05-29 00:25:50.488409 -- Loaded options from file Apps/colibri.toml
2022-05-29 00:25:50.488976 -- osxphotos version 0.50.0
2022-05-29 00:25:50.507316 -- exiftool path: /usr/local/bin/exiftool
2022-05-29 00:25:50.511461 -- Using export database X/.osxphotos_export.db
2022-05-29 00:26:18.879500 -- Exporting 4 photos to /Users/Shared/Pictures/X...
2022-05-29 00:26:19.245373 -- Exporting IMG_2126.JPG (IMG_2126.JPG) as IMG_2126.JPG (2/4)
2022-05-29 00:26:19.397235 -- Skipped up to date file (...)/IMG_2126 (1).JPG
Exporting 4 photos ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00
2022-05-29 00:26:19.644178 -- Processed: 4 photos, exported: 0, updated: 0, skipped: 4, updated EXIF data: 0, missing: 0, error: 0, touched date: 0
2022-05-29 00:26:19.644682 -- Elapsed time: 0:00:00
2022-05-29 00:26:19.645052 -- Cleaning up /Users/Shared/Pictures/X
2022-05-29 00:26:19.646254 -- Deleted: 0 files, 0 directories
2022-05-29 00:26:19.646648 -- Wrote export report to /Users/Shared/Pictures/Logs/colibri.csv
2022-05-29 00:26:19.647104 -- Writing export database changes back to X/.osxphotos_export.db
$ ls X/(...))/IMG_2126*
X/(...))/IMG_2126 (1).JPG I've then added a new file named IMG_2126 to the same album. 5th export. Skips "(1)" and exports/creates "(2)". OK.$ osxphotos export X --exportdb X/.osxphotos_export.db --name "IMG_2126" --load-config Apps/colibri.toml
2022-05-29 00:43:24.173040 -- Loaded options from file Apps/colibri.toml
2022-05-29 00:43:24.173652 -- osxphotos version 0.50.0
2022-05-29 00:43:24.193525 -- exiftool path: /usr/local/bin/exiftool
2022-05-29 00:43:24.198791 -- Using export database X/.osxphotos_export.db
2022-05-29 00:43:55.839815 -- Done processing details from Photos library.
2022-05-29 00:43:56.790162 -- Exporting 5 photos to /Users/Shared/Pictures/X...
2022-05-29 00:43:57.422427 -- Exporting IMG_2126.JPG (IMG_2126.JPG) as IMG_2126.JPG (3/5)
2022-05-29 00:43:57.578603 -- Skipped up to date file (...)IMG_2126 (1).JPG
2022-05-29 00:43:57.706541 -- Exporting IMG_2126.JPG (IMG_2126.JPG) as IMG_2126.JPG (5/5)
2022-05-29 00:43:57.723639 -- Writing metadata with exiftool for IMG_2126 (2).JPG
2022-05-29 00:43:58.056187 -- Exported new file (...)IMG_2126 (2).JPG
Exporting 5 photos ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00
2022-05-29 00:43:58.060349 -- Processed: 5 photos, exported: 1, updated: 0, skipped: 4, updated EXIF data: 1, missing: 0, error: 0, touched date: 0
2022-05-29 00:43:58.060877 -- Elapsed time: 0:00:01
2022-05-29 00:43:58.061306 -- Cleaning up /Users/Shared/Pictures/X
2022-05-29 00:43:58.062510 -- Deleted: 0 files, 0 directories
2022-05-29 00:43:58.062867 -- Wrote export report to /Users/Shared/Pictures/Logs/colibri.csv
2022-05-29 00:43:58.063315 -- Writing export database changes back to X/.osxphotos_export.db
$ ls X/(...))/*
X/(...)/IMG_2126 (1).JPG
X/(...)/IMG_2126 (2).JPG 6th Re/ran export. Skips "(1)" and "(2)" but message still refers to original file. OK$ osxphotos export X --exportdb X/.osxphotos_export.db --name "IMG_2126" --load-config Apps/colibri.toml
2022-05-29 00:49:06.611644 -- Loaded options from file Apps/colibri.toml
2022-05-29 00:49:06.612215 -- osxphotos version 0.50.0
2022-05-29 00:49:06.630690 -- exiftool path: /usr/local/bin/exiftool
2022-05-29 00:49:06.635478 -- Using export database X/.osxphotos_export.db
2022-05-29 00:49:34.472174 -- Done processing details from Photos library.
2022-05-29 00:49:35.191061 -- Exporting 5 photos to /Users/Shared/Pictures/X...
2022-05-29 00:49:35.194644 -- Exporting IMG_2126.JPG (IMG_2126.JPG) as IMG_2126.JPG (1/5)
2022-05-29 00:49:35.545926 -- Skipped up to date file (...)IMG_2126 (2).JPG
2022-05-29 00:49:35.854458 -- Exporting IMG_2126.JPG (IMG_2126.JPG) as IMG_2126.JPG (4/5)
2022-05-29 00:49:36.013949 -- Skipped up to date file (...)IMG_2126 (1).JPG
Exporting 5 photos ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00
2022-05-29 00:49:36.171588 -- Processed: 5 photos, exported: 0, updated: 0, skipped: 5, updated EXIF data: 0, missing: 0, error: 0, touched date: 0
2022-05-29 00:49:36.172160 -- Elapsed time: 0:00:00
2022-05-29 00:49:36.172562 -- Cleaning up /Users/Shared/Pictures/X
2022-05-29 00:49:36.173862 -- Deleted: 0 files, 0 directories
2022-05-29 00:49:36.174239 -- Wrote export report to /Users/Shared/Pictures/Logs/colibri.csv
2022-05-29 00:49:36.174672 -- Writing export database changes back to X/.osxphotos_export.db |
As best as I can tell, this indicates osxphotos is working as expected. When you deleted the original, it had been "reserved" in the database with the first UUID so any subsequent file with the same name (which will have a different UUID), will get a new file name with (1), (2), and so on. The only issue is the I've tried to re-create the issue of osxphotos entering a loop and so far I'm not able to. |
Yes, I believe with 0.50 version the loop no longer occurs. A final run tonight will take place with the fixed entries on my active database and will let you know the result tomorrow. |
Also, in v0.50.1 I've added two new exportdb commands that will be helpful when needed to cleanup the database:
So for your example, you'd do something like this:
|
Th final run on IMG_2126 with the deleted exported file and deleting the exportdb entries worked fine! Thanks |
Describe the bug
A Video MVI_2452.MOV file keeps being exported on every run even with seemly no changes. Adding suffix "(1)" and deleting the origin file in cycle.
Each run either generated the "(1)" file or deletes it.
I've looked for JSON changes in the file attributes in between runs but there are not.
I was trying to debug it with but the
breakpoint
(from other issues) does not seem to work. Which function should I debug with?To Reproduce
Steps to reproduce the behavior:
Expected behavior
Not to be re-exported.
Screenshots
Desktop (please complete the following information):
osxphotos --version
): osxphotos, version 0.49.0Additional context
N/A
The text was updated successfully, but these errors were encountered: