Keep trying artist art sources when folder lookup fails

This commit is contained in:
quepasaquepasa 2026-07-30 23:11:02 -04:00
parent 600ea5482c
commit fbf7bfb80c
2 changed files with 20 additions and 1 deletions

View File

@ -61,7 +61,13 @@ func newArtistArtworkReader(ctx context.Context, artwork *artwork, artID model.A
}
artistFolder, artistFolderLastUpdate, err := loadArtistFolder(ctx, artwork.ds, als, albumPaths)
if err != nil {
return nil, err
// The artist folder is only one of the possible art sources, so a failure to
// resolve it must not discard the remaining ones (uploaded image, image-folder,
// external). Carry on without it and let the priority chain fall through.
log.Warn(ctx, "Could not load artist folder, trying remaining art sources", "artist", ar.Name,
"id", artID.ID, err)
artistFolder = ""
artistFolderLastUpdate = time.Time{}
}
var lib libraryView
if len(als) > 0 {

View File

@ -125,6 +125,19 @@ var _ = Describe("artistArtworkReader", func() {
Expect(upd).To(BeZero())
})
})
When("the folder is not in the database", func() {
It("returns no folder without an error, so other art sources are still tried", func() {
paths = []string{
filepath.FromSlash("/music/artist/album1"),
}
repo.result = []model.Folder{}
folder, upd, err := loadArtistFolder(ctx, fds, albums, paths)
Expect(err).ToNot(HaveOccurred())
Expect(folder).To(BeEmpty())
Expect(upd).To(BeZero())
})
})
})
var _ = Describe("fromArtistFolder", func() {