From 8ebb6b85edc512982bd057c1c6889730500b7903 Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Mon, 20 Jul 2020 11:39:16 +0200 Subject: [PATCH] Backend: Index file error messages Signed-off-by: Michael Mayer --- internal/photoprism/colors.go | 2 +- internal/photoprism/index_mediafile.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/photoprism/colors.go b/internal/photoprism/colors.go index b06787f5e..b42fe1ff1 100644 --- a/internal/photoprism/colors.go +++ b/internal/photoprism/colors.go @@ -13,7 +13,7 @@ import ( // Colors returns the ColorPerception of an image (only JPEG supported). func (m *MediaFile) Colors(thumbPath string) (perception colors.ColorPerception, err error) { if !m.IsJpeg() { - return perception, fmt.Errorf("colors: %s is not a jpeg", txt.Quote(m.BaseName())) + return perception, fmt.Errorf("%s is not a jpeg", txt.Quote(m.BaseName())) } img, err := m.Resample(thumbPath, "colors") diff --git a/internal/photoprism/index_mediafile.go b/internal/photoprism/index_mediafile.go index d1de680cb..f3da1a1e8 100644 --- a/internal/photoprism/index_mediafile.go +++ b/internal/photoprism/index_mediafile.go @@ -194,6 +194,7 @@ func (ind *Index) MediaFile(m *MediaFile, o IndexOptions, originalName string) ( photo.PhotoPath = filePath photo.PhotoName = fileBase + file.FileError = "" if !file.FilePrimary { if photoExists { @@ -228,6 +229,7 @@ func (ind *Index) MediaFile(m *MediaFile, o IndexOptions, originalName string) ( // Color information if p, err := m.Colors(Config().ThumbPath()); err != nil { log.Errorf("index: %s in %s (detect colors)", err.Error(), logName) + file.FileError = err.Error() } else { file.FileMainColor = p.MainColor.Name() file.FileColors = p.Colors.Hex() @@ -415,7 +417,6 @@ func (ind *Index) MediaFile(m *MediaFile, o IndexOptions, originalName string) ( // file obviously exists: remove deleted and missing flags file.DeletedAt = nil file.FileMissing = false - file.FileError = "" // primary files are used for rendering thumbnails and image classification (plus sidecar files if they exist) if file.FilePrimary {