Skip to content

Commit

Permalink
Handle removed images, when scanning images
Browse files Browse the repository at this point in the history
  • Loading branch information
derneuere committed Oct 1, 2024
1 parent e8c9852 commit 1c19cfa
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/directory_watcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ def create_new_image(user, path) -> Optional[Photo]:
file = File.create(path, user)
photo = photos.first()
photo.files.add(file)
if photo.removed:
photo.removed = False
photo.in_trashcan = False
photo.save()
photo._check_files()
util.logger.warning("photo {} exists already".format(path))
Expand Down

0 comments on commit 1c19cfa

Please sign in to comment.