diff --git a/internal/api/photo_unstack.go b/internal/api/photo_unstack.go index cdc7fc9f0..df304cfe3 100644 --- a/internal/api/photo_unstack.go +++ b/internal/api/photo_unstack.go @@ -69,7 +69,7 @@ func PhotoUnstack(router *gin.RouterGroup) { stackPrimary, err := stackPhoto.PrimaryFile() if err != nil { - log.Errorf("photo: can't find primary file for existing photo (unstack %s)", txt.Quote(baseName)) + log.Errorf("photo: can't find primary file for %s (unstack)", txt.Quote(baseName)) AbortUnexpected(c) return } @@ -81,11 +81,11 @@ func PhotoUnstack(router *gin.RouterGroup) { AbortEntityNotFound(c) return } else if related.Len() == 0 { - log.Errorf("photo: no files found (unstack %s)", txt.Quote(baseName)) + log.Errorf("photo: no files found for %s (unstack)", txt.Quote(baseName)) AbortEntityNotFound(c) return } else if related.Main == nil { - log.Errorf("photo: no main file found (unstack %s)", txt.Quote(baseName)) + log.Errorf("photo: no main file found for %s (unstack)", txt.Quote(baseName)) AbortEntityNotFound(c) return } diff --git a/internal/entity/photo.go b/internal/entity/photo.go index ab57136fc..49e737277 100644 --- a/internal/entity/photo.go +++ b/internal/entity/photo.go @@ -1173,7 +1173,7 @@ func (m *Photo) SetPrimary(fileUID string) error { Pluck("file_uid", &files).Error; err != nil { return err } else if len(files) == 0 { - return fmt.Errorf("photo %s has no jpegs", m.PhotoUID) + return fmt.Errorf("%s has no primary file", m.PhotoUID) } else { fileUID = files[0] } diff --git a/internal/query/files.go b/internal/query/files.go index b08f4e481..e87acdd25 100644 --- a/internal/query/files.go +++ b/internal/query/files.go @@ -114,7 +114,7 @@ func SetPhotoPrimary(photoUID, fileUID string) error { } else if err := Db().Model(entity.File{}).Where("photo_uid = ? AND file_missing = 0 AND file_type = 'jpg'", photoUID).Order("file_width DESC").Limit(1).Pluck("file_uid", &files).Error; err != nil { return err } else if len(files) == 0 { - return fmt.Errorf("can't find primary for %s", photoUID) + return fmt.Errorf("can't find primary file for %s", photoUID) } else { fileUID = files[0] }