mirror of
https://github.com/gabehf/Koito.git
synced 2026-04-22 12:01:52 -07:00
Fix artist images: filter Last.fm placeholder, reorder providers, fix alias bug
Three bugs causing all artist images to be the same Last.fm placeholder: 1. Last.fm stopped serving real artist images years ago and returns a generic placeholder (hash 2a96cbd8b46e442fc41c2b86b821562f) for every artist. Added filter in selectBestImage to reject URLs containing this known placeholder hash. 2. Provider order had Last.fm before Deezer for artist images. Since Last.fm "succeeded" with the placeholder, Deezer was never reached. Swapped order: Deezer now checked before Last.fm. 3. FetchMissingArtistImages had inverted if/else — aliases were used on error, bare name on success. Fixed condition to err == nil.
This commit is contained in:
parent
26aa3eca1f
commit
07179b648e
3 changed files with 16 additions and 13 deletions
|
|
@ -83,6 +83,16 @@ func GetArtistImage(ctx context.Context, opts ArtistImageOpts) (string, error) {
|
|||
} else {
|
||||
l.Debug().Msg("GetArtistImage: Subsonic image fetching is disabled")
|
||||
}
|
||||
if imgsrc.deezerEnabled {
|
||||
img, err := imgsrc.deezerC.GetArtistImages(ctx, opts.Aliases)
|
||||
if err != nil {
|
||||
l.Debug().Err(err).Msg("GetArtistImage: Could not find artist image from Deezer")
|
||||
} else if img != "" {
|
||||
return img, nil
|
||||
}
|
||||
} else {
|
||||
l.Debug().Msg("GetArtistImage: Deezer image fetching is disabled")
|
||||
}
|
||||
if imgsrc.lastfmEnabled {
|
||||
img, err := imgsrc.lastfmC.GetArtistImage(ctx, opts.MBID, opts.Aliases[0])
|
||||
if err != nil {
|
||||
|
|
@ -93,17 +103,6 @@ func GetArtistImage(ctx context.Context, opts ArtistImageOpts) (string, error) {
|
|||
} else {
|
||||
l.Debug().Msg("GetArtistImage: LastFM image fetching is disabled")
|
||||
}
|
||||
if imgsrc.deezerEnabled {
|
||||
img, err := imgsrc.deezerC.GetArtistImages(ctx, opts.Aliases)
|
||||
if err != nil {
|
||||
l.Debug().Err(err).Msg("GetArtistImage: Could not find artist image from Deezer")
|
||||
return "", err
|
||||
} else if img != "" {
|
||||
return img, nil
|
||||
}
|
||||
} else {
|
||||
l.Debug().Msg("GetArtistImage: Deezer image fetching is disabled")
|
||||
}
|
||||
l.Warn().Msg("GetArtistImage: No image providers are enabled")
|
||||
return "", nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue