mirror of
https://github.com/navidrome/navidrome.git
synced 2026-04-03 06:41:01 +00:00
377 lines
8.2 KiB
Go
Executable File
377 lines
8.2 KiB
Go
Executable File
// THIS FILE WAS GENERATED BY `xtp-go-bindgen`. DO NOT EDIT.
|
|
package main
|
|
|
|
import (
|
|
pdk "github.com/extism/go-pdk"
|
|
)
|
|
|
|
//export nd_get_album_images
|
|
func _NdGetAlbumImages() int32 {
|
|
var err error
|
|
_ = err
|
|
pdk.Log(pdk.LogDebug, "NdGetAlbumImages: getting JSON input")
|
|
var input AlbumInput
|
|
err = pdk.InputJSON(&input)
|
|
if err != nil {
|
|
pdk.SetError(err)
|
|
return -1
|
|
}
|
|
|
|
pdk.Log(pdk.LogDebug, "NdGetAlbumImages: calling implementation function")
|
|
output, err := NdGetAlbumImages(input)
|
|
if err != nil {
|
|
pdk.SetError(err)
|
|
return -1
|
|
}
|
|
|
|
pdk.Log(pdk.LogDebug, "NdGetAlbumImages: setting JSON output")
|
|
err = pdk.OutputJSON(output)
|
|
if err != nil {
|
|
pdk.SetError(err)
|
|
return -1
|
|
}
|
|
|
|
pdk.Log(pdk.LogDebug, "NdGetAlbumImages: returning")
|
|
return 0
|
|
}
|
|
|
|
//export nd_get_album_info
|
|
func _NdGetAlbumInfo() int32 {
|
|
var err error
|
|
_ = err
|
|
pdk.Log(pdk.LogDebug, "NdGetAlbumInfo: getting JSON input")
|
|
var input AlbumInput
|
|
err = pdk.InputJSON(&input)
|
|
if err != nil {
|
|
pdk.SetError(err)
|
|
return -1
|
|
}
|
|
|
|
pdk.Log(pdk.LogDebug, "NdGetAlbumInfo: calling implementation function")
|
|
output, err := NdGetAlbumInfo(input)
|
|
if err != nil {
|
|
pdk.SetError(err)
|
|
return -1
|
|
}
|
|
|
|
pdk.Log(pdk.LogDebug, "NdGetAlbumInfo: setting JSON output")
|
|
err = pdk.OutputJSON(output)
|
|
if err != nil {
|
|
pdk.SetError(err)
|
|
return -1
|
|
}
|
|
|
|
pdk.Log(pdk.LogDebug, "NdGetAlbumInfo: returning")
|
|
return 0
|
|
}
|
|
|
|
//export nd_get_artist_biography
|
|
func _NdGetArtistBiography() int32 {
|
|
var err error
|
|
_ = err
|
|
pdk.Log(pdk.LogDebug, "NdGetArtistBiography: getting JSON input")
|
|
var input ArtistInput
|
|
err = pdk.InputJSON(&input)
|
|
if err != nil {
|
|
pdk.SetError(err)
|
|
return -1
|
|
}
|
|
|
|
pdk.Log(pdk.LogDebug, "NdGetArtistBiography: calling implementation function")
|
|
output, err := NdGetArtistBiography(input)
|
|
if err != nil {
|
|
pdk.SetError(err)
|
|
return -1
|
|
}
|
|
|
|
pdk.Log(pdk.LogDebug, "NdGetArtistBiography: setting JSON output")
|
|
err = pdk.OutputJSON(output)
|
|
if err != nil {
|
|
pdk.SetError(err)
|
|
return -1
|
|
}
|
|
|
|
pdk.Log(pdk.LogDebug, "NdGetArtistBiography: returning")
|
|
return 0
|
|
}
|
|
|
|
//export nd_get_artist_images
|
|
func _NdGetArtistImages() int32 {
|
|
var err error
|
|
_ = err
|
|
pdk.Log(pdk.LogDebug, "NdGetArtistImages: getting JSON input")
|
|
var input ArtistInput
|
|
err = pdk.InputJSON(&input)
|
|
if err != nil {
|
|
pdk.SetError(err)
|
|
return -1
|
|
}
|
|
|
|
pdk.Log(pdk.LogDebug, "NdGetArtistImages: calling implementation function")
|
|
output, err := NdGetArtistImages(input)
|
|
if err != nil {
|
|
pdk.SetError(err)
|
|
return -1
|
|
}
|
|
|
|
pdk.Log(pdk.LogDebug, "NdGetArtistImages: setting JSON output")
|
|
err = pdk.OutputJSON(output)
|
|
if err != nil {
|
|
pdk.SetError(err)
|
|
return -1
|
|
}
|
|
|
|
pdk.Log(pdk.LogDebug, "NdGetArtistImages: returning")
|
|
return 0
|
|
}
|
|
|
|
//export nd_get_artist_mbid
|
|
func _NdGetArtistMbid() int32 {
|
|
var err error
|
|
_ = err
|
|
pdk.Log(pdk.LogDebug, "NdGetArtistMbid: getting JSON input")
|
|
var input ArtistMBIDInput
|
|
err = pdk.InputJSON(&input)
|
|
if err != nil {
|
|
pdk.SetError(err)
|
|
return -1
|
|
}
|
|
|
|
pdk.Log(pdk.LogDebug, "NdGetArtistMbid: calling implementation function")
|
|
output, err := NdGetArtistMbid(input)
|
|
if err != nil {
|
|
pdk.SetError(err)
|
|
return -1
|
|
}
|
|
|
|
pdk.Log(pdk.LogDebug, "NdGetArtistMbid: setting JSON output")
|
|
err = pdk.OutputJSON(output)
|
|
if err != nil {
|
|
pdk.SetError(err)
|
|
return -1
|
|
}
|
|
|
|
pdk.Log(pdk.LogDebug, "NdGetArtistMbid: returning")
|
|
return 0
|
|
}
|
|
|
|
//export nd_get_artist_top_songs
|
|
func _NdGetArtistTopSongs() int32 {
|
|
var err error
|
|
_ = err
|
|
pdk.Log(pdk.LogDebug, "NdGetArtistTopSongs: getting JSON input")
|
|
var input TopSongsInput
|
|
err = pdk.InputJSON(&input)
|
|
if err != nil {
|
|
pdk.SetError(err)
|
|
return -1
|
|
}
|
|
|
|
pdk.Log(pdk.LogDebug, "NdGetArtistTopSongs: calling implementation function")
|
|
output, err := NdGetArtistTopSongs(input)
|
|
if err != nil {
|
|
pdk.SetError(err)
|
|
return -1
|
|
}
|
|
|
|
pdk.Log(pdk.LogDebug, "NdGetArtistTopSongs: setting JSON output")
|
|
err = pdk.OutputJSON(output)
|
|
if err != nil {
|
|
pdk.SetError(err)
|
|
return -1
|
|
}
|
|
|
|
pdk.Log(pdk.LogDebug, "NdGetArtistTopSongs: returning")
|
|
return 0
|
|
}
|
|
|
|
//export nd_get_artist_url
|
|
func _NdGetArtistUrl() int32 {
|
|
var err error
|
|
_ = err
|
|
pdk.Log(pdk.LogDebug, "NdGetArtistUrl: getting JSON input")
|
|
var input ArtistInput
|
|
err = pdk.InputJSON(&input)
|
|
if err != nil {
|
|
pdk.SetError(err)
|
|
return -1
|
|
}
|
|
|
|
pdk.Log(pdk.LogDebug, "NdGetArtistUrl: calling implementation function")
|
|
output, err := NdGetArtistUrl(input)
|
|
if err != nil {
|
|
pdk.SetError(err)
|
|
return -1
|
|
}
|
|
|
|
pdk.Log(pdk.LogDebug, "NdGetArtistUrl: setting JSON output")
|
|
err = pdk.OutputJSON(output)
|
|
if err != nil {
|
|
pdk.SetError(err)
|
|
return -1
|
|
}
|
|
|
|
pdk.Log(pdk.LogDebug, "NdGetArtistUrl: returning")
|
|
return 0
|
|
}
|
|
|
|
//export nd_get_similar_artists
|
|
func _NdGetSimilarArtists() int32 {
|
|
var err error
|
|
_ = err
|
|
pdk.Log(pdk.LogDebug, "NdGetSimilarArtists: getting JSON input")
|
|
var input SimilarArtistsInput
|
|
err = pdk.InputJSON(&input)
|
|
if err != nil {
|
|
pdk.SetError(err)
|
|
return -1
|
|
}
|
|
|
|
pdk.Log(pdk.LogDebug, "NdGetSimilarArtists: calling implementation function")
|
|
output, err := NdGetSimilarArtists(input)
|
|
if err != nil {
|
|
pdk.SetError(err)
|
|
return -1
|
|
}
|
|
|
|
pdk.Log(pdk.LogDebug, "NdGetSimilarArtists: setting JSON output")
|
|
err = pdk.OutputJSON(output)
|
|
if err != nil {
|
|
pdk.SetError(err)
|
|
return -1
|
|
}
|
|
|
|
pdk.Log(pdk.LogDebug, "NdGetSimilarArtists: returning")
|
|
return 0
|
|
}
|
|
|
|
// Output for GetAlbumImages
|
|
type AlbumImagesOutput struct {
|
|
// List of album images
|
|
Images []ImageInfo `json:"images"`
|
|
}
|
|
|
|
// Output for GetAlbumInfo
|
|
type AlbumInfoOutput struct {
|
|
// The album description/notes
|
|
Description string `json:"description"`
|
|
// The MusicBrainz ID for the album
|
|
Mbid string `json:"mbid"`
|
|
// The album name
|
|
Name string `json:"name"`
|
|
// The external URL for the album
|
|
Url string `json:"url"`
|
|
}
|
|
|
|
// Common input for album-related functions
|
|
type AlbumInput struct {
|
|
// The album artist name
|
|
Artist string `json:"artist"`
|
|
// The MusicBrainz ID for the album (if known)
|
|
Mbid *string `json:"mbid,omitempty"`
|
|
// The album name
|
|
Name string `json:"name"`
|
|
}
|
|
|
|
// Output for GetArtistBiography
|
|
type ArtistBiographyOutput struct {
|
|
// The artist biography text
|
|
Biography string `json:"biography"`
|
|
}
|
|
|
|
// Output for GetArtistImages
|
|
type ArtistImagesOutput struct {
|
|
// List of artist images
|
|
Images []ImageInfo `json:"images"`
|
|
}
|
|
|
|
// Common input for artist-related functions
|
|
type ArtistInput struct {
|
|
// The internal Navidrome artist ID
|
|
Id string `json:"id"`
|
|
// The MusicBrainz ID for the artist (if known)
|
|
Mbid *string `json:"mbid,omitempty"`
|
|
// The artist name
|
|
Name string `json:"name"`
|
|
}
|
|
|
|
// Input for GetArtistMBID
|
|
type ArtistMBIDInput struct {
|
|
// The internal Navidrome artist ID
|
|
Id string `json:"id"`
|
|
// The artist name
|
|
Name string `json:"name"`
|
|
}
|
|
|
|
// Output for GetArtistMBID
|
|
type ArtistMBIDOutput struct {
|
|
// The MusicBrainz ID for the artist
|
|
Mbid string `json:"mbid"`
|
|
}
|
|
|
|
// Reference to an artist with name and optional MBID
|
|
type ArtistRef struct {
|
|
// The MusicBrainz ID for the artist
|
|
Mbid *string `json:"mbid,omitempty"`
|
|
// The artist name
|
|
Name string `json:"name"`
|
|
}
|
|
|
|
// Output for GetArtistURL
|
|
type ArtistURLOutput struct {
|
|
// The external URL for the artist
|
|
Url string `json:"url"`
|
|
}
|
|
|
|
// Image with URL and size
|
|
type ImageInfo struct {
|
|
// The size of the image in pixels (width or height)
|
|
Size int32 `json:"size"`
|
|
// The URL of the image
|
|
Url string `json:"url"`
|
|
}
|
|
|
|
// Input for GetSimilarArtists
|
|
type SimilarArtistsInput struct {
|
|
// The internal Navidrome artist ID
|
|
Id string `json:"id"`
|
|
// Maximum number of similar artists to return
|
|
Limit int32 `json:"limit"`
|
|
// The MusicBrainz ID for the artist (if known)
|
|
Mbid *string `json:"mbid,omitempty"`
|
|
// The artist name
|
|
Name string `json:"name"`
|
|
}
|
|
|
|
// Output for GetSimilarArtists
|
|
type SimilarArtistsOutput struct {
|
|
// List of similar artists
|
|
Artists []ArtistRef `json:"artists"`
|
|
}
|
|
|
|
// Reference to a song with name and optional MBID
|
|
type SongRef struct {
|
|
// The MusicBrainz ID for the song
|
|
Mbid *string `json:"mbid,omitempty"`
|
|
// The song name
|
|
Name string `json:"name"`
|
|
}
|
|
|
|
// Input for GetArtistTopSongs
|
|
type TopSongsInput struct {
|
|
// Maximum number of top songs to return
|
|
Count int32 `json:"count"`
|
|
// The internal Navidrome artist ID
|
|
Id string `json:"id"`
|
|
// The MusicBrainz ID for the artist (if known)
|
|
Mbid *string `json:"mbid,omitempty"`
|
|
// The artist name
|
|
Name string `json:"name"`
|
|
}
|
|
|
|
// Output for GetArtistTopSongs
|
|
type TopSongsOutput struct {
|
|
// List of top songs
|
|
Songs []SongRef `json:"songs"`
|
|
}
|