Skip to content

Commit

Permalink
Change order when to count
Browse files Browse the repository at this point in the history
  • Loading branch information
derneuere committed Jul 22, 2023
1 parent a297c55 commit 748e31d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/directory_watcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def is_hidden(path):


def handle_new_image(user, path, job_id):
update_scan_counter(job_id)
if not is_valid_media(path):
return
try:
Expand Down Expand Up @@ -234,10 +235,10 @@ def handle_new_image(user, path, job_id):
util.logger.exception(
"job {}: could not load image {}".format(job_id, path)
)
update_scan_counter(job_id)


def rescan_image(user, path, job_id):
update_scan_counter(job_id)
try:
if is_valid_media(path):
photo = Photo.objects.filter(Q(files__path=path)).get()
Expand All @@ -262,7 +263,6 @@ def rescan_image(user, path, job_id):
util.logger.exception(
"job {}: could not load image {}".format(job_id, path)
)
update_scan_counter(job_id)


def walk_directory(directory, callback):
Expand Down

0 comments on commit 748e31d

Please sign in to comment.