fix(lastfm): don't replace cached artist image with empty on refresh
last.fm intermittently omits the og:image meta tag from artist pages. previously this would overwrite a good cached image URL with empty, leaving artists without artwork until the next cache cycle
This commit is contained in:
No files matched your search
@@ -80,8 +80,9 @@ func (a *ArtistInfoCache) Lookup(ctx context.Context, artist *db.Artist) (*db.Ar
|
||||
}
|
||||
artistInfo.SetSimilarArtists(similar)
|
||||
|
||||
url, _ := a.lastfmClient.StealArtistImage(info.URL)
|
||||
artistInfo.ImageURL = url
|
||||
if url, _ := a.lastfmClient.StealArtistImage(info.URL); url != "" {
|
||||
artistInfo.ImageURL = url
|
||||
}
|
||||
|
||||
topTracksResponse, err := a.lastfmClient.ArtistGetTopTracks(artist.Name)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user