Add Album.has_any_associated_directory.

master
voussoir 2019-04-26 18:55:03 -07:00
parent ebde5c7ee8
commit 8c74e42a74
1 changed files with 10 additions and 0 deletions

View File

@ -435,6 +435,16 @@ class Album(ObjectBase, GroupableMixin):
photos = sorted(photos, key=lambda x: x.basename.lower())
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):
'''
Return True if this album contains at least 1 photo.