types

package
v0.0.0-...-9384ad0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2026 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

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 AuthEvent

type AuthEvent interface {
	// contains filtered or unexported methods
}

type Authenticator

type Authenticator func(ctx context.Context) <-chan AuthEvent

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

type Image struct {
	URL    string
	Width  int32
	Height int32
}

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 LinkEvent

type LinkEvent struct{ Link string }

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

Jump to

Keyboard shortcuts

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