feat(subsonic): fetch artist images from lastfm opengraph
closes #295 Co-authored-by: cacko <alex@cacko.net>
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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"`
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user