Only add delete_file action if the file still exists.

Files deleted out of etiquette can just be removed from the db.
master
voussoir 2021-05-30 19:14:32 -07:00
parent 1ee73feb6c
commit 5ad4a458de
No known key found for this signature in database
GPG Key ID: 5F7554F8C26DACCB
1 changed files with 1 additions and 1 deletions

View File

@ -930,7 +930,7 @@ class Photo(ObjectBase):
self.photodb.sql_delete(table='album_photo_rel', pairs={'photoid': self.id}) self.photodb.sql_delete(table='album_photo_rel', pairs={'photoid': self.id})
self.photodb.sql_delete(table='photos', pairs={'id': self.id}) self.photodb.sql_delete(table='photos', pairs={'id': self.id})
if delete_file: if delete_file and self.real_path.exists:
path = self.real_path.absolute_path path = self.real_path.absolute_path
if self.photodb.config['recycle_instead_of_delete']: if self.photodb.config['recycle_instead_of_delete']:
self.photodb.log.debug('Recycling %s.', path) self.photodb.log.debug('Recycling %s.', path)