Metadata: Fix reading ExifTool sidecar files #755 #759

This commit is contained in:
Michael Mayer 2020-12-30 14:49:35 +01:00
parent 915363f339
commit d4139d6a78

View file

@ -80,7 +80,7 @@ func (m *MediaFile) MetaData() (result meta.Data) {
// Parse regular JSON sidecar files ("img_1234.json")
if !m.IsSidecar() {
if jsonFiles := fs.FormatJson.FindAll(m.FileName(), []string{Config().SidecarPath(), fs.HiddenPath}, Config().OriginalsPath(), false); len(jsonFiles) == 0 {
log.Debugf("media: no json sidecar file found for %s", txt.Quote(filepath.Base(m.FileName())))
log.Debugf("media: no original json sidecar file found for %s", txt.Quote(filepath.Base(m.FileName())))
} else {
for _, jsonFile := range jsonFiles {
jsonErr := m.metaData.JSON(jsonFile, m.BaseName())
@ -93,8 +93,10 @@ func (m *MediaFile) MetaData() (result meta.Data) {
}
}
if err := m.ReadExifToolJson(); err != nil {
if jsonErr := m.ReadExifToolJson(); jsonErr != nil {
log.Debug(err)
} else {
err = nil
}
}