fix: improve subsonic image searching (#164)

This commit is contained in:
Gabe Farrell 2026-01-21 14:54:52 -05:00 committed by GitHub
parent 1a8099e902
commit 56ac73d12b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 53 additions and 12 deletions

View file

@ -31,6 +31,7 @@ var imgsrc ImageSource
type ArtistImageOpts struct {
Aliases []string
MBID *uuid.UUID
}
type AlbumImageOpts struct {
@ -66,7 +67,7 @@ func Shutdown() {
func GetArtistImage(ctx context.Context, opts ArtistImageOpts) (string, error) {
l := logger.FromContext(ctx)
if imgsrc.subsonicEnabled {
img, err := imgsrc.subsonicC.GetArtistImage(ctx, opts.Aliases[0])
img, err := imgsrc.subsonicC.GetArtistImage(ctx, opts.MBID, opts.Aliases[0])
if err != nil {
l.Debug().Err(err).Msg("GetArtistImage: Could not find artist image from Subsonic")
} else if img != "" {
@ -92,7 +93,7 @@ func GetArtistImage(ctx context.Context, opts ArtistImageOpts) (string, error) {
func GetAlbumImage(ctx context.Context, opts AlbumImageOpts) (string, error) {
l := logger.FromContext(ctx)
if imgsrc.subsonicEnabled {
img, err := imgsrc.subsonicC.GetAlbumImage(ctx, opts.Artists[0], opts.Album)
img, err := imgsrc.subsonicC.GetAlbumImage(ctx, opts.ReleaseMbzID, opts.Artists[0], opts.Album)
if err != nil {
l.Debug().Err(err).Msg("GetAlbumImage: Could not find artist image from Subsonic")
}