navidrome/core/agents
Deluan Quintão 89b12b34be
Retry calls to Last.FM without MBIDs when if returns artist invalid (#1138)
* Call Last.FM's getInfo again without mbid when artist is not found

* Call Last.FM's getSimilar again without mbid when artist is not found

* Call Last.FM's getTopTracks again without mbid when artist is not found
2021-05-27 20:53:24 -04:00
..
README.md Add some info about how to create new agents 2021-02-08 17:18:43 -05:00
agents_suite_test.go Add a cached http client 2021-02-08 16:54:51 -05:00
cached_http_client.go Cleanup, add Placeholder agent 2021-02-08 16:54:51 -05:00
cached_http_client_test.go Fix lint errors 2021-02-08 16:54:51 -05:00
interfaces.go Add artist ID to agent's interfaces 2021-02-09 11:19:32 -05:00
lastfm.go Retry calls to Last.FM without MBIDs when if returns artist invalid (#1138) 2021-05-27 20:53:24 -04:00
lastfm_test.go Retry calls to Last.FM without MBIDs when if returns artist invalid (#1138) 2021-05-27 20:53:24 -04:00
placeholders.go Add artist ID to agent's interfaces 2021-02-09 11:19:32 -05:00
spotify.go Include a shared Last.FM api key, providing zero conf ArtistInfo (bio/top songs/similar artists) 2021-05-27 16:14:24 -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 placeholders.go agent source code.