Index: Ignore primary files with errors
This commit is contained in:
parent
4556250b49
commit
481f409601
|
@ -229,7 +229,7 @@ func (ind *Index) MediaFile(m *MediaFile, o IndexOptions, originalName string) (
|
|||
// Flag first JPEG as primary file for this photo.
|
||||
if !file.FilePrimary {
|
||||
if photoExists {
|
||||
if q := entity.UnscopedDb().Where("file_type = 'jpg' AND file_primary = 1 AND photo_id = ?", photo.ID).First(&primaryFile); q.Error != nil {
|
||||
if res := entity.UnscopedDb().Where("photo_id = ? AND file_primary = 1 AND file_type = 'jpg' AND file_error = ''", photo.ID).First(&primaryFile); res.Error != nil {
|
||||
file.FilePrimary = m.IsJpeg()
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue