navidrome/core/agents
Deluan ec68d69d56 Refactor cache.HTTPClient 2024-05-11 19:37:12 -04:00
..
lastfm Refactor cache.HTTPClient 2024-05-11 19:37:12 -04:00
listenbrainz Refactor cache.HTTPClient 2024-05-11 19:37:12 -04:00
spotify Refactor cache.HTTPClient 2024-05-11 19:37:12 -04:00
README.md Add local agent, only for images 2023-01-13 22:18:34 -05:00
agents.go Add log.IsGreaterOrEqualTo, that take into consideration path-scoped log levels 2023-12-25 16:35:16 -05:00
agents_suite_test.go Rename log.LevelCritical to log.LevelFatal 2022-12-21 14:53:36 -05:00
agents_test.go Don't retrieve Various Artists and Unknown Artist info from Last.fm 2023-02-04 21:18:51 -05:00
interfaces.go Make private methods unpublished 2023-01-19 09:34:39 -05:00
local_agent.go Get album info (when available) from Last.fm, add getAlbumInfo endpoint (#2061) 2023-01-17 20:22:54 -05: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

README.md

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 "lastfm,spotify"). The order dictates the priority of the agents

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