diff --git a/osxphotos/_version.py b/osxphotos/_version.py index 368d9f80..2d1f18d3 100644 --- a/osxphotos/_version.py +++ b/osxphotos/_version.py @@ -1,3 +1,3 @@ """ version info """ -__version__ = "0.27.1" +__version__ = "0.27.3" diff --git a/osxphotos/albuminfo.py b/osxphotos/albuminfo.py index cfb27e22..9c545b99 100644 --- a/osxphotos/albuminfo.py +++ b/osxphotos/albuminfo.py @@ -134,7 +134,7 @@ class FolderInfo: albums = [ AlbumInfo(db=self._db, uuid=album) for album, detail in self._db._dbalbum_details.items() - if detail["intrash"] == 0 + if not detail["intrash"] and detail["kind"] == _PHOTOS_5_ALBUM_KIND and detail["parentfolder"] == self._pk ] @@ -164,7 +164,7 @@ class FolderInfo: folders = [ FolderInfo(db=self._db, uuid=album) for album, detail in self._db._dbalbum_details.items() - if detail["intrash"] == 0 + if not detail["intrash"] and detail["kind"] == _PHOTOS_5_FOLDER_KIND and detail["parentfolder"] == self._pk ] diff --git a/osxphotos/photoinfo.py b/osxphotos/photoinfo.py index 35ee5c92..94882912 100644 --- a/osxphotos/photoinfo.py +++ b/osxphotos/photoinfo.py @@ -254,7 +254,8 @@ class PhotoInfo: """ list of albums picture is contained in """ albums = [] for album in self._info["albums"]: - albums.append(self._db._dbalbum_details[album]["title"]) + if not self._db._dbalbum_details[album]["intrash"]: + albums.append(self._db._dbalbum_details[album]["title"]) return albums @property @@ -262,7 +263,8 @@ class PhotoInfo: """ list of AlbumInfo objects representing albums the photos is contained in """ albums = [] for album in self._info["albums"]: - albums.append(AlbumInfo(db=self._db, uuid=album)) + if not self._db._dbalbum_details[album]["intrash"]: + albums.append(AlbumInfo(db=self._db, uuid=album)) return albums diff --git a/osxphotos/photosdb.py b/osxphotos/photosdb.py index b307b0fb..ab6ed467 100644 --- a/osxphotos/photosdb.py +++ b/osxphotos/photosdb.py @@ -289,7 +289,7 @@ class PhotosDB: k for k in self._dbalbums_album.keys() if self._dbalbum_details[k]["cloudownerhashedpersonid"] is None - and self._dbalbum_details[k]["intrash"] == 0 + and not self._dbalbum_details[k]["intrash"] ] for k in album_keys: title = self._dbalbum_details[k]["title"] @@ -349,7 +349,7 @@ class PhotosDB: folders = [ FolderInfo(db=self, uuid=album) for album, detail in self._dbalbum_details.items() - if detail["intrash"] == 0 + if not detail["intrash"] and detail["kind"] == _PHOTOS_5_FOLDER_KIND and detail["parentfolder"] == self._folder_root_pk ] @@ -365,7 +365,7 @@ class PhotosDB: folder_names = [ detail["title"] for detail in self._dbalbum_details.values() - if detail["intrash"] == 0 + if not detail["intrash"] and detail["kind"] == _PHOTOS_5_FOLDER_KIND and detail["parentfolder"] == self._folder_root_pk ] @@ -379,7 +379,7 @@ class PhotosDB: AlbumInfo(db=self, uuid=album) for album in self._dbalbums_album.keys() if self._dbalbum_details[album]["cloudownerhashedpersonid"] is None - and self._dbalbum_details[album]["intrash"] == 0 + and not self._dbalbum_details[album]["intrash"] ] return albums @@ -399,7 +399,7 @@ class PhotosDB: AlbumInfo(db=self, uuid=album) for album in self._dbalbums_album.keys() if self._dbalbum_details[album]["cloudownerhashedpersonid"] is not None - and self._dbalbum_details[album]["intrash"] == 0 + and not self._dbalbum_details[album]["intrash"] ] return albums_shared @@ -414,7 +414,7 @@ class PhotosDB: self._dbalbum_details[album]["title"] for album in self._dbalbums_album.keys() if self._dbalbum_details[album]["cloudownerhashedpersonid"] is None - and self._dbalbum_details[album]["intrash"] == 0 + and not self._dbalbum_details[album]["intrash"] } return list(albums) @@ -438,7 +438,7 @@ class PhotosDB: self._dbalbum_details[album]["title"] for album in self._dbalbums_album.keys() if self._dbalbum_details[album]["cloudownerhashedpersonid"] is not None - and self._dbalbum_details[album]["intrash"] == 0 + and not self._dbalbum_details[album]["intrash"] } return list(albums) @@ -562,7 +562,7 @@ class PhotosDB: "title": album[1], "cloudlibrarystate": album[2], "cloudidentifier": album[3], - "intrash": album[4], + "intrash": False if album[4] == 0 else True, "cloudlocalstate": None, # Photos 5 "cloudownerfirstname": None, # Photos 5 "cloudownderlastname": None, # Photos 5 @@ -1119,7 +1119,7 @@ class PhotosDB: "kind": album[6], "parentfolder": album[7], "pk": album[8], - "intrash": album[9], + "intrash": False if album[9] == 0 else True, } # add cross-reference by pk to uuid diff --git a/tests/Test-10.15.1.photoslibrary/database/Photos.sqlite-shm b/tests/Test-10.15.1.photoslibrary/database/Photos.sqlite-shm index 4b5ffb4c..acedbc37 100644 Binary files a/tests/Test-10.15.1.photoslibrary/database/Photos.sqlite-shm and b/tests/Test-10.15.1.photoslibrary/database/Photos.sqlite-shm differ