feat(subsonic): return artist cover ids for similar artists response

This commit is contained in:
sentriz
2023-09-13 17:24:19 +01:00
parent 3553348877
commit c15349f796
2 changed files with 3 additions and 0 deletions

View File

@@ -367,11 +367,13 @@ func (c *Controller) ServeGetArtistInfoTwo(r *http.Request) *spec.Response {
} }
artistID := &specid.ID{} artistID := &specid.ID{}
if artist.ID != 0 { if artist.ID != 0 {
// we don't always have a match if `inclNotPresent`
artistID = artist.SID() artistID = artist.SID()
} }
sub.ArtistInfoTwo.SimilarArtist = append(sub.ArtistInfoTwo.SimilarArtist, &spec.SimilarArtist{ sub.ArtistInfoTwo.SimilarArtist = append(sub.ArtistInfoTwo.SimilarArtist, &spec.SimilarArtist{
ID: artistID, ID: artistID,
Name: similarInfo.Name, Name: similarInfo.Name,
CoverArt: artistID,
AlbumCount: artist.AlbumCount, AlbumCount: artist.AlbumCount,
}) })
} }

View File

@@ -287,6 +287,7 @@ type Playlist struct {
type SimilarArtist struct { type SimilarArtist struct {
ID *specid.ID `xml:"id,attr" json:"id"` ID *specid.ID `xml:"id,attr" json:"id"`
Name string `xml:"name,attr" json:"name"` Name string `xml:"name,attr" json:"name"`
CoverArt *specid.ID `xml:"coverArt,attr" json:"coverArt"`
AlbumCount int `xml:"albumCount,attr,omitempty" json:"albumCount,omitempty"` AlbumCount int `xml:"albumCount,attr,omitempty" json:"albumCount,omitempty"`
} }