From dcc16c92c16e5e59f6551e6561eaf5824470f3c3 Mon Sep 17 00:00:00 2001 From: Rhet Turnbull Date: Mon, 7 Nov 2022 22:11:13 -0800 Subject: [PATCH] Added ImportInfo __bool__, #820 --- osxphotos/albuminfo.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/osxphotos/albuminfo.py b/osxphotos/albuminfo.py index 9b2ec26c..0666ecc9 100644 --- a/osxphotos/albuminfo.py +++ b/osxphotos/albuminfo.py @@ -302,6 +302,12 @@ class ImportInfo(AlbumInfoBaseClass): self._photos = self._db.photos_by_uuid(sorted_uuid) return self._photos + def __bool__(self): + """Always returns True + A photo without an import session will return None for import_info, + thus if import_info is not None, it must be a valid import_info object (#820) + """ + return True class ProjectInfo(AlbumInfo): """