🏡 index : quine-global/quintodrome.git

// Code generated by ndpgen. DO NOT EDIT.
//
// This file provides stub implementations for non-WASM platforms.
// It allows Go plugins to compile and run tests outside of WASM,
// but the actual functionality is only available in WASM builds.
//
//go:build !wasip1

package metadata

import "github.com/navidrome/navidrome/plugins/pdk/go/types"

// Deprecated: use types.ArtistRef.
type ArtistRef = types.ArtistRef

// Deprecated: use types.SongRef.
type SongRef = types.SongRef

// MetadataAgentError represents an error type for metadata agent operations.
type MetadataAgentError string

const (
	// MetadataAgentErrorRetryLater indicates the provider is throttling; retry later.
	// Append ":<seconds>" inside the parentheses to request a specific delay.
	MetadataAgentErrorRetryLater MetadataAgentError = "agent(retry_later)"
)

// Error implements the error interface for MetadataAgentError.
func (e MetadataAgentError) Error() string { return string(e) }

// AlbumImagesResponse is the response for GetAlbumImages.
type AlbumImagesResponse struct {
	// Images is the list of album images.
	Images []ImageInfo `json:"images"`
}

// AlbumInfoResponse is the response for GetAlbumInfo.
type AlbumInfoResponse struct {
	// Name is the album name.
	Name string `json:"name"`
	// MBID is the MusicBrainz ID for the album.
	MBID string `json:"mbid"`
	// Description is the album description/notes.
	Description string `json:"description"`
	// URL is the external URL for the album.
	URL string `json:"url"`
}

// AlbumRequest is the common request for album-related functions.
type AlbumRequest struct {
	// Name is the album name.
	Name string `json:"name"`
	// Artist is the album artist name.
	Artist string `json:"artist"`
	// MBID is the MusicBrainz ID for the album (if known).
	MBID string `json:"mbid,omitempty"`
}

// ArtistBiographyResponse is the response for GetArtistBiography.
type ArtistBiographyResponse struct {
	// Biography is the artist biography text.
	Biography string `json:"biography"`
}

// ArtistImagesResponse is the response for GetArtistImages.
type ArtistImagesResponse struct {
	// Images is the list of artist images.
	Images []ImageInfo `json:"images"`
}

// ArtistMBIDRequest is the request for GetArtistMBID.
type ArtistMBIDRequest struct {
	// ID is the internal Navidrome artist ID.
	ID string `json:"id"`
	// Name is the artist name.
	Name string `json:"name"`
}

// ArtistMBIDResponse is the response for GetArtistMBID.
type ArtistMBIDResponse struct {
	// MBID is the MusicBrainz ID for the artist.
	MBID string `json:"mbid"`
}

// ArtistRequest is the common request for artist-related functions.
type ArtistRequest struct {
	// ID is the internal Navidrome artist ID.
	ID string `json:"id"`
	// Name is the artist name.
	Name string `json:"name"`
	// MBID is the MusicBrainz ID for the artist (if known).
	MBID string `json:"mbid,omitempty"`
}

// ArtistURLResponse is the response for GetArtistURL.
type ArtistURLResponse struct {
	// URL is the external URL for the artist.
	URL string `json:"url"`
}

// ImageInfo represents an image with URL and size.
type ImageInfo struct {
	// URL is the URL of the image.
	URL string `json:"url"`
	// Size is the size of the image in pixels (width or height).
	Size int32 `json:"size"`
}

// SimilarArtistsRequest is the request for GetSimilarArtists.
type SimilarArtistsRequest struct {
	// ID is the internal Navidrome artist ID.
	ID string `json:"id"`
	// Name is the artist name.
	Name string `json:"name"`
	// MBID is the MusicBrainz ID for the artist (if known).
	MBID string `json:"mbid,omitempty"`
	// Limit is the maximum number of similar artists to return.
	Limit int32 `json:"limit"`
}

// SimilarArtistsResponse is the response for GetSimilarArtists.
type SimilarArtistsResponse struct {
	// Artists is the list of similar artists.
	Artists []types.ArtistRef `json:"artists"`
}

// SimilarSongsByAlbumRequest is the request for GetSimilarSongsByAlbum.
type SimilarSongsByAlbumRequest struct {
	// ID is the internal Navidrome album ID.
	ID string `json:"id"`
	// Name is the album name.
	Name string `json:"name"`
	// Artist is the album artist name.
	Artist string `json:"artist"`
	// MBID is the MusicBrainz release ID (if known).
	MBID string `json:"mbid,omitempty"`
	// Count is the maximum number of similar songs to return.
	Count int32 `json:"count"`
}

// SimilarSongsByArtistRequest is the request for GetSimilarSongsByArtist.
type SimilarSongsByArtistRequest struct {
	// ID is the internal Navidrome artist ID.
	ID string `json:"id"`
	// Name is the artist name.
	Name string `json:"name"`
	// MBID is the MusicBrainz artist ID (if known).
	MBID string `json:"mbid,omitempty"`
	// Count is the maximum number of similar songs to return.
	Count int32 `json:"count"`
}

// SimilarSongsByTrackRequest is the request for GetSimilarSongsByTrack.
type SimilarSongsByTrackRequest struct {
	// ID is the internal Navidrome mediafile ID.
	ID string `json:"id"`
	// Name is the track title.
	Name string `json:"name"`
	// Artist is the artist name.
	Artist string `json:"artist"`
	// MBID is the MusicBrainz recording ID (if known).
	MBID string `json:"mbid,omitempty"`
	// Count is the maximum number of similar songs to return.
	Count int32 `json:"count"`
}

// SimilarSongsResponse is the response for GetSimilarSongsBy* functions.
type SimilarSongsResponse struct {
	// Songs is the list of similar songs.
	Songs []types.SongRef `json:"songs"`
}

// TopSongsRequest is the request for GetArtistTopSongs.
type TopSongsRequest struct {
	// ID is the internal Navidrome artist ID.
	ID string `json:"id"`
	// Name is the artist name.
	Name string `json:"name"`
	// MBID is the MusicBrainz ID for the artist (if known).
	MBID string `json:"mbid,omitempty"`
	// Count is the maximum number of top songs to return.
	Count int32 `json:"count"`
}

// TopSongsResponse is the response for GetArtistTopSongs.
type TopSongsResponse struct {
	// Songs is the list of top songs.
	Songs []types.SongRef `json:"songs"`
}

// Metadata is the marker interface for metadata plugins.
// Implement one or more of the provider interfaces below.
// MetadataAgent provides artist and album metadata retrieval.
// This capability allows plugins to provide external metadata for artists and albums,
// such as biographies, images, similar artists, and top songs.
//
// 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.
type ArtistMBIDProvider interface {
	GetArtistMBID(ArtistMBIDRequest) (*ArtistMBIDResponse, error)
}

// ArtistURLProvider provides the GetArtistURL function.
type ArtistURLProvider interface {
	GetArtistURL(ArtistRequest) (*ArtistURLResponse, error)
}

// ArtistBiographyProvider provides the GetArtistBiography function.
type ArtistBiographyProvider interface {
	GetArtistBiography(ArtistRequest) (*ArtistBiographyResponse, error)
}

// SimilarArtistsProvider provides the GetSimilarArtists function.
type SimilarArtistsProvider interface {
	GetSimilarArtists(SimilarArtistsRequest) (*SimilarArtistsResponse, error)
}

// ArtistImagesProvider provides the GetArtistImages function.
type ArtistImagesProvider interface {
	GetArtistImages(ArtistRequest) (*ArtistImagesResponse, error)
}

// ArtistTopSongsProvider provides the GetArtistTopSongs function.
type ArtistTopSongsProvider interface {
	GetArtistTopSongs(TopSongsRequest) (*TopSongsResponse, error)
}

// AlbumInfoProvider provides the GetAlbumInfo function.
type AlbumInfoProvider interface {
	GetAlbumInfo(AlbumRequest) (*AlbumInfoResponse, error)
}

// AlbumImagesProvider provides the GetAlbumImages function.
type AlbumImagesProvider interface {
	GetAlbumImages(AlbumRequest) (*AlbumImagesResponse, error)
}

// SimilarSongsByTrackProvider provides the GetSimilarSongsByTrack function.
type SimilarSongsByTrackProvider interface {
	GetSimilarSongsByTrack(SimilarSongsByTrackRequest) (*SimilarSongsResponse, error)
}

// SimilarSongsByAlbumProvider provides the GetSimilarSongsByAlbum function.
type SimilarSongsByAlbumProvider interface {
	GetSimilarSongsByAlbum(SimilarSongsByAlbumRequest) (*SimilarSongsResponse, error)
}

// SimilarSongsByArtistProvider provides the GetSimilarSongsByArtist function.
type SimilarSongsByArtistProvider interface {
	GetSimilarSongsByArtist(SimilarSongsByArtistRequest) (*SimilarSongsResponse, error)
}

// NotImplementedCode is the standard return code for unimplemented functions.
const NotImplementedCode int32 = -2

// Register is a no-op on non-WASM platforms.
// This stub allows code to compile outside of WASM.
func Register(_ Metadata) {}