Index: Reset file error when hash changes
This commit is contained in:
parent
ee017cc841
commit
a141665a6d
|
@ -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))
|
||||
} 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))
|
||||
// Reset error when hash changes.
|
||||
m.FileError = ""
|
||||
}
|
||||
|
||||
// Set file hash to new value.
|
||||
|
|
|
@ -262,7 +262,7 @@ func (ind *Index) MediaFile(m *MediaFile, o IndexOptions, originalName string) (
|
|||
extraLabels := classify.Labels{}
|
||||
|
||||
// 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.
|
||||
result.Status = IndexSkipped
|
||||
return result
|
||||
|
|
Loading…
Reference in a new issue