Skip to content

Commit

Permalink
Fix issue when there is no last scan
Browse files Browse the repository at this point in the history
  • Loading branch information
derneuere committed Feb 12, 2025
1 parent 9ba0060 commit 2b44a2c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions api/directory_watcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ def generate_tags(user, job_id: UUID, full_scan=False):
& Q(captions_json__isnull=True)
& Q(captions_json__places365__isnull=True)
)
if not full_scan:
if not full_scan and last_scan:
existing_photos = existing_photos.filter(added_on__gt=last_scan.started_at)

if existing_photos.count() == 0:
Expand Down Expand Up @@ -482,7 +482,7 @@ def add_geolocation(user, job_id: UUID, full_scan=False):
.first()
)
existing_photos = Photo.objects.filter(owner=user.id)
if not full_scan:
if not full_scan and last_scan:
existing_photos = existing_photos.filter(added_on__gt=last_scan.started_at)
if existing_photos.count() == 0:
lrj.progress_target = 0
Expand Down Expand Up @@ -541,7 +541,7 @@ def scan_faces(user, job_id: UUID, full_scan=False):
existing_photos = Photo.objects.filter(
Q(owner=user.id) & Q(thumbnail_big__isnull=False)
)
if not full_scan:
if not full_scan and last_scan:
existing_photos = existing_photos.filter(added_on__gt=last_scan.started_at)

if existing_photos.count() == 0:
Expand Down

0 comments on commit 2b44a2c

Please sign in to comment.