Skip to content

Commit

Permalink
Merge pull request #304 from Red-F/fix-identical-subject-resilience
Browse files Browse the repository at this point in the history
never crash when images contain identical subject tags (type Generic)
  • Loading branch information
damianmoore authored Jul 27, 2021
2 parents 4b9ef8e + 14d4434 commit c8d6123
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion photonix/photos/utils/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def record_photo(path, library, inotify_event_type=None):
for subject in metadata.get('Subject', '').split(','):
subject = subject.strip()
if subject:
tag = Tag.objects.create(library_id=library_id, name=subject, type="G")
tag, _ = Tag.objects.get_or_create(library_id=library_id, name=subject, type="G")
PhotoTag.objects.create(
photo=photo,
tag=tag,
Expand Down

0 comments on commit c8d6123

Please sign in to comment.