Documentation ¶
Index ¶
- Variables
- func SanityCheck(tracks []TrackStub) bool
- type Album
- type Artist
- type Audio
- type FormatType
- type Image
- type LocalStore
- type OToken
- type Playlist
- type Session
- func (s *Session) GetAlbum(id string) (Album, error)
- func (s *Session) GetArtist(id string) (Artist, error)
- func (s *Session) GetAudio(t TrackStub, format FormatType) (Audio, error)
- func (s *Session) GetLikedSongs() ([]TrackStub, error)
- func (s *Session) GetOauthToken(scope string) (*metadata.Token, error)
- func (s *Session) GetPlaylist(id string, stubOnly bool) (Playlist, error)
- func (s *Session) GetPlaylistMercury(id string, stubOnly bool) (Playlist, error)
- func (s *Session) GetRootPlaylist() ([]Playlist, error)
- func (s *Session) GetTrack(trackId string) (TrackStub, error)
- func (s *Session) GetTrackFull(stub TrackStub) (Track, error)
- func (s *Session) GetTrackStub(trackId string) (TrackStub, error)
- func (s *Session) PromoteStub(t *TrackStub) error
- func (s *Session) ValidToken() (string, error)
- type Track
- type TrackStub
Constants ¶
This section is empty.
Variables ¶
var DEBUG = false
var ErrMissingImg = errors.New("missing image")
ErrMissingImg todo: engooden
Functions ¶
func SanityCheck ¶
SanityCheck makes sure that all the tracks have an id associated with them because 90% of anything spotify related will silently fail. returns true if all is good
Types ¶
type Audio ¶
type Audio struct { Format Spotify.AudioFile_Format File *[]byte }
type FormatType ¶
type FormatType byte
const ( FormatMp3 FormatType = 1 FormatOgg FormatType = 2 FormatBestEffort FormatType = 3 )
type LocalStore ¶
type OToken ¶
func (OToken) ToOauthToken ¶
type Session ¶
type Session struct { Ls *LocalStore Sess *core.Session }
func (*Session) GetAudio ¶
func (s *Session) GetAudio(t TrackStub, format FormatType) (Audio, error)
GetAudio returns the audio file in the desired format, starting at high bitrate then going lower if not available. Throws error if audio of type cannot be found.
func (*Session) GetLikedSongs ¶
GetLikedSongs may take forever if you have a ton of songs since it only gets them in chunks of 50
func (*Session) GetOauthToken ¶
GetOauthToken gets an access token with all scopes if scope is empty or with the specified scopes
func (*Session) GetPlaylist ¶
func (*Session) GetPlaylistMercury ¶
GetPlaylistMercury "same" as GetPlaylist but uses mercury api instead of the public api. Might be faster, but also can't get playlist images and likes to fail silently.
func (*Session) GetRootPlaylist ¶
func (*Session) PromoteStub ¶
func (*Session) ValidToken ¶
ValidToken for internal use or if you don't want to maintain the token yourself; returns a valid token; uses the cached one if it is still valid, else gets a new one and updates the cache