Fixed bug with handling of deleted albums
This commit is contained in:
@@ -1,3 +1,3 @@
|
|||||||
""" version info """
|
""" version info """
|
||||||
|
|
||||||
__version__ = "0.27.1"
|
__version__ = "0.27.3"
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ class FolderInfo:
|
|||||||
albums = [
|
albums = [
|
||||||
AlbumInfo(db=self._db, uuid=album)
|
AlbumInfo(db=self._db, uuid=album)
|
||||||
for album, detail in self._db._dbalbum_details.items()
|
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["kind"] == _PHOTOS_5_ALBUM_KIND
|
||||||
and detail["parentfolder"] == self._pk
|
and detail["parentfolder"] == self._pk
|
||||||
]
|
]
|
||||||
@@ -164,7 +164,7 @@ class FolderInfo:
|
|||||||
folders = [
|
folders = [
|
||||||
FolderInfo(db=self._db, uuid=album)
|
FolderInfo(db=self._db, uuid=album)
|
||||||
for album, detail in self._db._dbalbum_details.items()
|
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["kind"] == _PHOTOS_5_FOLDER_KIND
|
||||||
and detail["parentfolder"] == self._pk
|
and detail["parentfolder"] == self._pk
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -254,6 +254,7 @@ class PhotoInfo:
|
|||||||
""" list of albums picture is contained in """
|
""" list of albums picture is contained in """
|
||||||
albums = []
|
albums = []
|
||||||
for album in self._info["albums"]:
|
for album in self._info["albums"]:
|
||||||
|
if not self._db._dbalbum_details[album]["intrash"]:
|
||||||
albums.append(self._db._dbalbum_details[album]["title"])
|
albums.append(self._db._dbalbum_details[album]["title"])
|
||||||
return albums
|
return albums
|
||||||
|
|
||||||
@@ -262,6 +263,7 @@ class PhotoInfo:
|
|||||||
""" list of AlbumInfo objects representing albums the photos is contained in """
|
""" list of AlbumInfo objects representing albums the photos is contained in """
|
||||||
albums = []
|
albums = []
|
||||||
for album in self._info["albums"]:
|
for album in self._info["albums"]:
|
||||||
|
if not self._db._dbalbum_details[album]["intrash"]:
|
||||||
albums.append(AlbumInfo(db=self._db, uuid=album))
|
albums.append(AlbumInfo(db=self._db, uuid=album))
|
||||||
|
|
||||||
return albums
|
return albums
|
||||||
|
|||||||
@@ -289,7 +289,7 @@ class PhotosDB:
|
|||||||
k
|
k
|
||||||
for k in self._dbalbums_album.keys()
|
for k in self._dbalbums_album.keys()
|
||||||
if self._dbalbum_details[k]["cloudownerhashedpersonid"] is None
|
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:
|
for k in album_keys:
|
||||||
title = self._dbalbum_details[k]["title"]
|
title = self._dbalbum_details[k]["title"]
|
||||||
@@ -349,7 +349,7 @@ class PhotosDB:
|
|||||||
folders = [
|
folders = [
|
||||||
FolderInfo(db=self, uuid=album)
|
FolderInfo(db=self, uuid=album)
|
||||||
for album, detail in self._dbalbum_details.items()
|
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["kind"] == _PHOTOS_5_FOLDER_KIND
|
||||||
and detail["parentfolder"] == self._folder_root_pk
|
and detail["parentfolder"] == self._folder_root_pk
|
||||||
]
|
]
|
||||||
@@ -365,7 +365,7 @@ class PhotosDB:
|
|||||||
folder_names = [
|
folder_names = [
|
||||||
detail["title"]
|
detail["title"]
|
||||||
for detail in self._dbalbum_details.values()
|
for detail in self._dbalbum_details.values()
|
||||||
if detail["intrash"] == 0
|
if not detail["intrash"]
|
||||||
and detail["kind"] == _PHOTOS_5_FOLDER_KIND
|
and detail["kind"] == _PHOTOS_5_FOLDER_KIND
|
||||||
and detail["parentfolder"] == self._folder_root_pk
|
and detail["parentfolder"] == self._folder_root_pk
|
||||||
]
|
]
|
||||||
@@ -379,7 +379,7 @@ class PhotosDB:
|
|||||||
AlbumInfo(db=self, uuid=album)
|
AlbumInfo(db=self, uuid=album)
|
||||||
for album in self._dbalbums_album.keys()
|
for album in self._dbalbums_album.keys()
|
||||||
if self._dbalbum_details[album]["cloudownerhashedpersonid"] is None
|
if self._dbalbum_details[album]["cloudownerhashedpersonid"] is None
|
||||||
and self._dbalbum_details[album]["intrash"] == 0
|
and not self._dbalbum_details[album]["intrash"]
|
||||||
]
|
]
|
||||||
return albums
|
return albums
|
||||||
|
|
||||||
@@ -399,7 +399,7 @@ class PhotosDB:
|
|||||||
AlbumInfo(db=self, uuid=album)
|
AlbumInfo(db=self, uuid=album)
|
||||||
for album in self._dbalbums_album.keys()
|
for album in self._dbalbums_album.keys()
|
||||||
if self._dbalbum_details[album]["cloudownerhashedpersonid"] is not None
|
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
|
return albums_shared
|
||||||
|
|
||||||
@@ -414,7 +414,7 @@ class PhotosDB:
|
|||||||
self._dbalbum_details[album]["title"]
|
self._dbalbum_details[album]["title"]
|
||||||
for album in self._dbalbums_album.keys()
|
for album in self._dbalbums_album.keys()
|
||||||
if self._dbalbum_details[album]["cloudownerhashedpersonid"] is None
|
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)
|
return list(albums)
|
||||||
|
|
||||||
@@ -438,7 +438,7 @@ class PhotosDB:
|
|||||||
self._dbalbum_details[album]["title"]
|
self._dbalbum_details[album]["title"]
|
||||||
for album in self._dbalbums_album.keys()
|
for album in self._dbalbums_album.keys()
|
||||||
if self._dbalbum_details[album]["cloudownerhashedpersonid"] is not None
|
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)
|
return list(albums)
|
||||||
|
|
||||||
@@ -562,7 +562,7 @@ class PhotosDB:
|
|||||||
"title": album[1],
|
"title": album[1],
|
||||||
"cloudlibrarystate": album[2],
|
"cloudlibrarystate": album[2],
|
||||||
"cloudidentifier": album[3],
|
"cloudidentifier": album[3],
|
||||||
"intrash": album[4],
|
"intrash": False if album[4] == 0 else True,
|
||||||
"cloudlocalstate": None, # Photos 5
|
"cloudlocalstate": None, # Photos 5
|
||||||
"cloudownerfirstname": None, # Photos 5
|
"cloudownerfirstname": None, # Photos 5
|
||||||
"cloudownderlastname": None, # Photos 5
|
"cloudownderlastname": None, # Photos 5
|
||||||
@@ -1119,7 +1119,7 @@ class PhotosDB:
|
|||||||
"kind": album[6],
|
"kind": album[6],
|
||||||
"parentfolder": album[7],
|
"parentfolder": album[7],
|
||||||
"pk": album[8],
|
"pk": album[8],
|
||||||
"intrash": album[9],
|
"intrash": False if album[9] == 0 else True,
|
||||||
}
|
}
|
||||||
|
|
||||||
# add cross-reference by pk to uuid
|
# add cross-reference by pk to uuid
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user