fix(server): remove misleading "Agent not available" warning.

Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
Deluan
2025-03-05 14:11:44 -08:00
parent dc4e091622
commit a04167672c
8 changed files with 97 additions and 35 deletions
+4 -3
View File
@@ -27,6 +27,9 @@ type spotifyAgent struct {
}
func spotifyConstructor(ds model.DataStore) agents.Interface {
if conf.Server.Spotify.ID == "" || conf.Server.Spotify.Secret == "" {
return nil
}
l := &spotifyAgent{
ds: ds,
id: conf.Server.Spotify.ID,
@@ -88,8 +91,6 @@ func (s *spotifyAgent) searchArtist(ctx context.Context, name string) (*Artist,
func init() {
conf.AddHook(func() {
if conf.Server.Spotify.ID != "" && conf.Server.Spotify.Secret != "" {
agents.Register(spotifyAgentName, spotifyConstructor)
}
agents.Register(spotifyAgentName, spotifyConstructor)
})
}