mirror of
https://github.com/navidrome/navidrome.git
synced 2026-10-18 07:30:29 +00:00
Merge branch 'master' into songs-under-30s-dont-scrobble-on-lastfm/5986
This commit is contained in:
commit
175e23bea7
@ -174,6 +174,14 @@ Capabilities define what your plugin can do. They're automatically detected base
|
||||
|
||||
Provides artist and album metadata. All methods are **optional** — implement only the ones your data source supports.
|
||||
|
||||
> **Returning "not found".** When you have no data for an item, return an empty response and no
|
||||
> error. In the Go PDK that is `return nil, nil`. Navidrome reads it as a definitive "not found"
|
||||
> and stops asking.
|
||||
>
|
||||
> Return an error only when the plugin itself failed, such as an unreachable API or a broken host
|
||||
> call. Navidrome retries failed calls with backoff. A plugin that errors on "no data" makes
|
||||
> Navidrome retry every item it has no data for.
|
||||
|
||||
| Function | Input | Output | Description |
|
||||
|-----------------------------------|----------------------------|----------------------------------|--------------------------|
|
||||
| `nd_get_artist_mbid` | `{id, name}` | `{mbid}` | Get MusicBrainz ID |
|
||||
|
||||
@ -9,6 +9,9 @@ import "github.com/navidrome/navidrome/plugins/types"
|
||||
// Plugins implementing this capability can choose which methods to implement.
|
||||
// Each method is optional - plugins only need to provide the functionality they support.
|
||||
//
|
||||
// To say "no data for this item", return a nil response and a nil error. Return an error only when
|
||||
// the plugin itself failed, because Navidrome retries failed calls with backoff.
|
||||
//
|
||||
//nd:capability name=metadata
|
||||
type MetadataAgent interface {
|
||||
// GetArtistMBID retrieves the MusicBrainz ID for an artist.
|
||||
|
||||
@ -186,6 +186,9 @@ type TopSongsResponse struct {
|
||||
//
|
||||
// Plugins implementing this capability can choose which methods to implement.
|
||||
// Each method is optional - plugins only need to provide the functionality they support.
|
||||
//
|
||||
// To say "no data for this item", return a nil response and a nil error. Return an error only when
|
||||
// the plugin itself failed, because Navidrome retries failed calls with backoff.
|
||||
type Metadata interface{}
|
||||
|
||||
// ArtistMBIDProvider provides the GetArtistMBID function.
|
||||
|
||||
@ -184,6 +184,9 @@ type TopSongsResponse struct {
|
||||
//
|
||||
// Plugins implementing this capability can choose which methods to implement.
|
||||
// Each method is optional - plugins only need to provide the functionality they support.
|
||||
//
|
||||
// To say "no data for this item", return a nil response and a nil error. Return an error only when
|
||||
// the plugin itself failed, because Navidrome retries failed calls with backoff.
|
||||
type Metadata interface{}
|
||||
|
||||
// ArtistMBIDProvider provides the GetArtistMBID function.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user