feat(subsonic): fetch artist images from lastfm opengraph

closes #295

Co-authored-by: cacko <alex@cacko.net>
This commit is contained in:
sentriz
2023-02-20 22:01:30 +00:00
parent aecee3d2d8
commit 475749534f
5 changed files with 94 additions and 61 deletions

View File

@@ -338,6 +338,12 @@ func (c *Controller) ServeGetArtistInfoTwo(r *http.Request) *spec.Response {
sub.ArtistInfoTwo.LargeImageURL = image.Text
}
}
if url, _ := lastfm.StealArtistImage(info.URL); url != "" {
sub.ArtistInfoTwo.SmallImageURL = url
sub.ArtistInfoTwo.MediumImageURL = url
sub.ArtistInfoTwo.LargeImageURL = url
sub.ArtistInfoTwo.ArtistImageURL = url
}
}
count := params.GetOrInt("count", 20)

View File

@@ -284,6 +284,7 @@ type ArtistInfo struct {
SmallImageURL string `xml:"smallImageUrl" json:"smallImageUrl"`
MediumImageURL string `xml:"mediumImageUrl" json:"mediumImageUrl"`
LargeImageURL string `xml:"largeImageUrl" json:"largeImageUrl"`
ArtistImageURL string `xml:"artistImageUrl" json:"artistImageUrl"` // not sure where this comes from but other clients seem to expect it
SimilarArtist []*SimilarArtist `xml:"similarArtist,omitempty" json:"similarArtist,omitempty"`
}