From cba0cfe5690c782347a3e33ad7df25dd2d594227 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrik=20Wallstr=C3=B6m?= Date: Sun, 15 Mar 2026 02:49:52 +0100 Subject: [PATCH] Return empty ArtistInfo for folder IDs to avoid client errors (from i.e. DSub) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrik Wallström --- server/subsonic/browsing.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/server/subsonic/browsing.go b/server/subsonic/browsing.go index 48bc51ef1..a03baba57 100644 --- a/server/subsonic/browsing.go +++ b/server/subsonic/browsing.go @@ -387,6 +387,15 @@ func (api *Router) getArtistInfo(r *http.Request) (*responses.ArtistInfoBase, *m includeNotPresent := p.BoolOr("includeNotPresent", false) artist, err := api.provider.UpdateArtistInfo(ctx, id, count, includeNotPresent) + if errors.Is(err, model.ErrNotFound) { + // The ID may be a folder ID (e.g. from a folder-browsing client like DSub + // that calls getArtistInfo on any directory ID). Return empty info rather + // than an error so the client degrades gracefully. + if _, folderErr := api.ds.Folder(ctx).Get(id); folderErr == nil { + empty := model.Artists{} + return &responses.ArtistInfoBase{}, &empty, nil + } + } if err != nil { return nil, nil, err }