Add Album.has_any_associated_directory.

This commit is contained in:
voussoir 2019-04-26 18:55:03 -07:00
parent ebde5c7ee8
commit 8c74e42a74

View file

@ -435,6 +435,16 @@ class Album(ObjectBase, GroupableMixin):
photos = sorted(photos, key=lambda x: x.basename.lower()) photos = sorted(photos, key=lambda x: x.basename.lower())
return photos return photos
def has_any_associated_directory(self):
'''
Return True if this album has at least 1 associated directory.
'''
row = self.photodb.sql_select_one(
'SELECT 1 FROM album_associated_directories WHERE albumid == ?',
[self.id]
)
return row is not None
def has_any_photo(self, recurse=False): def has_any_photo(self, recurse=False):
''' '''
Return True if this album contains at least 1 photo. Return True if this album contains at least 1 photo.