track

package
v0.0.0-...-5fee3ad Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Track

type Track struct {
	Username string
	// contains filtered or unexported fields
}

Track represents a structure to help query the `track` LastFM API functions.

func New

func New(client *lastfm.Client, username string, autocorrect bool) (track *Track)

New returns an instance of the `track` API endpoint functions for LastFM.

func (*Track) AddTags

func (t *Track) AddTags(artist, track string, tags []string) (err error)

AddTags adds tags to a track on LastFM using a list of user supplied tags

func (*Track) GetCorrection

func (t *Track) GetCorrection(artist, track string) (tc *trackCorrection, err error)

GetCorrection fetches canonical track details from LastFM for the provided artist and track

func (*Track) GetInfo

func (t *Track) GetInfo(artist, track, mbid string) (ti *trackInfo, err error)

GetInfo fetches track metadata from LastFM using artist and track name, or MBID (MusicBrainz ID)

func (*Track) GetSimilar

func (t *Track) GetSimilar(artist, track, mbid string) (ts *trackSimilar, err error)

GetSimilar fetches similar tracks from LastFM for the provided artist and track name, or MBID (MusicBrainz ID)

func (*Track) GetTags

func (t *Track) GetTags(artist, track, mbid string) (tt *trackTags, err error)

GetTags fetches user-applied tags on a track from LastFM for the provided artist and track name, or MBID (MusicBrainz ID)

func (*Track) GetTopTags

func (t *Track) GetTopTags(artist, track, mbid string) (ttt *trackTopTags, err error)

GetTopTags fetches top tags for the provided track from LastFM, ordered by tag count, based on artist and track name, or MBID (MusicBrainz ID)

func (*Track) Love

func (t *Track) Love(artist, track string) (err error)

Love marks the track as loved for the user on LastFM

func (*Track) RemoveTag

func (t *Track) RemoveTag(artist, track, tag string) (err error)

RemoveTag removes the provided user-applied tag from a track on LastFM

func (*Track) Scrobble

func (t *Track) Scrobble(scrobbleList []lastfm.Scrobble) (ts *trackScrobble, err error)

Scrobble adds a track-play to the user's profile on LastFM for each track in the provided scrobble list.

The scrobble list needs to be a slice of the Scrobble struct.

func (*Track) Search

func (t *Track) Search(artist, track string, page int) (ts *trackSearch, err error)

Search searches for a track by artist and track name on LastFM.

func (*Track) Unlove

func (t *Track) Unlove(artist, track string) (err error)

Unlove unmarks the track as loved for the user on LastFM

func (*Track) UpdateNowPlaying

func (t *Track) UpdateNowPlaying(scrobble lastfm.Scrobble) (tnp *trackUpdateNowPlaying, err error)

UpdateNowPlaying sets the provided track as currently playing for the user on LastFM.

The parameter values provided for the Scrobble struct are case-sensitive.

Jump to

Keyboard shortcuts

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