Documentation
¶
Index ¶
- func AlbumURI(pb *metadatapb.Album) string
- func ArtistNames(pb *metadatapb.Track) string
- func ArtistURI(pb *metadatapb.Artist) string
- func TrackURI(pb *metadatapb.Track) string
- type AuthEvent
- type Authenticator
- type Client
- type CodeReceivedEvent
- type FailedEvent
- type Image
- type LinkEvent
- type Playlist
- type Session
- type SessionAuthorizedEvent
- type TrackComparator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AlbumURI ¶
func AlbumURI(pb *metadatapb.Album) string
func ArtistNames ¶
func ArtistNames(pb *metadatapb.Track) string
func ArtistURI ¶
func ArtistURI(pb *metadatapb.Artist) string
func TrackURI ¶
func TrackURI(pb *metadatapb.Track) string
TrackURI extracts the URI from a track proto.
Types ¶
type Authenticator ¶
type Client ¶
type Client interface {
Close()
Player() *player.Player
Search(ctx context.Context, query string) (*spclient.ContextResolver, error)
LikedTracks(ctx context.Context, artistID ...string) (*spclient.ContextResolver, error)
ResolveContext(ctx context.Context, uri string) (*spclient.ContextResolver, error)
FetchTrackMetadata(ctx context.Context, uri string) (*metadatapb.Track, error)
FetchAlbumMetadata(ctx context.Context, uri string) (*metadatapb.Album, error)
FetchArtistMetadata(ctx context.Context, uri string) (*metadatapb.Artist, error)
FetchLikesEnrich(ctx context.Context, onBatch func([]*metadatapb.Track)) error
EnrichPage(ctx context.Context, cr *spclient.ContextResolver, pageIdx int, onBatch func([]*metadatapb.Track)) error
}
type CodeReceivedEvent ¶
type CodeReceivedEvent struct{}
type FailedEvent ¶
type FailedEvent struct{ Error error }
type Image ¶
Image is a CDN image extracted from proto Image messages.
func AlbumCovers ¶
func AlbumCovers(pb *metadatapb.Album) []Image
func ImagesFromProto ¶
func ImagesFromProto(pbs []*metadatapb.Image) []Image
ImagesFromProto converts proto Image messages to CDN-url Images.
type Playlist ¶
type Playlist struct {
URI string
Name string
Description string
Owner string
TrackCount int
CreatedAt time.Time
}
Playlist is a lightweight representation of a playlist.
func (*Playlist) FromProto ¶
func (p *Playlist) FromProto(pb *playlist4pb.SelectedListContent)
type Session ¶
type Session interface {
Close()
Username() string
StoredCredentials() []byte
Spclient() *spclient.Spclient
Events() player.EventManager
AudioKey() *audio.KeyProvider
Dealer() *dealer.Dealer
Accesspoint() *ap.Accesspoint
Mercury() *mercury.Client
WebApi(ctx context.Context, method string, path string, query url.Values, header http.Header,
body []byte) (*http.Response, error)
}
type SessionAuthorizedEvent ¶
type SessionAuthorizedEvent struct{ Session Session }
type TrackComparator ¶
type TrackComparator struct{}
func (TrackComparator) Compare ¶
func (TrackComparator) Compare(a, b *metadatapb.Track) int
func (TrackComparator) Key ¶
func (TrackComparator) Key(a *metadatapb.Track) string
Click to show internal directories.
Click to hide internal directories.