Index: Reset file error when hash changes

This commit is contained in:
Michael Mayer 2021-10-05 20:51:18 +02:00
parent ee017cc841
commit a141665a6d
2 changed files with 3 additions and 1 deletions

View file

@ -239,6 +239,8 @@ func (m *File) ReplaceHash(newHash string) error {
log.Tracef("file %s: removing hash %s", txt.Quote(m.FileUID), txt.Quote(m.FileHash)) log.Tracef("file %s: removing hash %s", txt.Quote(m.FileUID), txt.Quote(m.FileHash))
} else if m.FileHash != "" && newHash != "" { } else if m.FileHash != "" && newHash != "" {
log.Tracef("file %s: hash %s changed to %s", txt.Quote(m.FileUID), txt.Quote(m.FileHash), txt.Quote(newHash)) log.Tracef("file %s: hash %s changed to %s", txt.Quote(m.FileUID), txt.Quote(m.FileHash), txt.Quote(newHash))
// Reset error when hash changes.
m.FileError = ""
} }
// Set file hash to new value. // Set file hash to new value.

View file

@ -262,7 +262,7 @@ func (ind *Index) MediaFile(m *MediaFile, o IndexOptions, originalName string) (
extraLabels := classify.Labels{} extraLabels := classify.Labels{}
// Detect faces in images? // Detect faces in images?
if o.FacesOnly && (!photoExists || !fileExists || !file.FilePrimary) { if o.FacesOnly && (!photoExists || !fileExists || !file.FilePrimary || file.FileError != "") {
// New and non-primary files can be skipped when updating faces only. // New and non-primary files can be skipped when updating faces only.
result.Status = IndexSkipped result.Status = IndexSkipped
return result return result