navidrome/core/agents
Deluan 5a06ee435f fix(agents): keep unknown-agent warning at Debug until plugins finish loading
The server and the plugin manager start in parallel, so an agent call landing
in the first seconds can see an empty plugin list and warn that a correctly
configured plugin is unknown - a false alarm made user-visible by the Debug to
Warn promotion. Worse, that early result could be cached under a key that never
changes when no plugins are installed, permanently suppressing a legitimate
typo warning.

The plugin manager now reports when its initial load has completed
(PluginsLoaded, set when Start returns). Until then the agent resolution skips
the cache and logs unknown names at Debug; once loading is done it caches and
warns as before. Found by adversarial review of this branch.
2026-08-08 22:36:07 -04:00
..
agents.go fix(agents): keep unknown-agent warning at Debug until plugins finish loading 2026-08-08 22:36:07 -04:00
agents_plugin_test.go fix(agents): keep unknown-agent warning at Debug until plugins finish loading 2026-08-08 22:36:07 -04:00
agents_suite_test.go Rename log.LevelCritical to log.LevelFatal 2022-12-21 14:53:36 -05:00
agents_test.go fix(agents): keep unknown-agent warning at Debug until plugins finish loading 2026-08-08 22:36:07 -04:00
interfaces.go feat(listenbrainz): match collaboration top-songs via all credited artist MBIDs (#5670) 2026-06-26 17:06:14 -04:00
interfaces_test.go feat(listenbrainz): match collaboration top-songs via all credited artist MBIDs (#5670) 2026-06-26 17:06:14 -04:00
local_agent.go Get album info (when available) from Last.fm, add getAlbumInfo endpoint (#2061) 2023-01-17 20:22:54 -05:00
README.md remove built-in Spotify integration (#5197) 2026-03-15 13:18:54 -04:00
session_keys.go Listenbrainz scrobbling (#1424) 2021-10-30 12:17:42 -04:00
session_keys_test.go Upgrade Ginkgo to V2 2022-07-26 16:53:17 -04:00

This folder abstracts metadata lookup into "agents". Each agent can be implemented to get as much info as the external source provides, by using a granular set of interfaces (see interfaces).

A new agent must comply with these simple implementation rules:

  1. Implement the AgentName() method. It just returns the name of the agent for logging purposes.
  2. Implement one or more of the *Retriever() interfaces. That's where the agent's logic resides.
  3. Register itself (in its init() function).

For an agent to be used it needs to be listed in the Agents config option (default is "deezer,lastfm"). The order dictates the priority of the agents

For a simple Agent example, look at the local_agent agent source code.