From bc5cd93e974214e2327d604ff92b3c6b6ce62f04 Mon Sep 17 00:00:00 2001 From: Rhet Turnbull Date: Fri, 18 Jun 2021 15:02:17 -0700 Subject: [PATCH] Added error handling for --add-to-album --- osxphotos/_version.py | 2 +- osxphotos/photosalbum.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/osxphotos/_version.py b/osxphotos/_version.py index dad0608b..af19b72f 100644 --- a/osxphotos/_version.py +++ b/osxphotos/_version.py @@ -1,3 +1,3 @@ """ version info """ -__version__ = "0.42.37" +__version__ = "0.42.38" diff --git a/osxphotos/photosalbum.py b/osxphotos/photosalbum.py index 23eafcaa..eb2341ee 100644 --- a/osxphotos/photosalbum.py +++ b/osxphotos/photosalbum.py @@ -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)