From fbf7bfb80c8e772dc6b6fcc2f87d478af0ceed3f Mon Sep 17 00:00:00 2001 From: quepasaquepasa <293237286+quepasaquepasa@users.noreply.github.com> Date: Thu, 30 Jul 2026 23:11:02 -0400 Subject: [PATCH] Keep trying artist art sources when folder lookup fails --- core/artwork/reader_artist.go | 8 +++++++- core/artwork/reader_artist_test.go | 13 +++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/core/artwork/reader_artist.go b/core/artwork/reader_artist.go index fe5bcb196..52458b585 100644 --- a/core/artwork/reader_artist.go +++ b/core/artwork/reader_artist.go @@ -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 { diff --git a/core/artwork/reader_artist_test.go b/core/artwork/reader_artist_test.go index c75f8447e..ddaa945fe 100644 --- a/core/artwork/reader_artist_test.go +++ b/core/artwork/reader_artist_test.go @@ -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() {