acoustid

package
v0.12.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 23, 2024 License: GPL-3.0 Imports: 15 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Artist

type Artist struct {
	ID         string `json:"id"`
	Name       string `json:"name"`
	Joinphrase string `json:"joinphrase"`
}

type Artists

type Artists []*Artist

func (Artists) String

func (a Artists) String() string

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(c Config) (*Client, error)

func (*Client) Fingerprint

func (c *Client) Fingerprint(ctx context.Context, r io.Reader) (string, int, error)

func (*Client) Lookup

func (c *Client) Lookup(ctx context.Context, fingerprint string, duration int) (*Response, error)

func (*Client) LookupFile

func (c *Client) LookupFile(ctx context.Context, file string) (*Response, error)

func (*Client) LookupReader

func (c *Client) LookupReader(ctx context.Context, r io.Reader) (*Response, error)

type Config

type Config struct {
	Key        string
	FFMPEGBin  string
	FPCALCBin  string
	HTTPClient *http.Client
	DebugErr   bool
	DebugAll   bool
}

type Recording

type Recording struct {
	ID            string        `json:"id"`
	Duration      int           `json:"duration"`
	Title         string        `json:"title"`
	ReleaseGroups ReleaseGroups `json:"releasegroups"`
	Artists       Artists       `json:"artists"`
}

func (*Recording) Album

func (r *Recording) Album() string

func (*Recording) String

func (r *Recording) String() string

func (*Recording) ToString

func (r *Recording) ToString(format string) string

type ReleaseGroup

type ReleaseGroup struct {
	ID             string        `json:"id"`
	Type           ReleaseType   `json:"type"`
	SecondaryTypes []ReleaseType `json:"secondarytypes"`
	Title          string        `json:"title"`
}

type ReleaseGroups

type ReleaseGroups []*ReleaseGroup

func (ReleaseGroups) Filter

func (r ReleaseGroups) Filter(t ...ReleaseType) ReleaseGroups

func (ReleaseGroups) FilterNot

func (r ReleaseGroups) FilterNot(t ...ReleaseType) ReleaseGroups

type ReleaseType

type ReleaseType string
const Album ReleaseType = "Album"
const Compilation ReleaseType = "Compilation"
const Single ReleaseType = "Single"

type Response

type Response struct {
	Status  string    `json:"status"`
	Results []*Result `json:"results"`
	Error   struct {
		Code    int    `json:"code"`
		Message string `json:"message"`
	} `json:"error"`
}

func (*Response) Best

func (r *Response) Best(minScore float32) (result *Result, ok bool)

func (*Response) BestString

func (r *Response) BestString(minScore float32) string

func (*Response) Err

func (r *Response) Err() error

func (*Response) OK

func (r *Response) OK() bool

type Result

type Result struct {
	ID         string       `json:"id"`
	Score      float32      `json:"score"`
	Recordings []*Recording `json:"recordings"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL