Added error handling for --add-to-album

This commit is contained in:
Rhet Turnbull 2021-06-18 15:02:17 -07:00
parent 7bd1ba8075
commit bc5cd93e97
2 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,3 @@
""" version info """
__version__ = "0.42.37"
__version__ = "0.42.38"

View File

@ -29,7 +29,12 @@ class PhotosAlbum:
)
def add_list(self, photo_list: List[PhotoInfo]):
photos = [photoscript.Photo(p.uuid) for p in photo_list]
photos = []
for p in photo_list:
try:
photos.append(photoscript.Photo(p.uuid))
except Exception as e:
self.verbose(f"Error creating Photo object for photo {p.uuid}: {e}")
for photolist in chunked(photos, 10):
self.album.add(photolist)
photo_len = len(photos)