Album search results from Navidrome were not being added to the album column #45
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
c.f. https://github.com/spezifisch/stmps/pull/40\#issuecomment-2361716375
The Subsonic API definition is sufficiently vague as to leave some implementation details to the servers, and Gonic and Navidrome implement search3 results slightly differently. What was causing the Navidrome issue is that Gonic includes the album name under both a
Album
andName
attributes, whereas Navidrome only provides theName
attribute. My code was, of course, matching on the (for Navidrome) emptyAlbum
attribute. Since Gonic provides both attributes, this patch compares theName
attribute in all instances.This patch includes a couple of other related changes:
First, since
search3
was introduced in the Subsonic API version1.8.0
, and Subsonic API servers require this version (although I expect most ignore it), I updated theSubsonicConnection.clientVersion
from 1.0.0 to 1.8.0.Second, the responses that include an artist always include an
artistId
attribute. Previously, the search code was comparing theartistName
, not theartistId
. We can debate which is more correct: it's conceivably possible for a server to have an artist under two different IDs, but matching by ID seems more correct, so this has been changed. I suspect more of this sort of change is scattered through the code, but I caught one place here.Completely unrelated,
SubsonicEntity
s often include a cover art ID, which was not captured. I have a vague itch to someday use something like timg to show the cover art, maybe as part of the #25 "song info" ticket. I was in the struct making changes, and I snuck this in.