diff --git a/core/agents/agents.go b/core/agents/agents.go index f31fbd94..23068844 100644 --- a/core/agents/agents.go +++ b/core/agents/agents.go @@ -5,10 +5,10 @@ import ( "strings" "time" - "github.com/navidrome/navidrome/model" - "github.com/navidrome/navidrome/conf" + "github.com/navidrome/navidrome/consts" "github.com/navidrome/navidrome/log" + "github.com/navidrome/navidrome/model" "github.com/navidrome/navidrome/utils" ) @@ -42,6 +42,9 @@ func (a *Agents) AgentName() string { } func (a *Agents) GetArtistMBID(ctx context.Context, id string, name string) (string, error) { + if id == consts.UnknownArtistID { + return "", ErrNotFound + } start := time.Now() for _, ag := range a.agents { if utils.IsCtxDone(ctx) { @@ -61,6 +64,9 @@ func (a *Agents) GetArtistMBID(ctx context.Context, id string, name string) (str } func (a *Agents) GetArtistURL(ctx context.Context, id, name, mbid string) (string, error) { + if id == consts.UnknownArtistID { + return "", ErrNotFound + } start := time.Now() for _, ag := range a.agents { if utils.IsCtxDone(ctx) { @@ -80,6 +86,9 @@ func (a *Agents) GetArtistURL(ctx context.Context, id, name, mbid string) (strin } func (a *Agents) GetArtistBiography(ctx context.Context, id, name, mbid string) (string, error) { + if id == consts.UnknownArtistID { + return "", ErrNotFound + } start := time.Now() for _, ag := range a.agents { if utils.IsCtxDone(ctx) { @@ -99,6 +108,9 @@ func (a *Agents) GetArtistBiography(ctx context.Context, id, name, mbid string) } func (a *Agents) GetSimilarArtists(ctx context.Context, id, name, mbid string, limit int) ([]Artist, error) { + if id == consts.UnknownArtistID { + return nil, ErrNotFound + } start := time.Now() for _, ag := range a.agents { if utils.IsCtxDone(ctx) { @@ -122,6 +134,9 @@ func (a *Agents) GetSimilarArtists(ctx context.Context, id, name, mbid string, l } func (a *Agents) GetArtistImages(ctx context.Context, id, name, mbid string) ([]ExternalImage, error) { + if id == consts.UnknownArtistID { + return nil, ErrNotFound + } start := time.Now() for _, ag := range a.agents { if utils.IsCtxDone(ctx) { @@ -141,6 +156,9 @@ func (a *Agents) GetArtistImages(ctx context.Context, id, name, mbid string) ([] } func (a *Agents) GetArtistTopSongs(ctx context.Context, id, artistName, mbid string, count int) ([]Song, error) { + if id == consts.UnknownArtistID { + return nil, ErrNotFound + } start := time.Now() for _, ag := range a.agents { if utils.IsCtxDone(ctx) {