Only add delete_file action if the file still exists.

Files deleted out of etiquette can just be removed from the db.
This commit is contained in:
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

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='photos', pairs={'id': self.id})
if delete_file:
if delete_file and self.real_path.exists:
path = self.real_path.absolute_path
if self.photodb.config['recycle_instead_of_delete']:
self.photodb.log.debug('Recycling %s.', path)