🎧 Your Personal Streaming Service
Go airsonicmadsonicmedia-servermusicmusic-servernavidromeopensubsonicraspberry-piself-hostedstreamerstreaming-apistreaming-audiosubsonicsubsonic-server
Add missing fields to ArtistInfo
Deluan07d96f83081d
diff --git a/core/external_info.go b/core/external_info.goindex ce4344240..af707f599 100644--- a/core/external_info.go+++ b/core/external_info.go@@ -83,6 +83,8 @@ func (e *externalInfo) callArtistInfo(ctx context.Context, artist *model.Artist,log.Debug(ctx, "Got info from Last.FM", "artist", artist.Name, "info", lfmArtist.Bio.Summary, "elapsed", time.Since(start))}e.setBio(info, lfmArtist.Bio.Summary)+ e.setLastFMUrl(info, lfmArtist.URL)+ e.setMbzID(info, lfmArtist.MBID)e.setSimilar(ctx, info, lfmArtist.Similar.Artists, includeNotPresent)}()}@@ -126,6 +128,18 @@ func (e *externalInfo) setBio(info *model.ArtistInfo, bio string) {}}+func (e *externalInfo) setLastFMUrl(info *model.ArtistInfo, url string) {+ if info.LastFMUrl == "" {+ info.LastFMUrl = url+ }+}++func (e *externalInfo) setMbzID(info *model.ArtistInfo, mbzID string) {+ if info.MbzID == "" {+ info.MbzID = mbzID+ }+}+func (e *externalInfo) setSmallImageUrl(info *model.ArtistInfo, url string) {if info.SmallImageUrl == "" {info.SmallImageUrl = urldiff --git a/model/artist_info.go b/model/artist_info.goindex 8fef888a5..fff2c2c39 100644--- a/model/artist_info.go+++ b/model/artist_info.go@@ -3,9 +3,11 @@ package modeltype ArtistInfo struct {ID stringName string+ MbzID stringBio stringSimilar []ArtistSmallImageUrl stringMediumImageUrl stringLargeImageUrl string+ LastFMUrl string}diff --git a/server/subsonic/browsing.go b/server/subsonic/browsing.goindex dea434c19..a0a5957bf 100644--- a/server/subsonic/browsing.go+++ b/server/subsonic/browsing.go@@ -271,6 +271,8 @@ func (c *BrowsingController) GetArtistInfo(w http.ResponseWriter, r *http.Requesresponse.ArtistInfo.SmallImageUrl = info.SmallImageUrlresponse.ArtistInfo.MediumImageUrl = info.MediumImageUrlresponse.ArtistInfo.LargeImageUrl = info.LargeImageUrl+ response.ArtistInfo.LastFmUrl = info.LastFMUrl+ response.ArtistInfo.MusicBrainzID = info.MbzIDfor _, s := range info.Similar {similar := responses.Artist{}similar.Id = s.ID