Two small docstring improvements.

This commit is contained in:
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
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(
'SELECT 1 FROM album_photo_rel WHERE albumid == ? LIMIT 1',
[self.id]

View file

@ -281,10 +281,11 @@ class PDBPhotoMixin:
@decorators.transaction
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.
If not provided, everything is checked.
photos:
An iterable of Photo objects to check.
If not provided, all photos are checked.
'''
if photos is None:
photos = self.get_photos_by_recent()