fix: use CoverArtID if available and LastFM image url otherwise
This commit is contained in:
@@ -459,10 +459,12 @@ func (a *ArtistPageHeader) Update(artist *mediaprovider.ArtistWithAlbums, im *ba
|
|||||||
a.favoriteBtn.IsFavorited = artist.Favorite
|
a.favoriteBtn.IsFavorited = artist.Favorite
|
||||||
a.favoriteBtn.Refresh()
|
a.favoriteBtn.Refresh()
|
||||||
a.artistID = artist.ID
|
a.artistID = artist.ID
|
||||||
a.artistImageID = artist.CoverArtID
|
|
||||||
a.titleDisp.Segments[0].(*widget.TextSegment).Text = artist.Name
|
a.titleDisp.Segments[0].(*widget.TextSegment).Text = artist.Name
|
||||||
a.titleDisp.Refresh()
|
a.titleDisp.Refresh()
|
||||||
|
if artist.CoverArtID == "" {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
a.artistImageID = artist.CoverArtID
|
||||||
go func() {
|
go func() {
|
||||||
if cover, err := im.GetCoverThumbnail(artist.CoverArtID); err == nil {
|
if cover, err := im.GetCoverThumbnail(artist.CoverArtID); err == nil {
|
||||||
a.artistImage.SetImage(cover, true)
|
a.artistImage.SetImage(cover, true)
|
||||||
@@ -520,6 +522,11 @@ func (a *ArtistPageHeader) UpdateInfo(info *mediaprovider.ArtistInfo) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (a *ArtistPageHeader) showPopUpCover() {
|
func (a *ArtistPageHeader) showPopUpCover() {
|
||||||
|
if a.artistImageID == "" {
|
||||||
|
if im := a.artistImage.Image(); im != nil {
|
||||||
|
a.artistPage.contr.ShowPopUpImage(im)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
if a.fullSizeCoverFetching {
|
if a.fullSizeCoverFetching {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -533,6 +540,7 @@ func (a *ArtistPageHeader) showPopUpCover() {
|
|||||||
if a.artistPage != nil {
|
if a.artistPage != nil {
|
||||||
a.artistPage.contr.ShowPopUpImage(cover)
|
a.artistPage.contr.ShowPopUpImage(cover)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *ArtistPageHeader) toggleFavorited() {
|
func (a *ArtistPageHeader) toggleFavorited() {
|
||||||
|
|||||||
Reference in New Issue
Block a user