diff --git a/osxphotos/_version.py b/osxphotos/_version.py index ec06b42b..a5cd058f 100644 --- a/osxphotos/_version.py +++ b/osxphotos/_version.py @@ -1,3 +1,3 @@ """ version info """ -__version__ = "0.29.29" +__version__ = "0.29.30" diff --git a/tests/Test-10.14.6.photoslibrary/database/photos.db b/tests/Test-10.14.6.photoslibrary/database/photos.db index 0f0a4a13..4691e8c1 100644 Binary files a/tests/Test-10.14.6.photoslibrary/database/photos.db and b/tests/Test-10.14.6.photoslibrary/database/photos.db differ diff --git a/tests/Test-10.15.5.photoslibrary/database/Photos.sqlite b/tests/Test-10.15.5.photoslibrary/database/Photos.sqlite index a8c4e65a..c4b1f72c 100644 Binary files a/tests/Test-10.15.5.photoslibrary/database/Photos.sqlite and b/tests/Test-10.15.5.photoslibrary/database/Photos.sqlite differ diff --git a/tests/Test-10.15.5.photoslibrary/database/Photos.sqlite-shm b/tests/Test-10.15.5.photoslibrary/database/Photos.sqlite-shm index 03ccd4ab..fe9ac284 100644 Binary files a/tests/Test-10.15.5.photoslibrary/database/Photos.sqlite-shm and b/tests/Test-10.15.5.photoslibrary/database/Photos.sqlite-shm differ diff --git a/tests/Test-10.15.5.photoslibrary/database/Photos.sqlite-wal b/tests/Test-10.15.5.photoslibrary/database/Photos.sqlite-wal index a3a8fac9..e69de29b 100644 Binary files a/tests/Test-10.15.5.photoslibrary/database/Photos.sqlite-wal and b/tests/Test-10.15.5.photoslibrary/database/Photos.sqlite-wal differ diff --git a/tests/Test-10.15.5.photoslibrary/database/Photos.sqlite.lock b/tests/Test-10.15.5.photoslibrary/database/Photos.sqlite.lock index d96edccc..4e52ec1d 100644 --- a/tests/Test-10.15.5.photoslibrary/database/Photos.sqlite.lock +++ b/tests/Test-10.15.5.photoslibrary/database/Photos.sqlite.lock @@ -7,7 +7,7 @@ hostuuid 9575E48B-8D5F-5654-ABAC-4431B1167324 pid - 703 + 763 processname photolibraryd uid diff --git a/tests/Test-10.15.5.photoslibrary/database/search/psi.sqlite b/tests/Test-10.15.5.photoslibrary/database/search/psi.sqlite index 1ac29277..904d6cfc 100644 Binary files a/tests/Test-10.15.5.photoslibrary/database/search/psi.sqlite and b/tests/Test-10.15.5.photoslibrary/database/search/psi.sqlite differ diff --git a/tests/Test-10.15.5.photoslibrary/database/search/synonymsProcess.plist b/tests/Test-10.15.5.photoslibrary/database/search/synonymsProcess.plist index 79cdd085..58e48cc1 100644 Binary files a/tests/Test-10.15.5.photoslibrary/database/search/synonymsProcess.plist and b/tests/Test-10.15.5.photoslibrary/database/search/synonymsProcess.plist differ diff --git a/tests/Test-10.15.5.photoslibrary/originals/7/71E3E212-00EB-430D-8A63-5E294B268554.jpeg b/tests/Test-10.15.5.photoslibrary/originals/7/71E3E212-00EB-430D-8A63-5E294B268554.jpeg new file mode 100644 index 00000000..829a2345 Binary files /dev/null and b/tests/Test-10.15.5.photoslibrary/originals/7/71E3E212-00EB-430D-8A63-5E294B268554.jpeg differ diff --git a/tests/Test-10.15.5.photoslibrary/private/com.apple.Photos/appPrivateData.plist b/tests/Test-10.15.5.photoslibrary/private/com.apple.Photos/appPrivateData.plist index ecd65d9f..40d5b4f7 100644 --- a/tests/Test-10.15.5.photoslibrary/private/com.apple.Photos/appPrivateData.plist +++ b/tests/Test-10.15.5.photoslibrary/private/com.apple.Photos/appPrivateData.plist @@ -10,6 +10,7 @@ 88A5F8B8-5B9A-43C7-BB85-3952B81580EB/L0/020 29EF7A97-7E76-4D5F-A5E0-CC0A93E8524C/L0/020 2C2AF115-BD1D-4434-A747-D1C8BD8E2045/L0/020 + CB051A4C-2CB7-4B90-B59B-08CC4D0C2823/L0/020 Photos diff --git a/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSBusinessCategoryCache.POI.sqlite-shm b/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSBusinessCategoryCache.POI.sqlite-shm index 78d7e255..7b5d98a6 100644 Binary files a/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSBusinessCategoryCache.POI.sqlite-shm and b/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSBusinessCategoryCache.POI.sqlite-shm differ diff --git a/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSBusinessCategoryCache.POI.sqlite-wal b/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSBusinessCategoryCache.POI.sqlite-wal index accec77a..1f2c8836 100644 Binary files a/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSBusinessCategoryCache.POI.sqlite-wal and b/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSBusinessCategoryCache.POI.sqlite-wal differ diff --git a/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSBusinessCategoryCache.ROI.sqlite-shm b/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSBusinessCategoryCache.ROI.sqlite-shm index 0640a9ed..a42cf7b6 100644 Binary files a/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSBusinessCategoryCache.ROI.sqlite-shm and b/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSBusinessCategoryCache.ROI.sqlite-shm differ diff --git a/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSBusinessCategoryCache.ROI.sqlite-wal b/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSBusinessCategoryCache.ROI.sqlite-wal index d41efc35..00799a13 100644 Binary files a/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSBusinessCategoryCache.ROI.sqlite-wal and b/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSBusinessCategoryCache.ROI.sqlite-wal differ diff --git a/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSLocationCache.sqlite-shm b/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSLocationCache.sqlite-shm index 5679d295..94c749cb 100644 Binary files a/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSLocationCache.sqlite-shm and b/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSLocationCache.sqlite-shm differ diff --git a/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSLocationCache.sqlite-wal b/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSLocationCache.sqlite-wal index 8ccf8398..316b0668 100644 Binary files a/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSLocationCache.sqlite-wal and b/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSLocationCache.sqlite-wal differ diff --git a/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSPublicEventCache.sqlite-shm b/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSPublicEventCache.sqlite-shm index 2c1afa02..b8726b14 100644 Binary files a/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSPublicEventCache.sqlite-shm and b/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSPublicEventCache.sqlite-shm differ diff --git a/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSPublicEventCache.sqlite-wal b/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSPublicEventCache.sqlite-wal index 61cf3815..8642f789 100644 Binary files a/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSPublicEventCache.sqlite-wal and b/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSPublicEventCache.sqlite-wal differ diff --git a/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/PGCurationCache.sqlite.sqlite-shm b/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/PGCurationCache.sqlite.sqlite-shm index b7edb6d0..e300321e 100644 Binary files a/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/PGCurationCache.sqlite.sqlite-shm and b/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/PGCurationCache.sqlite.sqlite-shm differ diff --git a/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/PGCurationCache.sqlite.sqlite-wal b/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/PGCurationCache.sqlite.sqlite-wal index d0a926df..b769cb12 100644 Binary files a/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/PGCurationCache.sqlite.sqlite-wal and b/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/PGCurationCache.sqlite.sqlite-wal differ diff --git a/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/PhotoAnalysisServicePreferences.plist b/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/PhotoAnalysisServicePreferences.plist index db72f0ec..1ef03cbf 100644 --- a/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/PhotoAnalysisServicePreferences.plist +++ b/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/PhotoAnalysisServicePreferences.plist @@ -3,24 +3,24 @@ BackgroundHighlightCollection - 2020-06-06T14:26:31Z + 2020-06-24T04:02:13Z BackgroundHighlightEnrichment - 2020-06-06T14:26:29Z + 2020-06-24T04:02:12Z BackgroundJobAssetRevGeocode - 2020-06-06T14:26:31Z + 2020-06-24T04:02:13Z BackgroundJobSearch - 2020-06-06T14:26:31Z + 2020-06-24T04:02:13Z BackgroundPeopleSuggestion - 2020-06-06T14:26:29Z + 2020-06-24T04:02:12Z BackgroundUserBehaviorProcessor - 2020-06-06T14:26:31Z + 2020-06-24T04:02:13Z PhotoAnalysisGraphLastBackgroundGraphConsistencyUpdateJobDateKey 2020-05-30T02:16:06Z PhotoAnalysisGraphLastBackgroundGraphRebuildJobDate 2020-05-29T04:31:37Z PhotoAnalysisGraphLastBackgroundMemoryGenerationJobDate - 2020-06-06T14:26:33Z + 2020-06-24T04:02:13Z SiriPortraitDonation - 2020-06-06T14:26:31Z + 2020-06-24T04:02:13Z diff --git a/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/PhotosGraph/photosgraph.kgdb b/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/PhotosGraph/photosgraph.kgdb index 709b91e6..feb35bb6 100644 Binary files a/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/PhotosGraph/photosgraph.kgdb and b/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/PhotosGraph/photosgraph.kgdb differ diff --git a/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/changetoken.plist b/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/changetoken.plist index c51bd8ab..2b969e79 100644 Binary files a/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/changetoken.plist and b/tests/Test-10.15.5.photoslibrary/private/com.apple.photoanalysisd/caches/graph/changetoken.plist differ diff --git a/tests/Test-10.15.5.photoslibrary/resources/derivatives/7/71E3E212-00EB-430D-8A63-5E294B268554_1_105_c.jpeg b/tests/Test-10.15.5.photoslibrary/resources/derivatives/7/71E3E212-00EB-430D-8A63-5E294B268554_1_105_c.jpeg new file mode 100644 index 00000000..ccbb2fd0 Binary files /dev/null and b/tests/Test-10.15.5.photoslibrary/resources/derivatives/7/71E3E212-00EB-430D-8A63-5E294B268554_1_105_c.jpeg differ diff --git a/tests/Test-10.15.5.photoslibrary/resources/derivatives/masters/7/71E3E212-00EB-430D-8A63-5E294B268554_4_5005_c.jpeg b/tests/Test-10.15.5.photoslibrary/resources/derivatives/masters/7/71E3E212-00EB-430D-8A63-5E294B268554_4_5005_c.jpeg new file mode 100644 index 00000000..c48aa6ea Binary files /dev/null and b/tests/Test-10.15.5.photoslibrary/resources/derivatives/masters/7/71E3E212-00EB-430D-8A63-5E294B268554_4_5005_c.jpeg differ diff --git a/tests/Test-10.15.5.photoslibrary/resources/derivatives/thumbs/3305.ithmb b/tests/Test-10.15.5.photoslibrary/resources/derivatives/thumbs/3305.ithmb index be7bf503..41392f01 100644 Binary files a/tests/Test-10.15.5.photoslibrary/resources/derivatives/thumbs/3305.ithmb and b/tests/Test-10.15.5.photoslibrary/resources/derivatives/thumbs/3305.ithmb differ diff --git a/tests/Test-10.15.5.photoslibrary/resources/derivatives/thumbs/4031.ithmb b/tests/Test-10.15.5.photoslibrary/resources/derivatives/thumbs/4031.ithmb index a22b08c3..aa77b7ac 100644 Binary files a/tests/Test-10.15.5.photoslibrary/resources/derivatives/thumbs/4031.ithmb and b/tests/Test-10.15.5.photoslibrary/resources/derivatives/thumbs/4031.ithmb differ diff --git a/tests/Test-10.15.5.photoslibrary/resources/derivatives/thumbs/4132.ithmb b/tests/Test-10.15.5.photoslibrary/resources/derivatives/thumbs/4132.ithmb index 7cf66c49..3d7f508e 100644 Binary files a/tests/Test-10.15.5.photoslibrary/resources/derivatives/thumbs/4132.ithmb and b/tests/Test-10.15.5.photoslibrary/resources/derivatives/thumbs/4132.ithmb differ diff --git a/tests/Test-10.15.5.photoslibrary/resources/journals/Asset-change.plj b/tests/Test-10.15.5.photoslibrary/resources/journals/Asset-change.plj index 063b0b7a..887513fb 100644 Binary files a/tests/Test-10.15.5.photoslibrary/resources/journals/Asset-change.plj and b/tests/Test-10.15.5.photoslibrary/resources/journals/Asset-change.plj differ diff --git a/tests/Test-10.15.5.photoslibrary/resources/journals/HistoryToken.plist b/tests/Test-10.15.5.photoslibrary/resources/journals/HistoryToken.plist index b010c3dc..8061b157 100644 Binary files a/tests/Test-10.15.5.photoslibrary/resources/journals/HistoryToken.plist and b/tests/Test-10.15.5.photoslibrary/resources/journals/HistoryToken.plist differ diff --git a/tests/Test-10.15.5.photoslibrary/resources/journals/ImportSession-change.plj b/tests/Test-10.15.5.photoslibrary/resources/journals/ImportSession-change.plj index cdf80364..f542b01e 100644 Binary files a/tests/Test-10.15.5.photoslibrary/resources/journals/ImportSession-change.plj and b/tests/Test-10.15.5.photoslibrary/resources/journals/ImportSession-change.plj differ diff --git a/tests/test_catalina_10_15_5.py b/tests/test_catalina_10_15_5.py index ef8e84dc..ac8e647b 100644 --- a/tests/test_catalina_10_15_5.py +++ b/tests/test_catalina_10_15_5.py @@ -66,6 +66,7 @@ UUID_DICT = { "export": "D79B8D77-BFFC-460B-9312-034F2877D35B", # "Pumkins2.jpg" "export_tif": "8846E3E6-8AC8-4857-8448-E3D025784410", "in_album": "D79B8D77-BFFC-460B-9312-034F2877D35B", # "Pumkins2.jpg" + "date_invalid": "8846E3E6-8AC8-4857-8448-E3D025784410", } UUID_PUMPKIN_FARM = [ @@ -868,12 +869,39 @@ def test_from_to_date(): photosdb = osxphotos.PhotosDB(PHOTOS_DB) photos = photosdb.photos(from_date=dt.datetime(2018, 10, 28)) - assert len(photos) == 7 + assert len(photos) == 6 photos = photosdb.photos(to_date=dt.datetime(2018, 10, 28)) - assert len(photos) == 6 + assert len(photos) == 7 photos = photosdb.photos( from_date=dt.datetime(2018, 9, 28), to_date=dt.datetime(2018, 9, 29) ) assert len(photos) == 4 + + +def test_date_invalid(): + """ Test date is invalid """ + from datetime import datetime, timedelta, timezone + import osxphotos + + photosdb = osxphotos.PhotosDB(dbfile=PHOTOS_DB) + photos = photosdb.photos(uuid=[UUID_DICT["date_invalid"]]) + assert len(photos) == 1 + p = photos[0] + delta = timedelta(seconds=p.tzoffset) + tz = timezone(delta) + assert p.date == datetime(1970, 1, 1).astimezone(tz=tz) + + +def test_date_modified_invalid(): + """ Test date modified is invalid """ + from datetime import datetime, timedelta, timezone + import osxphotos + + photosdb = osxphotos.PhotosDB(dbfile=PHOTOS_DB) + photos = photosdb.photos(uuid=[UUID_DICT["date_invalid"]]) + assert len(photos) == 1 + p = photos[0] + assert p.date_modified is None + diff --git a/tests/test_mojave_10_14_6.py b/tests/test_mojave_10_14_6.py index ad33f24f..f65e1f99 100644 --- a/tests/test_mojave_10_14_6.py +++ b/tests/test_mojave_10_14_6.py @@ -41,6 +41,7 @@ ALBUM_DICT = { UUID_DICT = { "favorite": "6bxcNnzRQKGnK4uPrCJ9UQ", "not_favorite": "8SOE9s0XQVGsuq4ONohTng", + "date_invalid": "YZFCPY24TUySvpu7owiqxA", } @@ -58,6 +59,7 @@ def test_db_version(): assert photosdb.db_version in osxphotos._constants._TESTED_DB_VERSIONS assert photosdb.db_version == "4025" + def test_db_len(): import osxphotos @@ -407,3 +409,30 @@ def test_multi_person(): photos = photosdb.photos(persons=["Katie", "Suzy"]) assert len(photos) == 3 + + +def test_date_invalid(): + """ Test date is invalid """ + from datetime import datetime, timedelta, timezone + import osxphotos + + photosdb = osxphotos.PhotosDB(dbfile=PHOTOS_DB) + photos = photosdb.photos(uuid=[UUID_DICT["date_invalid"]]) + assert len(photos) == 1 + p = photos[0] + delta = timedelta(seconds=p.tzoffset) + tz = timezone(delta) + assert p.date == datetime(1970, 1, 1).astimezone(tz=tz) + + +def test_date_modified_invalid(): + """ Test date modified is invalid """ + from datetime import datetime, timedelta, timezone + import osxphotos + + photosdb = osxphotos.PhotosDB(dbfile=PHOTOS_DB) + photos = photosdb.photos(uuid=[UUID_DICT["date_invalid"]]) + assert len(photos) == 1 + p = photos[0] + assert p.date_modified is None +