mirror of
https://github.com/gabehf/Koito.git
synced 2026-03-17 03:06:42 -07:00
feat: refetch missing images on startup (#160)
* artist image refetching * album image refetching * remove unused var
This commit is contained in:
parent
5e294b839c
commit
1a8099e902
15 changed files with 271 additions and 44 deletions
|
|
@ -129,9 +129,13 @@ func (c *SubsonicClient) GetArtistImage(ctx context.Context, artist string) (str
|
|||
if err != nil {
|
||||
return "", fmt.Errorf("GetArtistImage: %v", err)
|
||||
}
|
||||
l.Debug().Any("subsonic_response", resp).Send()
|
||||
l.Debug().Any("subsonic_response", resp).Msg("")
|
||||
if len(resp.SubsonicResponse.SearchResult3.Artist) < 1 || resp.SubsonicResponse.SearchResult3.Artist[0].ArtistImageUrl == "" {
|
||||
return "", fmt.Errorf("GetArtistImage: failed to get artist art")
|
||||
}
|
||||
// Subsonic seems to have a tendency to return an artist image even though the url is a 404
|
||||
if err = ValidateImageURL(resp.SubsonicResponse.SearchResult3.Artist[0].ArtistImageUrl); err != nil {
|
||||
return "", fmt.Errorf("GetArtistImage: failed to get validate image url")
|
||||
}
|
||||
return resp.SubsonicResponse.SearchResult3.Artist[0].ArtistImageUrl, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue