fix: use the ID3 getArtistInfo2 endpoint for artist info - #2309
Conversation
Album artists are loaded through the ID3 endpoints, but artist info was requested through the non-ID3 getArtistInfo. The two endpoints resolve the id parameter in different id namespaces, which overlap numerically, so servers that separate the namespaces returned the biography and similar artists of an unrelated item that happened to share the numeric id. Switch both the Subsonic and the Navidrome controller to getArtistInfo2 and type the response with a new artistInfo2 schema matching what servers actually return.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
kgarner7
left a comment
There was a problem hiding this comment.
No. This is an incorrect change.
getArtistInfo is specifically used because the spec notes that it fetches data from last.fm (or other providers). Just replacing this with getArtistInfo2 is not the right call. You could provide a toggle (although for Navidrome, there's no difference), but this alone is incorrect.
|
@kgarner7 Could you point me at the part of the spec you have in mind? Reading the OpenSubsonic docs, both endpoints are last.fm-backed and were introduced in the same version:
The What makes this a bug rather than a preference is the id. So, concretely: which scenario do you have in mind where If the concern is instead servers that implement |
Closes #2308
Problem
On the album artist detail page the "About" section and the "Related Artists" list belong to a completely different artist than the one the page is opened for. Albums, top songs and external links on the same page are correct.
Cause
Album artists are loaded through the ID3 endpoints (
getArtists.view/getArtist.view), but artist info was requested through the non-ID3getArtistInfo.view. The two endpoints resolve theidparameter in two different id namespaces, and the namespaces overlap numerically, so the id is valid in both and no error is raised.Airsonic-Advanced resolves the id against
media_fileingetArtistInfo:https://github.com/airsonic-advanced/airsonic-advanced/blob/68d11bfbfe051b0acaca2770c3c1f47f8d59201c/airsonic-main/src/main/java/org/airsonic/player/controller/SubsonicRESTController.java#L434-L440
and against the
artisttable ingetArtistInfo2:https://github.com/airsonic-advanced/airsonic-advanced/blob/68d11bfbfe051b0acaca2770c3c1f47f8d59201c/airsonic-main/src/main/java/org/airsonic/player/controller/SubsonicRESTController.java#L470-L476
Fix
getAlbumArtistInfonow callsgetArtistInfo2.viewin both the Subsonic and the Navidrome controller, and the response is typed by a newartistInfo2schema.getArtistInforeturns an empty response thereOverviewOnly the Airsonic-Advanced row was verified on a running server. The other rows are inferred from the server sources, and I would appreciate a check by someone who runs those servers.
Screenshots (Airsonic-Advanced)
Before
After
Notes for review
getArtistInfois kept on purpose. That endpoint does not fail on an ID3 id, it returns a plausible-looking biography of the wrong artist, so a fallback would silently reintroduce the bug instead of guarding against it.getArtistInfo2requires Subsonic API 1.11.0. The client already advertisesv=1.13.0, so no version bump is needed.albumCountarrives as a number from Airsonic although the previous schema declared it a string,coverArtis missing on some entries, and gonic omitssimilarArtistentirely when the list is empty. These schemas are compile-time types only — the ts-rest client returns the raw body without parsing — so the mismatch surfaced as inaccurate types rather than a runtime error.String(artist.id)is needed because the sharedidschema isnumber | stringwhileRelatedArtist.idisstring.Testing
Tested on Airsonic-Advanced (REST API 1.15.0) only — that is the one server I have:
getArtistInfoand the correct artist fromgetArtistInfo2;pnpm typecheckandeslint src/are clean.Not tested on Navidrome, gonic, LMS, Ampache or Jellyfin.