diff --git a/README.md b/README.md index a1f76c87..63b20c2a 100644 --- a/README.md +++ b/README.md @@ -1815,7 +1815,7 @@ Substitution Description {lf} A line feed: '\n', alias for {newline} {cr} A carriage return: '\r' {crlf} a carriage return + line feed: '\r\n' -{osxphotos_version} The osxphotos version, e.g. '0.42.64' +{osxphotos_version} The osxphotos version, e.g. '0.42.65' {osxphotos_cmd_line} The full command line used to run osxphotos The following substitutions may result in multiple values. Thus if specified for @@ -3038,6 +3038,17 @@ Returns a list of [FolderInfo](#FolderInfo) objects representing the sub-folders #### `parent` Returns a [FolderInfo](#FolderInfo) object representing the folder's parent folder or `None` if album is not a in a folder. +#### `sort_order` +Returns album sort order (as `AlbumSortOrder` enum). On Photos <=4, always returns `AlbumSortOrder.MANUAL`. + +`AlbumSortOrder` has following values: + +- `UNKNOWN` +- `MANUAL` +- `NEWEST_FIRST` +- `OLDEST_FIRST` +- `TITLE` + #### `photo_index(photo)` Returns index of photo in album (based on album sort order). @@ -3652,7 +3663,7 @@ The following template field substitutions are availabe for use the templating s |{lf}|A line feed: '\n', alias for {newline}| |{cr}|A carriage return: '\r'| |{crlf}|a carriage return + line feed: '\r\n'| -|{osxphotos_version}|The osxphotos version, e.g. '0.42.64'| +|{osxphotos_version}|The osxphotos version, e.g. '0.42.65'| |{osxphotos_cmd_line}|The full command line used to run osxphotos| |{album}|Album(s) photo is contained in| |{folder_album}|Folder path + album photo is contained in. e.g. 'Folder/Subfolder/Album' or just 'Album' if no enclosing folder| diff --git a/osxphotos/__init__.py b/osxphotos/__init__.py index 33f27e4b..d61610bd 100644 --- a/osxphotos/__init__.py +++ b/osxphotos/__init__.py @@ -1,3 +1,4 @@ +from ._constants import AlbumSortOrder from ._version import __version__ from .exiftool import ExifTool from .photoinfo import ExportResults, PhotoInfo diff --git a/osxphotos/_constants.py b/osxphotos/_constants.py index a3d0d939..75403096 100644 --- a/osxphotos/_constants.py +++ b/osxphotos/_constants.py @@ -4,6 +4,7 @@ Constants used by osxphotos import os.path from datetime import datetime +from enum import Enum OSXPHOTOS_URL = "https://github.com/RhetTbull/osxphotos" @@ -273,3 +274,11 @@ POST_COMMAND_CATEGORIES = { # "deleted_files": "When used with '--cleanup', all files deleted during the export", # "deleted_directories": "When used with '--cleanup', all directories deleted during the export", } + +class AlbumSortOrder(Enum): + """Album Sort Order""" + UNKNOWN = 0 + MANUAL = 1 + NEWEST_FIRST = 2 + OLDEST_FIRST = 3 + TITLE = 5 diff --git a/osxphotos/_version.py b/osxphotos/_version.py index 5d61aad9..1af624dd 100644 --- a/osxphotos/_version.py +++ b/osxphotos/_version.py @@ -1,3 +1,3 @@ """ version info """ -__version__ = "0.42.64" +__version__ = "0.42.65" diff --git a/osxphotos/albuminfo.py b/osxphotos/albuminfo.py index b176c94e..42a43798 100644 --- a/osxphotos/albuminfo.py +++ b/osxphotos/albuminfo.py @@ -19,6 +19,7 @@ from ._constants import ( _PHOTOS_5_ALBUM_KIND, _PHOTOS_5_FOLDER_KIND, TIME_DELTA, + AlbumSortOrder, ) from .datetime_utils import get_local_tz @@ -156,7 +157,17 @@ class AlbumInfo(AlbumInfoBaseClass): if self.uuid in self._db._dbalbums_album: uuid, sort_order = zip(*self._db._dbalbums_album[self.uuid]) sorted_uuid = sort_list_by_keys(uuid, sort_order) - self._photos = self._db.photos_by_uuid(sorted_uuid) + photos = self._db.photos_by_uuid(sorted_uuid) + sort_order = self.sort_order + if sort_order == AlbumSortOrder.NEWEST_FIRST: + self._photos = sorted(photos, key=lambda p: p.date, reverse=True) + elif sort_order == AlbumSortOrder.OLDEST_FIRST: + self._photos = sorted(photos, key=lambda p: p.date) + elif sort_order == AlbumSortOrder.TITLE: + self._photos = sorted(photos, key=lambda p: p.title or "") + else: + # assume AlbumSortOrder.MANUAL + self._photos = photos else: self._photos = [] return self._photos @@ -209,6 +220,27 @@ class AlbumInfo(AlbumInfoBaseClass): ) return self._parent + @property + def sort_order(self): + """return sort order of album""" + if self._db._db_version <= _PHOTOS_4_VERSION: + return AlbumSortOrder.MANUAL + + details = self._db._dbalbum_details[self._uuid] + if details["customsortkey"] == 1: + if details["customsortascending"] == 0: + return AlbumSortOrder.NEWEST_FIRST + elif details["customsortascending"] == 1: + return AlbumSortOrder.OLDEST_FIRST + else: + return AlbumSortOrder.UNKNOWN + elif details["customsortkey"] == 5: + return AlbumSortOrder.TITLE + elif details["customsortkey"] == 0: + return AlbumSortOrder.MANUAL + else: + return AlbumSortOrder.UNKNOWN + def photo_index(self, photo): """return index of photo in album (based on album sort order)""" index = 0 diff --git a/osxphotos/photosdb/photosdb.py b/osxphotos/photosdb/photosdb.py index 3d8e60f3..e3483917 100644 --- a/osxphotos/photosdb/photosdb.py +++ b/osxphotos/photosdb/photosdb.py @@ -790,6 +790,8 @@ class PhotosDB: "creation_date": album[8], "start_date": None, # Photos 5 only "end_date": None, # Photos 5 only + "customsortascending": None, # Photos 5 only + "customsortkey": None, # Photos 5 only } # get details about folders @@ -1767,7 +1769,9 @@ class PhotosDB: "ZTRASHEDSTATE, " # 9 "ZCREATIONDATE, " # 10 "ZSTARTDATE, " # 11 - "ZENDDATE " # 12 + "ZENDDATE, " # 12 + "ZCUSTOMSORTASCENDING, " # 13 + "ZCUSTOMSORTKEY " # 14 "FROM ZGENERICALBUM " ) for album in c: @@ -1787,6 +1791,8 @@ class PhotosDB: "creation_date": album[10], "start_date": album[11], "end_date": album[12], + "customsortascending": album[13], + "customsortkey": album[14], } # add cross-reference by pk to uuid diff --git a/tests/Test-10.15.7.photoslibrary/database/Photos.sqlite b/tests/Test-10.15.7.photoslibrary/database/Photos.sqlite index 29813847..d3aacb37 100644 Binary files a/tests/Test-10.15.7.photoslibrary/database/Photos.sqlite and b/tests/Test-10.15.7.photoslibrary/database/Photos.sqlite differ diff --git a/tests/Test-10.15.7.photoslibrary/database/Photos.sqlite-shm b/tests/Test-10.15.7.photoslibrary/database/Photos.sqlite-shm index 71055d1b..3556bd05 100644 Binary files a/tests/Test-10.15.7.photoslibrary/database/Photos.sqlite-shm and b/tests/Test-10.15.7.photoslibrary/database/Photos.sqlite-shm differ diff --git a/tests/Test-10.15.7.photoslibrary/database/Photos.sqlite-wal b/tests/Test-10.15.7.photoslibrary/database/Photos.sqlite-wal index 032df365..a2d92255 100644 Binary files a/tests/Test-10.15.7.photoslibrary/database/Photos.sqlite-wal and b/tests/Test-10.15.7.photoslibrary/database/Photos.sqlite-wal differ diff --git a/tests/Test-10.15.7.photoslibrary/database/Photos.sqlite.lock b/tests/Test-10.15.7.photoslibrary/database/Photos.sqlite.lock index 323a2f72..c00c434a 100644 --- a/tests/Test-10.15.7.photoslibrary/database/Photos.sqlite.lock +++ b/tests/Test-10.15.7.photoslibrary/database/Photos.sqlite.lock @@ -7,7 +7,7 @@ hostuuid 585B80BF-8D1F-55EF-A9E8-6CF4E5523959 pid - 570 + 1961 processname photolibraryd uid diff --git a/tests/Test-10.15.7.photoslibrary/database/search/psi.sqlite b/tests/Test-10.15.7.photoslibrary/database/search/psi.sqlite index cfafa6c1..de99bcb0 100644 Binary files a/tests/Test-10.15.7.photoslibrary/database/search/psi.sqlite and b/tests/Test-10.15.7.photoslibrary/database/search/psi.sqlite differ diff --git a/tests/Test-10.15.7.photoslibrary/database/search/psi.sqlite-shm b/tests/Test-10.15.7.photoslibrary/database/search/psi.sqlite-shm index fe9ac284..216b70f4 100644 Binary files a/tests/Test-10.15.7.photoslibrary/database/search/psi.sqlite-shm and b/tests/Test-10.15.7.photoslibrary/database/search/psi.sqlite-shm differ diff --git a/tests/Test-10.15.7.photoslibrary/database/search/psi.sqlite-wal b/tests/Test-10.15.7.photoslibrary/database/search/psi.sqlite-wal index e69de29b..3f203887 100644 Binary files a/tests/Test-10.15.7.photoslibrary/database/search/psi.sqlite-wal and b/tests/Test-10.15.7.photoslibrary/database/search/psi.sqlite-wal differ diff --git a/tests/Test-10.15.7.photoslibrary/database/search/synonymsProcess.plist b/tests/Test-10.15.7.photoslibrary/database/search/synonymsProcess.plist index 4505a20d..ce5a783a 100644 Binary files a/tests/Test-10.15.7.photoslibrary/database/search/synonymsProcess.plist and b/tests/Test-10.15.7.photoslibrary/database/search/synonymsProcess.plist differ diff --git a/tests/Test-10.15.7.photoslibrary/database/search/zeroKeywords.data b/tests/Test-10.15.7.photoslibrary/database/search/zeroKeywords.data index 5d03620c..6302b75d 100644 Binary files a/tests/Test-10.15.7.photoslibrary/database/search/zeroKeywords.data and b/tests/Test-10.15.7.photoslibrary/database/search/zeroKeywords.data differ diff --git a/tests/Test-10.15.7.photoslibrary/private/com.apple.mediaanalysisd/MediaAnalysis/mediaanalysis.db b/tests/Test-10.15.7.photoslibrary/private/com.apple.mediaanalysisd/MediaAnalysis/mediaanalysis.db index 80f93dd8..e4d644ed 100644 Binary files a/tests/Test-10.15.7.photoslibrary/private/com.apple.mediaanalysisd/MediaAnalysis/mediaanalysis.db and b/tests/Test-10.15.7.photoslibrary/private/com.apple.mediaanalysisd/MediaAnalysis/mediaanalysis.db differ diff --git a/tests/Test-10.15.7.photoslibrary/private/com.apple.mediaanalysisd/MediaAnalysis/mediaanalysis.db-shm b/tests/Test-10.15.7.photoslibrary/private/com.apple.mediaanalysisd/MediaAnalysis/mediaanalysis.db-shm index c4bba1ba..91ff9d4e 100644 Binary files a/tests/Test-10.15.7.photoslibrary/private/com.apple.mediaanalysisd/MediaAnalysis/mediaanalysis.db-shm and b/tests/Test-10.15.7.photoslibrary/private/com.apple.mediaanalysisd/MediaAnalysis/mediaanalysis.db-shm differ diff --git a/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSBusinessCategoryCache.AOI.sqlite-shm b/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSBusinessCategoryCache.AOI.sqlite-shm index 1a1257d2..ea8a0fe6 100644 Binary files a/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSBusinessCategoryCache.AOI.sqlite-shm and b/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSBusinessCategoryCache.AOI.sqlite-shm differ diff --git a/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSBusinessCategoryCache.AOI.sqlite-wal b/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSBusinessCategoryCache.AOI.sqlite-wal index 459dcbcc..1124e074 100644 Binary files a/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSBusinessCategoryCache.AOI.sqlite-wal and b/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSBusinessCategoryCache.AOI.sqlite-wal differ diff --git a/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSBusinessCategoryCache.Nature.sqlite-shm b/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSBusinessCategoryCache.Nature.sqlite-shm index f7da1661..398dd248 100644 Binary files a/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSBusinessCategoryCache.Nature.sqlite-shm and b/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSBusinessCategoryCache.Nature.sqlite-shm differ diff --git a/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSBusinessCategoryCache.Nature.sqlite-wal b/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSBusinessCategoryCache.Nature.sqlite-wal index 79a1d6da..fd36b436 100644 Binary files a/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSBusinessCategoryCache.Nature.sqlite-wal and b/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSBusinessCategoryCache.Nature.sqlite-wal differ diff --git a/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSBusinessCategoryCache.POI.sqlite-shm b/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSBusinessCategoryCache.POI.sqlite-shm index bcfb3ff3..dea1cea3 100644 Binary files a/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSBusinessCategoryCache.POI.sqlite-shm and b/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSBusinessCategoryCache.POI.sqlite-shm differ diff --git a/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSBusinessCategoryCache.POI.sqlite-wal b/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSBusinessCategoryCache.POI.sqlite-wal index fc4467dd..b15c4235 100644 Binary files a/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSBusinessCategoryCache.POI.sqlite-wal and b/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSBusinessCategoryCache.POI.sqlite-wal differ diff --git a/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSBusinessCategoryCache.ROI.sqlite-shm b/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSBusinessCategoryCache.ROI.sqlite-shm index bf6de66e..560f3b52 100644 Binary files a/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSBusinessCategoryCache.ROI.sqlite-shm and b/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSBusinessCategoryCache.ROI.sqlite-shm differ diff --git a/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSBusinessCategoryCache.ROI.sqlite-wal b/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSBusinessCategoryCache.ROI.sqlite-wal index 6f6db3d7..b4957c9c 100644 Binary files a/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSBusinessCategoryCache.ROI.sqlite-wal and b/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSBusinessCategoryCache.ROI.sqlite-wal differ diff --git a/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSContactCache.sqlite b/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSContactCache.sqlite index f7ecf813..4a9315eb 100644 Binary files a/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSContactCache.sqlite and b/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSContactCache.sqlite differ diff --git a/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSContactCache.sqlite-shm b/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSContactCache.sqlite-shm index a061f761..0beeb6cd 100644 Binary files a/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSContactCache.sqlite-shm and b/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSContactCache.sqlite-shm differ diff --git a/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSContactCache.sqlite-wal b/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSContactCache.sqlite-wal index eb3c46ed..99689049 100644 Binary files a/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSContactCache.sqlite-wal and b/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSContactCache.sqlite-wal differ diff --git a/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSLocationCache.sqlite-shm b/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSLocationCache.sqlite-shm index 994f036c..0bdf2430 100644 Binary files a/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSLocationCache.sqlite-shm and b/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSLocationCache.sqlite-shm differ diff --git a/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSLocationCache.sqlite-wal b/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSLocationCache.sqlite-wal index 11e47b6a..f33a49c1 100644 Binary files a/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSLocationCache.sqlite-wal and b/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSLocationCache.sqlite-wal differ diff --git a/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSPublicEventCache.sqlite-shm b/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSPublicEventCache.sqlite-shm index 96e9a997..02e6f75c 100644 Binary files a/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSPublicEventCache.sqlite-shm and b/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSPublicEventCache.sqlite-shm differ diff --git a/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSPublicEventCache.sqlite-wal b/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSPublicEventCache.sqlite-wal index 1ea23870..063e1f52 100644 Binary files a/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSPublicEventCache.sqlite-wal and b/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/CLSPublicEventCache.sqlite-wal differ diff --git a/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/PGCurationCache.sqlite.sqlite-shm b/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/PGCurationCache.sqlite.sqlite-shm index 56c1c0c9..3716073b 100644 Binary files a/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/PGCurationCache.sqlite.sqlite-shm and b/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/PGCurationCache.sqlite.sqlite-shm differ diff --git a/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/PGCurationCache.sqlite.sqlite-wal b/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/PGCurationCache.sqlite.sqlite-wal index 31414e44..0b8bc8ca 100644 Binary files a/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/PGCurationCache.sqlite.sqlite-wal and b/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/PGCurationCache.sqlite.sqlite-wal differ diff --git a/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/PGSearchComputationCache.plist b/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/PGSearchComputationCache.plist index cce158dc..1ebb45b8 100644 Binary files a/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/PGSearchComputationCache.plist and b/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/PGSearchComputationCache.plist differ diff --git a/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/PhotoAnalysisServicePreferences.plist b/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/PhotoAnalysisServicePreferences.plist index e6eae6e6..0a0d7518 100644 --- a/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/PhotoAnalysisServicePreferences.plist +++ b/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/PhotoAnalysisServicePreferences.plist @@ -3,24 +3,24 @@ BackgroundHighlightCollection - 2021-03-13T16:38:25Z + 2021-07-20T05:48:01Z BackgroundHighlightEnrichment - 2021-03-13T16:38:24Z + 2021-07-20T05:48:00Z BackgroundJobAssetRevGeocode - 2021-03-13T16:38:25Z + 2021-07-20T07:05:31Z BackgroundJobSearch - 2021-03-13T16:38:25Z + 2021-07-20T05:48:01Z BackgroundPeopleSuggestion - 2021-03-13T16:38:23Z + 2021-07-20T05:48:00Z BackgroundUserBehaviorProcessor - 2021-03-13T16:38:25Z + 2021-07-20T05:48:01Z PhotoAnalysisGraphLastBackgroundGraphConsistencyUpdateJobDateKey - 2020-10-17T23:45:33Z + 2021-07-20T05:48:08Z PhotoAnalysisGraphLastBackgroundGraphRebuildJobDate - 2020-10-17T23:45:24Z + 2021-07-20T05:47:59Z PhotoAnalysisGraphLastBackgroundMemoryGenerationJobDate - 2021-03-13T16:38:25Z + 2021-07-20T05:48:01Z SiriPortraitDonation - 2021-03-13T16:38:25Z + 2021-07-20T05:48:01Z diff --git a/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/PhotosGraph/photosgraph.kgdb b/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/PhotosGraph/photosgraph.kgdb index 2b049696..d4516731 100644 Binary files a/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/PhotosGraph/photosgraph.kgdb and b/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/PhotosGraph/photosgraph.kgdb differ diff --git a/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/changetoken.plist b/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/changetoken.plist index abbd3082..bd4762a3 100644 Binary files a/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/changetoken.plist and b/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/graph/changetoken.plist differ diff --git a/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/vision/PhotoAnalysisServicePreferences.plist b/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/vision/PhotoAnalysisServicePreferences.plist index 83f200a6..988abba6 100644 --- a/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/vision/PhotoAnalysisServicePreferences.plist +++ b/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/vision/PhotoAnalysisServicePreferences.plist @@ -3,8 +3,8 @@ FaceIDModelLastGenerationKey - 2020-10-17T23:45:32Z + 2021-07-20T05:48:02Z LastContactClassificationKey - 2020-10-17T23:45:54Z + 2021-07-20T05:48:05Z diff --git a/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/vision/vnpersonsmodel.bin b/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/vision/vnpersonsmodel.bin index e71756fa..2fde37b6 100644 Binary files a/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/vision/vnpersonsmodel.bin and b/tests/Test-10.15.7.photoslibrary/private/com.apple.photoanalysisd/caches/vision/vnpersonsmodel.bin differ diff --git a/tests/Test-10.15.7.photoslibrary/private/com.apple.photolibraryd/caches/clientservertransaction/823E7218-7125-4623-BA40-7097731445CC b/tests/Test-10.15.7.photoslibrary/private/com.apple.photolibraryd/caches/clientservertransaction/823E7218-7125-4623-BA40-7097731445CC deleted file mode 100644 index 4df89634..00000000 Binary files a/tests/Test-10.15.7.photoslibrary/private/com.apple.photolibraryd/caches/clientservertransaction/823E7218-7125-4623-BA40-7097731445CC and /dev/null differ diff --git a/tests/Test-10.15.7.photoslibrary/resources/journals/Album-change.plj b/tests/Test-10.15.7.photoslibrary/resources/journals/Album-change.plj index 95a2fdd8..ae920f99 100644 Binary files a/tests/Test-10.15.7.photoslibrary/resources/journals/Album-change.plj and b/tests/Test-10.15.7.photoslibrary/resources/journals/Album-change.plj differ diff --git a/tests/Test-10.15.7.photoslibrary/resources/journals/Album-snapshot.plj b/tests/Test-10.15.7.photoslibrary/resources/journals/Album-snapshot.plj index 242008b2..9a597bc9 100644 Binary files a/tests/Test-10.15.7.photoslibrary/resources/journals/Album-snapshot.plj and b/tests/Test-10.15.7.photoslibrary/resources/journals/Album-snapshot.plj differ diff --git a/tests/Test-10.15.7.photoslibrary/resources/journals/Album.plist b/tests/Test-10.15.7.photoslibrary/resources/journals/Album.plist index 523b84b5..278f7ecd 100644 --- a/tests/Test-10.15.7.photoslibrary/resources/journals/Album.plist +++ b/tests/Test-10.15.7.photoslibrary/resources/journals/Album.plist @@ -3,7 +3,7 @@ coalesceDate - 2020-04-11T19:26:12Z + 2021-07-20T12:21:20Z coalescePayloadVersion 1 currentPayloadVersion diff --git a/tests/Test-10.15.7.photoslibrary/resources/journals/Asset-change.plj b/tests/Test-10.15.7.photoslibrary/resources/journals/Asset-change.plj index 4a0e6503..76c739fb 100644 Binary files a/tests/Test-10.15.7.photoslibrary/resources/journals/Asset-change.plj and b/tests/Test-10.15.7.photoslibrary/resources/journals/Asset-change.plj differ diff --git a/tests/Test-10.15.7.photoslibrary/resources/journals/Asset-snapshot.plj b/tests/Test-10.15.7.photoslibrary/resources/journals/Asset-snapshot.plj index 5d4b6fe5..1976000a 100644 Binary files a/tests/Test-10.15.7.photoslibrary/resources/journals/Asset-snapshot.plj and b/tests/Test-10.15.7.photoslibrary/resources/journals/Asset-snapshot.plj differ diff --git a/tests/Test-10.15.7.photoslibrary/resources/journals/Asset.plist b/tests/Test-10.15.7.photoslibrary/resources/journals/Asset.plist index 43b9c778..5c1440f0 100644 --- a/tests/Test-10.15.7.photoslibrary/resources/journals/Asset.plist +++ b/tests/Test-10.15.7.photoslibrary/resources/journals/Asset.plist @@ -3,7 +3,7 @@ coalesceDate - 2020-05-29T15:20:05Z + 2021-07-20T12:21:21Z coalescePayloadVersion 10 currentPayloadVersion diff --git a/tests/Test-10.15.7.photoslibrary/resources/journals/DetectedFace-change.plj b/tests/Test-10.15.7.photoslibrary/resources/journals/DetectedFace-change.plj deleted file mode 100644 index c86a4796..00000000 Binary files a/tests/Test-10.15.7.photoslibrary/resources/journals/DetectedFace-change.plj and /dev/null differ diff --git a/tests/Test-10.15.7.photoslibrary/resources/journals/DetectedFace-snapshot.plj b/tests/Test-10.15.7.photoslibrary/resources/journals/DetectedFace-snapshot.plj index 1a00fa8d..37c7d3f3 100644 Binary files a/tests/Test-10.15.7.photoslibrary/resources/journals/DetectedFace-snapshot.plj and b/tests/Test-10.15.7.photoslibrary/resources/journals/DetectedFace-snapshot.plj differ diff --git a/tests/Test-10.15.7.photoslibrary/resources/journals/DetectedFace.plist b/tests/Test-10.15.7.photoslibrary/resources/journals/DetectedFace.plist index a7b3527b..278f7ecd 100644 --- a/tests/Test-10.15.7.photoslibrary/resources/journals/DetectedFace.plist +++ b/tests/Test-10.15.7.photoslibrary/resources/journals/DetectedFace.plist @@ -3,7 +3,7 @@ coalesceDate - 2019-10-27T15:36:05Z + 2021-07-20T12:21:20Z coalescePayloadVersion 1 currentPayloadVersion diff --git a/tests/Test-10.15.7.photoslibrary/resources/journals/Folder-change.plj b/tests/Test-10.15.7.photoslibrary/resources/journals/Folder-change.plj index 6bfe601b..e6cc5175 100644 Binary files a/tests/Test-10.15.7.photoslibrary/resources/journals/Folder-change.plj and b/tests/Test-10.15.7.photoslibrary/resources/journals/Folder-change.plj differ diff --git a/tests/Test-10.15.7.photoslibrary/resources/journals/Folder-snapshot.plj b/tests/Test-10.15.7.photoslibrary/resources/journals/Folder-snapshot.plj index 2e6a4601..0441dd6b 100644 Binary files a/tests/Test-10.15.7.photoslibrary/resources/journals/Folder-snapshot.plj and b/tests/Test-10.15.7.photoslibrary/resources/journals/Folder-snapshot.plj differ diff --git a/tests/Test-10.15.7.photoslibrary/resources/journals/Folder.plist b/tests/Test-10.15.7.photoslibrary/resources/journals/Folder.plist index ac1db136..3055efef 100644 --- a/tests/Test-10.15.7.photoslibrary/resources/journals/Folder.plist +++ b/tests/Test-10.15.7.photoslibrary/resources/journals/Folder.plist @@ -3,7 +3,7 @@ coalesceDate - 2020-05-29T15:20:05Z + 2021-07-20T12:21:21Z coalescePayloadVersion 1 currentPayloadVersion diff --git a/tests/Test-10.15.7.photoslibrary/resources/journals/HistoryToken.plist b/tests/Test-10.15.7.photoslibrary/resources/journals/HistoryToken.plist index cf0aca49..aa284bab 100644 Binary files a/tests/Test-10.15.7.photoslibrary/resources/journals/HistoryToken.plist and b/tests/Test-10.15.7.photoslibrary/resources/journals/HistoryToken.plist differ diff --git a/tests/Test-10.15.7.photoslibrary/resources/journals/ImportSession-change.plj b/tests/Test-10.15.7.photoslibrary/resources/journals/ImportSession-change.plj deleted file mode 100644 index f9a32321..00000000 Binary files a/tests/Test-10.15.7.photoslibrary/resources/journals/ImportSession-change.plj and /dev/null differ diff --git a/tests/Test-10.15.7.photoslibrary/resources/journals/ImportSession-snapshot.plj b/tests/Test-10.15.7.photoslibrary/resources/journals/ImportSession-snapshot.plj index b70f6df4..6d779512 100644 Binary files a/tests/Test-10.15.7.photoslibrary/resources/journals/ImportSession-snapshot.plj and b/tests/Test-10.15.7.photoslibrary/resources/journals/ImportSession-snapshot.plj differ diff --git a/tests/Test-10.15.7.photoslibrary/resources/journals/ImportSession.plist b/tests/Test-10.15.7.photoslibrary/resources/journals/ImportSession.plist index ac1db136..278f7ecd 100644 --- a/tests/Test-10.15.7.photoslibrary/resources/journals/ImportSession.plist +++ b/tests/Test-10.15.7.photoslibrary/resources/journals/ImportSession.plist @@ -3,7 +3,7 @@ coalesceDate - 2020-05-29T15:20:05Z + 2021-07-20T12:21:20Z coalescePayloadVersion 1 currentPayloadVersion diff --git a/tests/Test-10.15.7.photoslibrary/resources/journals/Person-change.plj b/tests/Test-10.15.7.photoslibrary/resources/journals/Person-change.plj deleted file mode 100644 index bb5e8461..00000000 Binary files a/tests/Test-10.15.7.photoslibrary/resources/journals/Person-change.plj and /dev/null differ diff --git a/tests/Test-10.15.7.photoslibrary/resources/journals/Person-snapshot.plj b/tests/Test-10.15.7.photoslibrary/resources/journals/Person-snapshot.plj index 8e7d5719..c2eac19c 100644 Binary files a/tests/Test-10.15.7.photoslibrary/resources/journals/Person-snapshot.plj and b/tests/Test-10.15.7.photoslibrary/resources/journals/Person-snapshot.plj differ diff --git a/tests/Test-10.15.7.photoslibrary/resources/journals/Person.plist b/tests/Test-10.15.7.photoslibrary/resources/journals/Person.plist index 3ece9a2c..278f7ecd 100644 --- a/tests/Test-10.15.7.photoslibrary/resources/journals/Person.plist +++ b/tests/Test-10.15.7.photoslibrary/resources/journals/Person.plist @@ -2,6 +2,10 @@ + coalesceDate + 2021-07-20T12:21:20Z + coalescePayloadVersion + 1 currentPayloadVersion 1 snapshotDate diff --git a/tests/test_albums_folders_catalina_10_15_4.py b/tests/test_albums_folders_catalina_10_15_7.py similarity index 56% rename from tests/test_albums_folders_catalina_10_15_4.py rename to tests/test_albums_folders_catalina_10_15_7.py index b8d8eaa9..1bdc2894 100644 --- a/tests/test_albums_folders_catalina_10_15_4.py +++ b/tests/test_albums_folders_catalina_10_15_7.py @@ -2,11 +2,11 @@ import pytest import osxphotos -from osxphotos._constants import _UNKNOWN_PERSON +from osxphotos._constants import _UNKNOWN_PERSON, AlbumSortOrder -PHOTOS_DB = "./tests/Test-10.15.4.photoslibrary/database/photos.db" +PHOTOS_DB = "./tests/Test-10.15.7.photoslibrary/database/photos.db" -TOP_LEVEL_FOLDERS = ["Folder1", "Folder2"] +TOP_LEVEL_FOLDERS = ["Folder1", "Folder2", "Pumpkin Farm"] TOP_LEVEL_CHILDREN = ["SubFolder1", "SubFolder2"] @@ -15,25 +15,73 @@ FOLDER_ALBUM_DICT = { "SubFolder1": [], "SubFolder2": ["AlbumInFolder"], "Folder2": ["Raw"], + "Pumpkin Farm": [], } -ALBUM_NAMES = ["Pumpkin Farm", "AlbumInFolder", "Test Album", "Test Album", "Raw"] +ALBUM_NAMES = [ + "2018-10 - Sponsion, Museum, Frühstück, Römermuseum", + "2019-10/11 Paris Clermont", + "AlbumInFolder", + "EmptyAlbum", + "I have a deleted twin", + "Multi Keyword", + "Pumpkin Farm", + "Raw", + "Sorted Manual", + "Sorted Newest First", + "Sorted Oldest First", + "Sorted Title", + "Test Album", + "Test Album", +] ALBUM_PARENT_DICT = { - "Pumpkin Farm": None, + "2018-10 - Sponsion, Museum, Frühstück, Römermuseum": None, + "2019-10/11 Paris Clermont": None, "AlbumInFolder": "SubFolder2", - "Test Album": None, + "EmptyAlbum": None, + "I have a deleted twin": None, + "Multi Keyword": None, + "Pumpkin Farm": None, "Raw": "Folder2", + "Sorted Manual": None, + "Sorted Newest First": None, + "Sorted Oldest First": None, + "Sorted Title": None, + "Test Album": None, } ALBUM_FOLDER_NAMES_DICT = { - "Pumpkin Farm": [], + "2018-10 - Sponsion, Museum, Frühstück, Römermuseum": [], + "2019-10/11 Paris Clermont": [], "AlbumInFolder": ["Folder1", "SubFolder2"], - "Test Album": [], + "EmptyAlbum": [], + "I have a deleted twin": [], + "Multi Keyword": [], + "Pumpkin Farm": [], "Raw": ["Folder2"], + "Sorted Manual": [], + "Sorted Newest First": [], + "Sorted Oldest First": [], + "Sorted Title": [], + "Test Album": [], } -ALBUM_LEN_DICT = {"Pumpkin Farm": 3, "AlbumInFolder": 2, "Test Album": 1, "Raw": 4} +ALBUM_LEN_DICT = { + "2018-10 - Sponsion, Museum, Frühstück, Römermuseum": 1, + "2019-10/11 Paris Clermont": 1, + "AlbumInFolder": 2, + "EmptyAlbum": 0, + "I have a deleted twin": 1, + "Multi Keyword": 2, + "Pumpkin Farm": 3, + "Raw": 4, + "Sorted Manual": 3, + "Sorted Newest First": 3, + "Sorted Oldest First": 3, + "Sorted Title": 3, + "Test Album": 1, +} ALBUM_PHOTO_UUID_DICT = { "Pumpkin Farm": [ @@ -58,10 +106,33 @@ ALBUM_PHOTO_UUID_DICT = { } UUID_DICT = { - "two_albums": "F12384F6-CD17-4151-ACBA-AE0E3688539E", + "six_albums": "F12384F6-CD17-4151-ACBA-AE0E3688539E", "album_dates": "0C514A98-7B77-4E4F-801B-364B7B65EAFA", } +UUID_DICT_SORT_ORDER = { + AlbumSortOrder.MANUAL: [ + "7783E8E6-9CAC-40F3-BE22-81FB7051C266", + "3DD2C897-F19E-4CA6-8C22-B027D5A71907", + "F12384F6-CD17-4151-ACBA-AE0E3688539E", + ], + AlbumSortOrder.NEWEST_FIRST: [ + "7783E8E6-9CAC-40F3-BE22-81FB7051C266", + "F12384F6-CD17-4151-ACBA-AE0E3688539E", + "3DD2C897-F19E-4CA6-8C22-B027D5A71907", + ], + AlbumSortOrder.OLDEST_FIRST: [ + "3DD2C897-F19E-4CA6-8C22-B027D5A71907", + "F12384F6-CD17-4151-ACBA-AE0E3688539E", + "7783E8E6-9CAC-40F3-BE22-81FB7051C266", + ], + AlbumSortOrder.TITLE: [ + "7783E8E6-9CAC-40F3-BE22-81FB7051C266", + "F12384F6-CD17-4151-ACBA-AE0E3688539E", + "3DD2C897-F19E-4CA6-8C22-B027D5A71907", + ], +} + @pytest.fixture(scope="module") def photosdb(): @@ -186,8 +257,9 @@ def test_albums_photos(photosdb): photos = album.photos assert len(photos) == ALBUM_LEN_DICT[album.title] assert len(photos) == len(album) - for photo in photos: - assert photo.uuid in ALBUM_PHOTO_UUID_DICT[album.title] + if album.title in ALBUM_PHOTO_UUID_DICT: + for photo in photos: + assert photo.uuid in ALBUM_PHOTO_UUID_DICT[album.title] def test_album_dates(photosdb): @@ -237,19 +309,67 @@ def test_photoinfo_albums(photosdb): def test_photoinfo_albums_2(photosdb): """Test that PhotoInfo.albums returns only number albums expected""" - photos = photosdb.photos(uuid=[UUID_DICT["two_albums"]]) + photos = photosdb.photos(uuid=[UUID_DICT["six_albums"]]) albums = photos[0].albums - assert len(albums) == 2 + assert len(albums) == 6 def test_photoinfo_album_info(photosdb): """test PhotoInfo.album_info""" - photos = photosdb.photos(uuid=[UUID_DICT["two_albums"]]) + photos = photosdb.photos(uuid=[UUID_DICT["six_albums"]]) album_info = photos[0].album_info - assert len(album_info) == 2 - assert album_info[0].title in ["Pumpkin Farm", "Test Album"] - assert album_info[1].title in ["Pumpkin Farm", "Test Album"] + assert len(album_info) == 6 + assert album_info[0].title in [ + "Pumpkin Farm", + "Test Album", + "Sorted Manual", + "Sorted Newest First", + "Sorted Oldest First", + "Sorted Title", + ] + assert album_info[1].title in [ + "Pumpkin Farm", + "Test Album", + "Sorted Manual", + "Sorted Newest First", + "Sorted Oldest First", + "Sorted Title", + ] assert photos[0].uuid in [photo.uuid for photo in album_info[0].photos] + + +def test_album_sort_order(photosdb): + """Test that AlbumInfo.sort_order is set correctly""" + albums = photosdb.album_info + + for album in albums: + if album.title == "Sorted Manual": + assert album.sort_order == AlbumSortOrder.MANUAL + elif album.title == "Sorted Newest First": + assert album.sort_order == AlbumSortOrder.NEWEST_FIRST + elif album.title == "Sorted Oldest First": + assert album.sort_order == AlbumSortOrder.OLDEST_FIRST + elif album.title == "Sorted Title": + assert album.sort_order == AlbumSortOrder.TITLE + + +def test_album_sort_order_photos(photosdb): + """Test AlbumInfo.photos returns photos sorted according to AlbumInfo.sort_order""" + albums = photosdb.album_info + for album in albums: + uuids = [photo.uuid for photo in album.photos] + if album.title == "Sorted Manual": + assert album.sort_order == AlbumSortOrder.MANUAL + assert uuids == UUID_DICT_SORT_ORDER[AlbumSortOrder.MANUAL] + if album.title == "Sorted Newest First": + assert album.sort_order == AlbumSortOrder.NEWEST_FIRST + assert uuids == UUID_DICT_SORT_ORDER[AlbumSortOrder.NEWEST_FIRST] + if album.title == "Sorted Oldest First": + assert album.sort_order == AlbumSortOrder.OLDEST_FIRST + assert uuids == UUID_DICT_SORT_ORDER[AlbumSortOrder.OLDEST_FIRST] + if album.title == "Sorted Title": + assert album.sort_order == AlbumSortOrder.TITLE + assert uuids == UUID_DICT_SORT_ORDER[AlbumSortOrder.TITLE] diff --git a/tests/test_catalina_10_15_7.py b/tests/test_catalina_10_15_7.py index 9981a16f..512e272e 100644 --- a/tests/test_catalina_10_15_7.py +++ b/tests/test_catalina_10_15_7.py @@ -49,45 +49,53 @@ KEYWORDS = [ # Photos 5 includes blank person for detected face PERSONS = ["Katie", "Suzy", "Maria", _UNKNOWN_PERSON] ALBUMS = [ - "Pumpkin Farm", - "Test Album", # there are 2 albums named "Test Album" for testing duplicate album names - "AlbumInFolder", - "Raw", - "I have a deleted twin", # there's an empty album with same name that has been deleted - "EmptyAlbum", "2018-10 - Sponsion, Museum, Frühstück, Römermuseum", "2019-10/11 Paris Clermont", + "AlbumInFolder", + "EmptyAlbum", + "I have a deleted twin", # there's an empty album with same name that has been deleted "Multi Keyword", + "Pumpkin Farm", + "Raw", + "Sorted Manual", + "Sorted Newest First", + "Sorted Oldest First", + "Sorted Title", + "Test Album", # there are 2 albums named "Test Album" for testing duplicate album names ] KEYWORDS_DICT = { - "Kids": 4, - "wedding": 3, - "flowers": 1, + "Drink": 2, "England": 1, - "London": 1, + "Kids": 4, "London 2018": 1, + "London": 1, + "Maria": 1, "St. James's Park": 1, + "Travel": 2, "UK": 1, "United Kingdom": 1, - "foo/bar": 1, - "Travel": 2, - "Maria": 1, - "Drink": 2, "Val d'Isère": 2, - "Wine": 2, "Wine Bottle": 2, + "Wine": 2, + "flowers": 1, + "foo/bar": 1, + "wedding": 3, } PERSONS_DICT = {"Katie": 3, "Suzy": 2, "Maria": 2, _UNKNOWN_PERSON: 1} ALBUM_DICT = { - "Pumpkin Farm": 3, - "Test Album": 2, - "AlbumInFolder": 2, - "Raw": 4, - "I have a deleted twin": 1, - "EmptyAlbum": 0, "2018-10 - Sponsion, Museum, Frühstück, Römermuseum": 1, "2019-10/11 Paris Clermont": 1, + "AlbumInFolder": 2, + "EmptyAlbum": 0, + "I have a deleted twin": 1, "Multi Keyword": 2, + "Pumpkin Farm": 3, + "Raw": 4, + "Sorted Manual": 3, + "Sorted Newest First": 3, + "Sorted Oldest First": 3, + "Sorted Title": 3, + "Test Album": 2, } # Note: there are 2 albums named "Test Album" for testing duplicate album names UUID_DICT = { diff --git a/tests/test_cli.py b/tests/test_cli.py index d9dd7ee4..35139b4c 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -754,11 +754,11 @@ UUID_IN_ALBUM = [ "4D521201-92AC-43E5-8F7C-59BC41C37A96", "D05A5FE3-15FB-49A1-A15D-AB3DA6F8B068", "3DD2C897-F19E-4CA6-8C22-B027D5A71907", + "7783E8E6-9CAC-40F3-BE22-81FB7051C266", ] UUID_NOT_IN_ALBUM = [ "A1DD1F98-2ECD-431F-9AC9-5AFEFE2D3A5C", - "7783E8E6-9CAC-40F3-BE22-81FB7051C266", "DC99FBDD-7A52-4100-A5BB-344131646C30", "D1359D09-1373-4F3B-B0E3-1A4DE573E4A3", "E2078879-A29C-4D6F-BACB-E3BBE6C3EB91", @@ -2649,7 +2649,7 @@ def test_query_label_4(): ) assert result.exit_code == 0 json_got = json.loads(result.output) - assert len(json_got) == 2 + assert len(json_got) == 1 def test_query_deleted_deleted_only(): @@ -2883,11 +2883,11 @@ def test_export_sidecar_templates(): exifdata = json.load(jsonfile) assert ( exifdata[0]["XMP:Description"] - == "Girls with pumpkins Katie, Suzy Kids Pumpkin Farm, Test Album" + == "Girls with pumpkins Katie, Suzy Kids Pumpkin Farm, Sorted Manual, Sorted Newest First, Sorted Oldest First, Sorted Title, Test Album" ) assert ( exifdata[0]["EXIF:ImageDescription"] - == "Girls with pumpkins Katie, Suzy Kids Pumpkin Farm, Test Album" + == "Girls with pumpkins Katie, Suzy Kids Pumpkin Farm, Sorted Manual, Sorted Newest First, Sorted Oldest First, Sorted Title, Test Album" ) @@ -2926,11 +2926,11 @@ def test_export_sidecar_templates_exiftool(): exifdata = json.load(jsonfile) assert ( exifdata[0]["Description"] - == "Girls with pumpkins Katie, Suzy Kids Pumpkin Farm, Test Album" + == "Girls with pumpkins Katie, Suzy Kids Pumpkin Farm, Sorted Manual, Sorted Newest First, Sorted Oldest First, Sorted Title, Test Album" ) assert ( exifdata[0]["ImageDescription"] - == "Girls with pumpkins Katie, Suzy Kids Pumpkin Farm, Test Album" + == "Girls with pumpkins Katie, Suzy Kids Pumpkin Farm, Sorted Manual, Sorted Newest First, Sorted Oldest First, Sorted Title, Test Album" )