Delete photo's thumbnail when deleting the file.

A minor oversight, I think you'll agree.
master
voussoir 2020-09-28 14:22:09 -07:00
parent 949e6f68fe
commit d531c66bf0
1 changed files with 11 additions and 2 deletions

View File

@ -821,8 +821,17 @@ class Photo(ObjectBase):
else:
self.photodb.log.debug('Deleting %s', path)
action = os.remove
queue_action = {'action': action, 'args': [path]}
self.photodb.on_commit_queue.append(queue_action)
self.photodb.on_commit_queue.append({
'action': action,
'args': [path],
})
if self.thumbnail and self.thumbnail.is_file:
self.photodb.on_commit_queue.append({
'action': action,
'args': [self.thumbnail.absolute_path],
})
self._uncache()
self.deleted = True