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
@@ -203,6 +203,9 @@ func (c *Client) StealArtistImage(artistURL string) (string, error) {
|
||||
return "", fmt.Errorf("get artist url: %w", err)
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
if resp.StatusCode/100 != 2 {
|
||||
return "", fmt.Errorf("get artist url: %s", resp.Status)
|
||||
}
|
||||
|
||||
node, err := html.Parse(resp.Body)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user