From 5ad4a458deeacb1de867c37b995b58e8984777f6 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sun, 30 May 2021 19:14:32 -0700 Subject: [PATCH] Only add delete_file action if the file still exists. Files deleted out of etiquette can just be removed from the db. --- etiquette/objects.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etiquette/objects.py b/etiquette/objects.py index e5a3104..807a686 100644 --- a/etiquette/objects.py +++ b/etiquette/objects.py @@ -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)