lastfmclient

package
v0.0.0-...-8101777 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2022 License: AGPL-3.0-or-later Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlbumData

type AlbumData struct {
	Name      string
	URL       string
	ImageURL  string
	Artist    string
	ArtistURL string
	Scrobbles int
}

AlbumData contains information about an Album on LastFM

func GetTopAlbums

func GetTopAlbums(client *lastfm.Api, username string, limit int, period Period) ([]AlbumData, error)

LastFmGetTopAlbums returns the top albums of an user

type ArtistData

type ArtistData struct {
	Name      string
	URL       string
	ImageURL  string
	Scrobbles int
}

ArtistData contains information about an Artist on LastFM

func GetTopArtists

func GetTopArtists(client *lastfm.Api, username string, limit int, period Period) ([]ArtistData, error)

GetTopArtists returns the top artists of an user

type Period

type Period string

Period is a type for periods used for Last.FM requests

const (
	PeriodOverall Period = "overall"
	Period7day    Period = "7day"
	Period1month  Period = "1month"
	Period3month  Period = "3month"
	Period6month  Period = "6month"
	Period12month Period = "12month"
)

defines possible LastFM periods

func GetPeriodFromArgs

func GetPeriodFromArgs(args []string) (Period, []string)

GetPeriodFromArgs parses args to figure out the correct period

type TrackData

type TrackData struct {
	Name           string
	URL            string
	ImageURL       string
	Artist         string
	ArtistURL      string
	ArtistImageURL string
	Album          string
	Time           time.Time
	Loved          bool
	NowPlaying     bool
	Scrobbles      int
	// used for guild stats
	Users int
}

TrackData contains information about a Track on LastFM

func GetRecentTracks

func GetRecentTracks(client *lastfm.Api, username string, limit int) (tracksData []TrackData, err error)

GetRecentTracks returns recent tracks listened to by an user

func GetTopTracks

func GetTopTracks(client *lastfm.Api, username string, limit int, period Period) ([]TrackData, error)

GetTopTracks returns the top tracks of an user

type UserData

type UserData struct {
	Username        string
	Name            string
	Icon            string
	Scrobbles       int64
	Country         string
	AccountCreation time.Time
}

UserData contains information about an User on LastFM

func GetUserinfo

func GetUserinfo(client *lastfm.Api, username string) (userData UserData, err error)

GetUserinfo returns information about a LastFM user

Jump to

Keyboard shortcuts

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