Catch exception in folder processing to address #148
This commit is contained in:
@@ -1,3 +1,3 @@
|
|||||||
""" version info """
|
""" version info """
|
||||||
|
|
||||||
__version__ = "0.29.3"
|
__version__ = "0.29.4"
|
||||||
|
|||||||
@@ -1938,6 +1938,7 @@ class PhotosDB:
|
|||||||
return folders
|
return folders
|
||||||
|
|
||||||
def _album_folder_hierarchy_list(self, album_uuid):
|
def _album_folder_hierarchy_list(self, album_uuid):
|
||||||
|
""" return appropriate album_folder_hierarchy_list for the _db_version """
|
||||||
if self._db_version <= _PHOTOS_4_VERSION:
|
if self._db_version <= _PHOTOS_4_VERSION:
|
||||||
return self._album_folder_hierarchy_list_4(album_uuid)
|
return self._album_folder_hierarchy_list_4(album_uuid)
|
||||||
else:
|
else:
|
||||||
@@ -1948,8 +1949,11 @@ class PhotosDB:
|
|||||||
the folder list is in form:
|
the folder list is in form:
|
||||||
["Top level folder", "sub folder 1", "sub folder 2"]
|
["Top level folder", "sub folder 1", "sub folder 2"]
|
||||||
returns empty list of album is not in any folders """
|
returns empty list of album is not in any folders """
|
||||||
# title = photosdb._dbalbum_details[album_uuid]["title"]
|
try:
|
||||||
folders = self._dbalbum_folders[album_uuid]
|
folders = self._dbalbum_folders[album_uuid]
|
||||||
|
except KeyError:
|
||||||
|
logging.debug(f"Caught _dbalbum_folders KeyError for album: {album_uuid}")
|
||||||
|
return []
|
||||||
|
|
||||||
def _recurse_folder_hierarchy(folders, hierarchy=[]):
|
def _recurse_folder_hierarchy(folders, hierarchy=[]):
|
||||||
""" recursively walk the folders dict to build list of folder hierarchy """
|
""" recursively walk the folders dict to build list of folder hierarchy """
|
||||||
@@ -1982,8 +1986,11 @@ class PhotosDB:
|
|||||||
the folder list is in form:
|
the folder list is in form:
|
||||||
["Top level folder", "sub folder 1", "sub folder 2"]
|
["Top level folder", "sub folder 1", "sub folder 2"]
|
||||||
returns empty list of album is not in any folders """
|
returns empty list of album is not in any folders """
|
||||||
# title = photosdb._dbalbum_details[album_uuid]["title"]
|
try:
|
||||||
folders = self._dbalbum_folders[album_uuid]
|
folders = self._dbalbum_folders[album_uuid]
|
||||||
|
except KeyError:
|
||||||
|
logging.debug(f"Caught _dbalbum_folders KeyError for album: {album_uuid}")
|
||||||
|
return []
|
||||||
|
|
||||||
def _recurse_folder_hierarchy(folders, hierarchy=[]):
|
def _recurse_folder_hierarchy(folders, hierarchy=[]):
|
||||||
""" recursively walk the folders dict to build list of folder hierarchy """
|
""" recursively walk the folders dict to build list of folder hierarchy """
|
||||||
|
|||||||
Reference in New Issue
Block a user