From b976c095f3acf9d09f41121db73c398f359c5fb5 Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Tue, 2 Jul 2019 21:36:47 +0200 Subject: [PATCH] Code clean-up #56 --- internal/photoprism/indexer.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/photoprism/indexer.go b/internal/photoprism/indexer.go index 4ee6f923c..bb1a5cddc 100644 --- a/internal/photoprism/indexer.go +++ b/internal/photoprism/indexer.go @@ -306,9 +306,9 @@ func (i *Indexer) indexMediaFile(mediaFile *MediaFile) string { } if result := i.db.Where("file_type = 'jpg' AND file_primary = 1 AND photo_id = ?", photo.ID).First(&primaryFile); result.Error != nil { - isPrimary = mediaFile.Type() == FileTypeJpeg + isPrimary = mediaFile.IsJpeg() } else { - isPrimary = mediaFile.Type() == FileTypeJpeg && (fileName == primaryFile.FileName || fileHash == primaryFile.FileHash) + isPrimary = mediaFile.IsJpeg() && (fileName == primaryFile.FileName || fileHash == primaryFile.FileHash) } file.PhotoID = photo.ID