Better ArtistInfo field names
This commit is contained in:
@@ -121,10 +121,10 @@ func (e *externalInfo) callArtistImages(ctx context.Context, artist *model.Artis
|
|||||||
|
|
||||||
func (e *externalInfo) setBio(info *model.ArtistInfo, bio string) {
|
func (e *externalInfo) setBio(info *model.ArtistInfo, bio string) {
|
||||||
policy := bluemonday.UGCPolicy()
|
policy := bluemonday.UGCPolicy()
|
||||||
if info.Bio == "" {
|
if info.Biography == "" {
|
||||||
bio = policy.Sanitize(bio)
|
bio = policy.Sanitize(bio)
|
||||||
bio = strings.ReplaceAll(bio, "\n", " ")
|
bio = strings.ReplaceAll(bio, "\n", " ")
|
||||||
info.Bio = strings.ReplaceAll(bio, "<a ", "<a target='_blank' ")
|
info.Biography = strings.ReplaceAll(bio, "<a ", "<a target='_blank' ")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -134,9 +134,9 @@ func (e *externalInfo) setLastFMUrl(info *model.ArtistInfo, url string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *externalInfo) setMbzID(info *model.ArtistInfo, mbzID string) {
|
func (e *externalInfo) setMbzID(info *model.ArtistInfo, mbID string) {
|
||||||
if info.MbzID == "" {
|
if info.MBID == "" {
|
||||||
info.MbzID = mbzID
|
info.MBID = mbID
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ package model
|
|||||||
type ArtistInfo struct {
|
type ArtistInfo struct {
|
||||||
ID string
|
ID string
|
||||||
Name string
|
Name string
|
||||||
MbzID string
|
MBID string
|
||||||
Bio string
|
Biography string
|
||||||
Similar []Artist
|
Similar []Artist
|
||||||
SmallImageUrl string
|
SmallImageUrl string
|
||||||
MediumImageUrl string
|
MediumImageUrl string
|
||||||
|
|||||||
@@ -267,12 +267,12 @@ func (c *BrowsingController) GetArtistInfo(w http.ResponseWriter, r *http.Reques
|
|||||||
|
|
||||||
response := newResponse()
|
response := newResponse()
|
||||||
response.ArtistInfo = &responses.ArtistInfo{}
|
response.ArtistInfo = &responses.ArtistInfo{}
|
||||||
response.ArtistInfo.Biography = info.Bio
|
response.ArtistInfo.Biography = info.Biography
|
||||||
response.ArtistInfo.SmallImageUrl = info.SmallImageUrl
|
response.ArtistInfo.SmallImageUrl = info.SmallImageUrl
|
||||||
response.ArtistInfo.MediumImageUrl = info.MediumImageUrl
|
response.ArtistInfo.MediumImageUrl = info.MediumImageUrl
|
||||||
response.ArtistInfo.LargeImageUrl = info.LargeImageUrl
|
response.ArtistInfo.LargeImageUrl = info.LargeImageUrl
|
||||||
response.ArtistInfo.LastFmUrl = info.LastFMUrl
|
response.ArtistInfo.LastFmUrl = info.LastFMUrl
|
||||||
response.ArtistInfo.MusicBrainzID = info.MbzID
|
response.ArtistInfo.MusicBrainzID = info.MBID
|
||||||
for _, s := range info.Similar {
|
for _, s := range info.Similar {
|
||||||
similar := responses.Artist{}
|
similar := responses.Artist{}
|
||||||
similar.Id = s.ID
|
similar.Id = s.ID
|
||||||
|
|||||||
Reference in New Issue
Block a user