spotify

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidInput = errors.New("invalid user input for Spotify URI")
	ErrExplicitSong = errors.New("user does not allow adding explicit songs to the queue")
	ErrSongTooLong  = errors.New("song is too long")
)

Functions

func Search(client queue.Queuer, input string, pref *preferences.Preference) (string, error)

func ShouldQueue

func ShouldQueue(client queue.Queuer, id spotify.ID, p *preferences.Preference) error

TODO: this should be in the queuer

Types

type SpotifyPlayerQueue

type SpotifyPlayerQueue struct {
	OpaqueLinkResolver func(string) string
}

TODO: Publisher is an unnecessary struct because there is no state that the publisher tracks here.

func NewSpotifyPlayerQueue added in v1.3.1

func NewSpotifyPlayerQueue() *SpotifyPlayerQueue

func (*SpotifyPlayerQueue) Publish

func (s *SpotifyPlayerQueue) Publish(client queue.Queuer, input string, pref *preferences.Preference) (spotify.ID, error)

Publish will validate that the input matches a valid Spotify URL scheme, and then attempt to queue it in the user's Spotify player.

Jump to

Keyboard shortcuts

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