[Files Refactor] Bug fixes (#2868)

* Return error if multiple rows returned for id
* Add missing LoadFiles calls
* Show id if path is empty
This commit is contained in:
WithoutPants
2022-09-02 11:18:37 +10:00
parent 273cf0383d
commit 94d39da706
23 changed files with 93 additions and 26 deletions

View File

@@ -31,7 +31,7 @@ func getGalleryFileTagger(s *models.Gallery, cache *match.Cache) tagger {
return tagger{
ID: s.ID,
Type: "gallery",
Name: s.GetTitle(),
Name: s.DisplayName(),
Path: path,
trimExt: trimExt,
cache: cache,

View File

@@ -23,7 +23,7 @@ func getImageFileTagger(s *models.Image, cache *match.Cache) tagger {
return tagger{
ID: s.ID,
Type: "image",
Name: s.GetTitle(),
Name: s.DisplayName(),
Path: s.Path,
cache: cache,
}

View File

@@ -23,7 +23,7 @@ func getSceneFileTagger(s *models.Scene, cache *match.Cache) tagger {
return tagger{
ID: s.ID,
Type: "scene",
Name: s.GetTitle(),
Name: s.DisplayName(),
Path: s.Path,
cache: cache,
}

View File

@@ -121,11 +121,11 @@ func (t *tagger) tagScenes(ctx context.Context, paths []string, sceneReader scen
added, err := addFunc(p)
if err != nil {
return t.addError("scene", p.GetTitle(), err)
return t.addError("scene", p.DisplayName(), err)
}
if added {
t.addLog("scene", p.GetTitle())
t.addLog("scene", p.DisplayName())
}
}
@@ -142,11 +142,11 @@ func (t *tagger) tagImages(ctx context.Context, paths []string, imageReader imag
added, err := addFunc(p)
if err != nil {
return t.addError("image", p.GetTitle(), err)
return t.addError("image", p.DisplayName(), err)
}
if added {
t.addLog("image", p.GetTitle())
t.addLog("image", p.DisplayName())
}
}
@@ -163,11 +163,11 @@ func (t *tagger) tagGalleries(ctx context.Context, paths []string, galleryReader
added, err := addFunc(p)
if err != nil {
return t.addError("gallery", p.GetTitle(), err)
return t.addError("gallery", p.DisplayName(), err)
}
if added {
t.addLog("gallery", p.GetTitle())
t.addLog("gallery", p.DisplayName())
}
}