Documentation ¶
Overview ¶
Service lastfm provides access to Last.FM API and stores the user library.
Index ¶
Constants ¶
View Source
const (
UrlLastfm = "https://ws.audioscrobbler.com/2.0"
)
Variables ¶
View Source
var BroadGenres = []string{
"acoustic",
"classical",
"country",
"electronic",
"folk",
"gothic",
"hip-hop",
"indie",
"jazz",
"metal",
"podcast",
"pop",
"punk",
"reggae",
"rock",
"singer-songwriter",
"soundtrack",
}
View Source
var IgnoredGenres = map[string]string{
"composer": "",
"composers": "",
"female vocalists": "",
"hip hop": "hip-hop",
"instrumental": "",
"rap": "hip-hop",
}
View Source
var Module = &services.Module{ Name: "lastfm", Version: "1.0", NewInstance: NewService, }
Functions ¶
Types ¶
type Api ¶
func (*Api) ArtistGetTopTags ¶
func (a *Api) ArtistGetTopTags(artist string) (*ApiTopTags, error)
func (*Api) UserGetRecentTracks ¶
type ApiRecentTracks ¶
type ApiRecentTracks struct { ApiResponse RecentTracks struct { Attr struct { User string `json:"user"` Page int `json:"page,string"` PerPage int `json:"perPage,string"` TotalPages int `json:"totalPages,string"` Total int `json:"total,string"` } `json:"@attr"` Tracks []ApiTrack `json:"track"` } `json:"recenttracks"` }
type ApiResponse ¶
func (ApiResponse) IsError ¶
func (r ApiResponse) IsError() error
type ApiTopTags ¶
type ApiTopTags struct { ApiResponse TopTags struct { Tags []ApiTag `json:"tag"` Attr struct { Artist string `json:"artist"` } `json:"@attr"` } `json:"toptags"` }
type ApiTrack ¶
type ApiTrack struct { Artist struct { Text string `json:"#text"` } `json:"artist"` Album struct { Text string `json:"#text"` } `json:"album"` Name string `json:"name"` Url string `json:"url"` Date struct { UTS int `json:"uts,string"` Text string `json:"#text"` } `json:"date"` Attr struct { NowPlaying bool `json:"nowplaying,string"` } `json:"@attr"` }
type Dependencies ¶
type Service ¶
type Service struct { DB *gorm.DB Log sfproto.Logger sarif.Client // contains filtered or unexported fields }
func NewService ¶
func NewService(deps *Dependencies) *Service
func (*Service) RefreshArtistInfo ¶
func (s *Service) RefreshArtistInfo()
Click to show internal directories.
Click to hide internal directories.