mirror of
https://github.com/navidrome/navidrome.git
synced 2026-10-08 10:27:08 +02:00
Mark secret values with log.WithSecrets on a separate line instead of nesting the call in argument lists. Also mark Last.fm/ListenBrainz session keys written through SessionKeys.Put and the PasswordEncryptionKey checksum, which still reached trace logs, and ignore values shorter than 8 characters so a short plaintext marked after a failed encryption cannot mangle SQL text or the [REDACTED] marker. |
||
|---|---|---|
| .. | ||
| agents.go | ||
| agents_plugin_test.go | ||
| agents_suite_test.go | ||
| agents_test.go | ||
| interfaces.go | ||
| interfaces_test.go | ||
| local_agent.go | ||
| local_agent_test.go | ||
| README.md | ||
| session_keys.go | ||
| session_keys_test.go | ||
| song_test.go | ||
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:
- Implement the
AgentName()method. It just returns the name of the agent for logging purposes. - Implement one or more of the
*Retriever()interfaces. That's where the agent's logic resides. - 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.