Delete photo's thumbnail when deleting the file.

A minor oversight, I think you'll agree.
This commit is contained in:
voussoir 2020-09-28 14:22:09 -07:00
parent 949e6f68fe
commit d531c66bf0

View file

@ -821,8 +821,17 @@ class Photo(ObjectBase):
else: else:
self.photodb.log.debug('Deleting %s', path) self.photodb.log.debug('Deleting %s', path)
action = os.remove 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._uncache()
self.deleted = True self.deleted = True