listenbrainz

package
v0.0.0-...-8d52960 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BaseURL = "https://api.listenbrainz.org"
)

Variables

View Source
var ErrListenBrainz = errors.New("listenbrainz error")

Functions

This section is empty.

Types

type AdditionalInfo

type AdditionalInfo struct {
	TrackNumber      int    `json:"tracknumber,omitempty"`
	TrackMBID        string `json:"track_mbid,omitempty"`
	RecordingMBID    string `json:"recording_mbid,omitempty"`
	ReleaseMBID      string `json:"release_mbid,omitempty"`
	Duration         int    `json:"duration,omitempty"`
	SubmissionClient string `json:"submission_client,omitempty"`
}

type Client

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

func NewClient

func NewClient() *Client

func NewClientCustom

func NewClientCustom(httpClient *http.Client) *Client

func (*Client) IsUserAuthenticated

func (c *Client) IsUserAuthenticated(user db.User) bool

func (*Client) Scrobble

func (c *Client) Scrobble(user db.User, track scrobble.Track, stamp time.Time, submission bool) error

type Payload

type Payload struct {
	ListenedAt    int            `json:"listened_at,omitempty"`
	TrackMetadata *TrackMetadata `json:"track_metadata"`
}

type Scrobble

type Scrobble struct {
	ListenType string     `json:"listen_type,omitempty"`
	Payload    []*Payload `json:"payload"`
}

type TrackMetadata

type TrackMetadata struct {
	AdditionalInfo *AdditionalInfo `json:"additional_info"`
	ArtistName     string          `json:"artist_name,omitempty"`
	TrackName      string          `json:"track_name,omitempty"`
	ReleaseName    string          `json:"release_name,omitempty"`
}

Jump to

Keyboard shortcuts

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