Documentation
¶
Index ¶
- type Album
- type Artist
- type Client
- func (c *Client) FetchUserID(ctx context.Context) error
- func (c *Client) FindDevice(ctx context.Context, activeOnly bool) (id string, active bool, preferred bool, err error)
- func (c *Client) GetAlbumTracks(ctx context.Context, albumID string, offset, limit int) ([]Track, bool, error)
- func (c *Client) GetArtistAlbums(ctx context.Context, artistID string, offset, limit int) ([]Album, bool, error)
- func (c *Client) GetDevices(ctx context.Context) ([]Device, error)
- func (c *Client) GetPlayerState(ctx context.Context) (*PlayerState, error)
- func (c *Client) GetPlaylistTracks(ctx context.Context, id string, offset, limit int) ([]Track, bool, error)
- func (c *Client) GetPlaylists(ctx context.Context, offset, limit int) (playlists []Playlist, rawCount int, more bool, err error)
- func (c *Client) GetSavedShows(ctx context.Context, offset, limit int) ([]Show, bool, error)
- func (c *Client) GetShowEpisodes(ctx context.Context, showID string, offset, limit int) ([]Episode, bool, error)
- func (c *Client) Next(ctx context.Context, deviceID string) error
- func (c *Client) Pause(ctx context.Context, deviceID string) error
- func (c *Client) Play(ctx context.Context, itemURI, contextURI, deviceID string) error
- func (c *Client) PlayQueue(ctx context.Context, uris []string, deviceID string) error
- func (c *Client) Previous(ctx context.Context, deviceID string) error
- func (c *Client) Resume(ctx context.Context, deviceID string) error
- func (c *Client) SearchAlbums(ctx context.Context, query string, offset, limit int) ([]Album, bool, error)
- func (c *Client) SearchArtists(ctx context.Context, query string, offset, limit int) ([]Artist, bool, error)
- func (c *Client) SearchEpisodes(ctx context.Context, query string, offset, limit int) ([]Episode, bool, error)
- func (c *Client) SearchShows(ctx context.Context, query string, offset, limit int) ([]Show, bool, error)
- func (c *Client) SearchTracks(ctx context.Context, query string, offset, limit int) ([]Track, bool, error)
- func (c *Client) Seek(ctx context.Context, positionMs int, deviceID string) error
- func (c *Client) Shuffle(ctx context.Context, state bool, deviceID string) error
- func (c *Client) Stop(ctx context.Context, deviceID string) error
- func (c *Client) TransferPlayback(ctx context.Context, deviceID string, play bool) error
- type Device
- type Episode
- type PlayerState
- type Playlist
- type Show
- type Track
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
PreferredDevice string // if set, FindDevice prefers this device name
// DeviceOverridden is set when the user manually switches playback to
// another device in Spotify. Checked by the librespot OnReconnect
// callback to avoid stealing playback back.
DeviceOverridden atomic.Bool
// contains filtered or unexported fields
}
func (*Client) FindDevice ¶
func (c *Client) FindDevice(ctx context.Context, activeOnly bool) (id string, active bool, preferred bool, err error)
FindDevice returns the best device ID, whether it is currently active, and whether the returned device is the configured preferred device. When activeOnly is true, only a device currently marked active by Spotify is returned; an error is returned if no device is active.
func (*Client) GetAlbumTracks ¶
func (*Client) GetArtistAlbums ¶
func (*Client) GetDevices ¶ added in v0.2.0
GetDevices returns all available Spotify Connect devices.
func (*Client) GetPlayerState ¶
func (c *Client) GetPlayerState(ctx context.Context) (*PlayerState, error)
func (*Client) GetPlaylistTracks ¶
func (*Client) GetPlaylists ¶
func (c *Client) GetPlaylists(ctx context.Context, offset, limit int) (playlists []Playlist, rawCount int, more bool, err error)
GetPlaylists returns the user's own playlists. The second return value (rawCount) is the unfiltered API page size, which callers must use to advance the offset (since it includes items filtered out by owner matching).
func (*Client) GetSavedShows ¶
func (*Client) GetShowEpisodes ¶
func (*Client) SearchAlbums ¶
func (*Client) SearchArtists ¶
func (*Client) SearchEpisodes ¶
func (*Client) SearchShows ¶
func (*Client) SearchTracks ¶
type PlayerState ¶
Click to show internal directories.
Click to hide internal directories.