72 lines
2.4 KiB
Go
72 lines
2.4 KiB
Go
|
|
// 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 sonicsimilarity
|
||
|
|
|
||
|
|
// FindSonicPathRequest represents the FindSonicPathRequest data structure.
|
||
|
|
type FindSonicPathRequest struct {
|
||
|
|
StartSong SongRef `json:"startSong"`
|
||
|
|
EndSong SongRef `json:"endSong"`
|
||
|
|
Count int32 `json:"count"`
|
||
|
|
}
|
||
|
|
|
||
|
|
// GetSonicSimilarTracksRequest represents the GetSonicSimilarTracksRequest data structure.
|
||
|
|
type GetSonicSimilarTracksRequest struct {
|
||
|
|
Song SongRef `json:"song"`
|
||
|
|
Count int32 `json:"count"`
|
||
|
|
}
|
||
|
|
|
||
|
|
// SongRef is a reference to a song with metadata for matching.
|
||
|
|
type SongRef struct {
|
||
|
|
// ID is the internal Navidrome mediafile ID (if known).
|
||
|
|
ID string `json:"id,omitempty"`
|
||
|
|
// Name is the song name.
|
||
|
|
Name string `json:"name"`
|
||
|
|
// MBID is the MusicBrainz ID for the song.
|
||
|
|
MBID string `json:"mbid,omitempty"`
|
||
|
|
// ISRC is the International Standard Recording Code for the song.
|
||
|
|
ISRC string `json:"isrc,omitempty"`
|
||
|
|
// Artist is the artist name.
|
||
|
|
Artist string `json:"artist,omitempty"`
|
||
|
|
// ArtistMBID is the MusicBrainz artist ID.
|
||
|
|
ArtistMBID string `json:"artistMbid,omitempty"`
|
||
|
|
// Album is the album name.
|
||
|
|
Album string `json:"album,omitempty"`
|
||
|
|
// AlbumMBID is the MusicBrainz release ID.
|
||
|
|
AlbumMBID string `json:"albumMbid,omitempty"`
|
||
|
|
// Duration is the song duration in seconds.
|
||
|
|
Duration float32 `json:"duration,omitempty"`
|
||
|
|
}
|
||
|
|
|
||
|
|
// SonicMatch represents the SonicMatch data structure.
|
||
|
|
type SonicMatch struct {
|
||
|
|
Song SongRef `json:"song"`
|
||
|
|
Similarity float64 `json:"similarity"`
|
||
|
|
}
|
||
|
|
|
||
|
|
// SonicSimilarityResponse represents the SonicSimilarityResponse data structure.
|
||
|
|
type SonicSimilarityResponse struct {
|
||
|
|
Matches []SonicMatch `json:"matches"`
|
||
|
|
}
|
||
|
|
|
||
|
|
// SonicSimilarity requires all methods to be implemented.
|
||
|
|
// SonicSimilarity provides audio-similarity based track discovery.
|
||
|
|
type SonicSimilarity interface {
|
||
|
|
// GetSonicSimilarTracks
|
||
|
|
GetSonicSimilarTracks(GetSonicSimilarTracksRequest) (SonicSimilarityResponse, error)
|
||
|
|
// FindSonicPath
|
||
|
|
FindSonicPath(FindSonicPathRequest) (SonicSimilarityResponse, 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(_ SonicSimilarity) {}
|