mirror of
https://github.com/navidrome/navidrome.git
synced 2026-08-01 07:21:17 +00:00
Keep trying artist art sources when folder lookup fails
This commit is contained in:
parent
600ea5482c
commit
fbf7bfb80c
@ -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 {
|
||||
|
||||
@ -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() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user