Two small docstring improvements.

master
voussoir 2019-03-16 13:09:02 -07:00
parent 572349c1f1
commit ad140e485e
2 changed files with 11 additions and 3 deletions

View File

@ -440,6 +440,13 @@ class Album(ObjectBase, GroupableMixin):
return photos return photos
def has_any_photo(self, recurse=False): def has_any_photo(self, recurse=False):
'''
Return True if this album contains at least 1 photo.
recurse:
If True, photos in child albums satisfy.
If False, only consider this album.
'''
row = self.photodb.sql_select_one( row = self.photodb.sql_select_one(
'SELECT 1 FROM album_photo_rel WHERE albumid == ? LIMIT 1', 'SELECT 1 FROM album_photo_rel WHERE albumid == ? LIMIT 1',
[self.id] [self.id]

View File

@ -281,10 +281,11 @@ class PDBPhotoMixin:
@decorators.transaction @decorators.transaction
def purge_deleted_files(self, photos=None, *, commit=True): def purge_deleted_files(self, photos=None, *, commit=True):
''' '''
Remove Photo entries if their corresponding file is no longer found. Delete Photos whose corresponding file on disk is missing.
photos: An iterable of Photo objects to check. photos:
If not provided, everything is checked. An iterable of Photo objects to check.
If not provided, all photos are checked.
''' '''
if photos is None: if photos is None:
photos = self.get_photos_by_recent() photos = self.get_photos_by_recent()