spotify

package
v0.0.0-...-ac441f4 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

README

Playlist visibility sync

  1. When creating or updating a playlist through the Spotify Web API, setting the attribute “public” to true will publish the playlist on the user’s profile, which means it will appear under “public playlists”. This will also make the playlist visible in search results.

  2. Note that the public attribute does not refer to access control, modifying access is currently not possible through the WebAPI, so anyone with the link to the playlist can access it unless it’s made private through for instance the desktop client.

https://developer.spotify.com/documentation/web-api/concepts/playlists

Documentation

Index

Constants

View Source
const (
	RemoteName shared.RemoteName = "Spotify"
)

Variables

This section is empty.

Functions

func NewAccount

func NewAccount(ctx context.Context,
	alias string,
	clientID string,
	clientSecret string,
	onURL func(url string)) (shared.Account, error)

func Reauth

func Reauth(
	ctx context.Context,
	account shared.Account,
	clientID string,
	clientSecret string,
	onURL func(url string)) error

Types

type AccountActions

type AccountActions struct {
	// contains filtered or unexported fields
}

func (AccountActions) LikedAlbums

func (e AccountActions) LikedAlbums() shared.LikedActions

func (AccountActions) LikedArtists

func (e AccountActions) LikedArtists() shared.LikedActions

func (AccountActions) LikedTracks

func (e AccountActions) LikedTracks() shared.LikedActions

func (AccountActions) Playlist

func (e AccountActions) Playlist() shared.PlaylistActions

type Actions

type Actions struct {
	// contains filtered or unexported fields
}

func (Actions) Album

func (Actions) Artist

func (Actions) SearchAlbums

func (e Actions) SearchAlbums(ctx context.Context, what shared.RemoteAlbum) ([10]shared.RemoteAlbum, error)

func (Actions) SearchArtists

func (e Actions) SearchArtists(ctx context.Context, what shared.RemoteArtist) ([10]shared.RemoteArtist, error)

func (Actions) SearchTracks

func (e Actions) SearchTracks(ctx context.Context, what shared.RemoteTrack) ([10]shared.RemoteTrack, error)

func (Actions) Track

type Album

type Album struct {
	*Entity
	// contains filtered or unexported fields
}

func (Album) Artists

func (e Album) Artists() []shared.RemoteArtist

func (Album) CoverURL

func (e Album) CoverURL() *url.URL

func (Album) EAN

func (e Album) EAN() *string

func (Album) TrackCount

func (e Album) TrackCount() int

func (Album) UPC

func (e Album) UPC() *string

func (Album) Year

func (e Album) Year() int

type AlbumsSearchAction

type AlbumsSearchAction struct {
	// contains filtered or unexported fields
}

func (AlbumsSearchAction) Search

type Artist

type Artist struct {
	*Entity
	// contains filtered or unexported fields
}

func (*Artist) OldestAlbumsNames

func (e *Artist) OldestAlbumsNames(ctx context.Context) ([20]string, error)

func (*Artist) OldestSinglesNames

func (e *Artist) OldestSinglesNames(ctx context.Context) ([20]string, error)

type ArtistsSearchAction

type ArtistsSearchAction struct {
	// contains filtered or unexported fields
}

func (ArtistsSearchAction) Search

type Entity

type Entity struct {
	// contains filtered or unexported fields
}

func (Entity) ID

func (e Entity) ID() shared.RemoteID

func (Entity) Name

func (e Entity) Name() string

func (Entity) RemoteName

func (e Entity) RemoteName() shared.RemoteName

type LikedAlbumsActions

type LikedAlbumsActions struct {
	// contains filtered or unexported fields
}

func (LikedAlbumsActions) Like

func (LikedAlbumsActions) Liked

func (LikedAlbumsActions) Unlike

func (e LikedAlbumsActions) Unlike(ctx context.Context, ids []shared.RemoteID) error

type LikedArtistsActions

type LikedArtistsActions struct {
	// contains filtered or unexported fields
}

func (LikedArtistsActions) Like

func (LikedArtistsActions) Liked

func (LikedArtistsActions) Unlike

func (e LikedArtistsActions) Unlike(ctx context.Context, ids []shared.RemoteID) error

type LikedTracksActions

type LikedTracksActions struct {
	// contains filtered or unexported fields
}

func (LikedTracksActions) Like

func (LikedTracksActions) Liked

func (LikedTracksActions) Unlike

func (e LikedTracksActions) Unlike(ctx context.Context, ids []shared.RemoteID) error

type Playlist

type Playlist struct {
	*Entity
	// contains filtered or unexported fields
}

func (*Playlist) AddTracks

func (e *Playlist) AddTracks(ctx context.Context, ids []shared.RemoteID) error

func (Playlist) Description

func (e Playlist) Description() *string

func (Playlist) FromAccount

func (e Playlist) FromAccount() shared.Account

func (*Playlist) IsVisible

func (e *Playlist) IsVisible() (bool, error)

func (*Playlist) RemoveTracks

func (e *Playlist) RemoveTracks(ctx context.Context, ids []shared.RemoteID) error

func (*Playlist) Rename

func (e *Playlist) Rename(ctx context.Context, newName string) error

func (Playlist) SetDescription

func (e Playlist) SetDescription(ctx context.Context, newDesc string) error

func (*Playlist) SetIsVisible

func (e *Playlist) SetIsVisible(ctx context.Context, val bool) error

func (*Playlist) Tracks

func (e *Playlist) Tracks(ctx context.Context) ([]shared.RemoteTrack, error)

type PlaylistActions

type PlaylistActions struct {
	// contains filtered or unexported fields
}

func (PlaylistActions) Create

func (e PlaylistActions) Create(ctx context.Context, name string, isVisible bool, description *string) (shared.RemotePlaylist, error)

func (PlaylistActions) Delete

func (e PlaylistActions) Delete(ctx context.Context, entities []shared.RemoteID) error

func (*PlaylistActions) MyPlaylists

func (e *PlaylistActions) MyPlaylists(ctx context.Context) ([]shared.RemotePlaylist, error)

func (PlaylistActions) Playlist

type Remote

type Remote struct {
}

func (Remote) Actions

func (s Remote) Actions() (shared.RemoteActions, error)

func (Remote) AssignAccountActions

func (s Remote) AssignAccountActions(account shared.Account) (shared.AccountActions, error)

func (*Remote) Boot

func (s *Remote) Boot(repo shared.RemoteRepository) error

func (Remote) EntityURL

func (e Remote) EntityURL(etype shared.EntityType, id shared.RemoteID) url.URL

func (Remote) Name

func (s Remote) Name() shared.RemoteName

func (Remote) Repository

func (s Remote) Repository() shared.RemoteRepository

type Track

type Track struct {
	*Entity
	// contains filtered or unexported fields
}

func (*Track) Album

func (e *Track) Album() (shared.RemoteAlbum, error)

func (*Track) Artists

func (e *Track) Artists() []shared.RemoteArtist

func (Track) CoverURL

func (e Track) CoverURL() *url.URL

func (Track) ISRC

func (e Track) ISRC() *string

func (Track) LengthMs

func (e Track) LengthMs() int

func (Track) Year

func (e Track) Year() int

type TracksSearchAction

type TracksSearchAction struct {
	// contains filtered or unexported fields
}

func (TracksSearchAction) Search

Jump to

Keyboard shortcuts

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