Skip to content

Commit c8d6123

Browse files
authored
Merge pull request #304 from Red-F/fix-identical-subject-resilience
never crash when images contain identical subject tags (type Generic)
2 parents 4b9ef8e + 14d4434 commit c8d6123

File tree

1 file changed

+1
-1
lines changed
  • photonix/photos/utils

1 file changed

+1
-1
lines changed

photonix/photos/utils/db.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def record_photo(path, library, inotify_event_type=None):
152152
for subject in metadata.get('Subject', '').split(','):
153153
subject = subject.strip()
154154
if subject:
155-
tag = Tag.objects.create(library_id=library_id, name=subject, type="G")
155+
tag, _ = Tag.objects.get_or_create(library_id=library_id, name=subject, type="G")
156156
PhotoTag.objects.create(
157157
photo=photo,
158158
tag=tag,

0 commit comments

Comments
 (0)