Documentation
¶
Index ¶
- func UpdateQueue() tea.Cmd
- type CacheEntry
- type DevicesUpdatedMsg
- type ErrorMsg
- type PlayerStateUpdatedMsg
- type PlaylistSelectedMsg
- type PlaylistsUpdatedMsg
- type QueueManager
- func (q *QueueManager) Dequeue() (spotify.SimpleTrack, error)
- func (q *QueueManager) Enqueue(track spotify.SimpleTrack)
- func (q *QueueManager) IsEmpty() bool
- func (q *QueueManager) List() []spotify.SimpleTrack
- func (q *QueueManager) Peek() (spotify.SimpleTrack, error)
- func (q *QueueManager) PopAt(index int) (spotify.SimpleTrack, error)
- func (q *QueueManager) Size() int
- type QueueUpdatedMsg
- type RetryableOperation
- type SearchResultsUpdatedMsg
- type SpotifyState
- func (s *SpotifyState) DecreaseVolume(ctx context.Context) tea.Cmd
- func (s *SpotifyState) FetchAlbumTracks(ctx context.Context, albumId spotify.ID) tea.Cmd
- func (s *SpotifyState) FetchArtistTopTracks(ctx context.Context, artistID spotify.ID, country string) tea.Cmd
- func (s *SpotifyState) FetchDevices(ctx context.Context) tea.Cmd
- func (s *SpotifyState) FetchNextTracksPage(ctx context.Context, sourceID spotify.ID, nextPage *spotify.PlaylistItemPage) tea.Cmd
- func (s *SpotifyState) FetchPlaybackState(ctx context.Context) tea.Cmd
- func (s *SpotifyState) FetchPlaylistTracks(ctx context.Context, playlistID spotify.ID) tea.Cmd
- func (s *SpotifyState) FetchPlaylists(ctx context.Context) tea.Cmd
- func (s *SpotifyState) FetchTopTracks(ctx context.Context, artistId spotify.ID) tea.Cmd
- func (s *SpotifyState) GetCacheStats(sourceID spotify.ID) (loadedTracks, totalTracks, originalTotal, filteredCount int, hasMore bool)
- func (s *SpotifyState) GetCachedTracks(sourceID spotify.ID) (*CacheEntry, bool)
- func (s *SpotifyState) GetDeviceState() []spotify.PlayerDevice
- func (s *SpotifyState) GetOathToken() *oauth2.Token
- func (s *SpotifyState) GetPlayerState() spotify.PlayerState
- func (s *SpotifyState) GetPlaylists() []spotify.SimplePlaylist
- func (s *SpotifyState) GetSearchResultAlbums() []spotify.SimpleAlbum
- func (s *SpotifyState) GetSearchResultArtists() []spotify.FullArtist
- func (s *SpotifyState) GetSearchResultPlaylists() []spotify.SimplePlaylist
- func (s *SpotifyState) GetSearchResultTracks() []spotify.FullTrack
- func (s *SpotifyState) GetSelectedID() spotify.ID
- func (s *SpotifyState) GetTotalTracks(sourceID spotify.ID) int
- func (s *SpotifyState) GetTracks() []spotify.SimpleTrack
- func (s *SpotifyState) HasMoreTracks(sourceID spotify.ID) bool
- func (s *SpotifyState) IncreaseVolume(ctx context.Context) tea.Cmd
- func (s *SpotifyState) Mute(ctx context.Context) tea.Cmd
- func (s *SpotifyState) PausePlayback(ctx context.Context) tea.Cmd
- func (s *SpotifyState) PlayTrack(ctx context.Context, trackID spotify.ID) tea.Cmd
- func (s *SpotifyState) PreviousTrack(ctx context.Context) tea.Cmd
- func (s *SpotifyState) SearchEverything(ctx context.Context, query string) tea.Cmd
- func (s *SpotifyState) SelectDevice(ctx context.Context, deviceID spotify.ID) tea.Cmd
- func (s *SpotifyState) SelectPlaylist(playlistID string) tea.Cmd
- func (s *SpotifyState) SetSelectedID(id spotify.ID)
- func (s *SpotifyState) StartPlayback(ctx context.Context) tea.Cmd
- func (s *SpotifyState) ToggleRepeatMode(ctx context.Context) tea.Cmd
- func (s *SpotifyState) ToggleShuffleMode(ctx context.Context) tea.Cmd
- type TracksUpdatedMsg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UpdateQueue ¶
Types ¶
type CacheEntry ¶
type CacheEntry struct {
Tracks []spotify.SimpleTrack
NextPage *spotify.PlaylistItemPage
HasMore bool
TotalTracks int
OriginalTotalTracks int // Track the original total from Spotify
FilteredCount int // Track cumulative filtered items
}
type DevicesUpdatedMsg ¶
type DevicesUpdatedMsg struct{}
type PlayerStateUpdatedMsg ¶
type PlayerStateUpdatedMsg struct {
}
type PlaylistSelectedMsg ¶
type PlaylistSelectedMsg struct {
PlaylistID string
}
type PlaylistsUpdatedMsg ¶
type PlaylistsUpdatedMsg struct {
}
type QueueManager ¶
type QueueManager struct {
// contains filtered or unexported fields
}
func (*QueueManager) Dequeue ¶
func (q *QueueManager) Dequeue() (spotify.SimpleTrack, error)
func (*QueueManager) Enqueue ¶
func (q *QueueManager) Enqueue(track spotify.SimpleTrack)
func (*QueueManager) IsEmpty ¶
func (q *QueueManager) IsEmpty() bool
func (*QueueManager) List ¶
func (q *QueueManager) List() []spotify.SimpleTrack
func (*QueueManager) Peek ¶
func (q *QueueManager) Peek() (spotify.SimpleTrack, error)
func (*QueueManager) PopAt ¶
func (q *QueueManager) PopAt(index int) (spotify.SimpleTrack, error)
func (*QueueManager) Size ¶
func (q *QueueManager) Size() int
type QueueUpdatedMsg ¶
type QueueUpdatedMsg struct{}
type RetryableOperation ¶
type SearchResultsUpdatedMsg ¶
type SearchResultsUpdatedMsg struct{}
type SpotifyState ¶
type SpotifyState struct {
Queue QueueManager
// contains filtered or unexported fields
}
SpotifyState manages all Spotify-related state and API calls
func NewSpotifyState ¶
func NewSpotifyState(client *spotify.Client) *SpotifyState
func (*SpotifyState) DecreaseVolume ¶
func (s *SpotifyState) DecreaseVolume(ctx context.Context) tea.Cmd
DecreaseVolume decreases the volume by 10%
func (*SpotifyState) FetchAlbumTracks ¶
func (*SpotifyState) FetchArtistTopTracks ¶
func (s *SpotifyState) FetchArtistTopTracks(ctx context.Context, artistID spotify.ID, country string) tea.Cmd
FetchArtistTopTracks retrieves top tracks for an artist
func (*SpotifyState) FetchDevices ¶
func (s *SpotifyState) FetchDevices(ctx context.Context) tea.Cmd
func (*SpotifyState) FetchNextTracksPage ¶
func (s *SpotifyState) FetchNextTracksPage(ctx context.Context, sourceID spotify.ID, nextPage *spotify.PlaylistItemPage) tea.Cmd
func (*SpotifyState) FetchPlaybackState ¶
func (s *SpotifyState) FetchPlaybackState(ctx context.Context) tea.Cmd
func (*SpotifyState) FetchPlaylistTracks ¶
func (*SpotifyState) FetchPlaylists ¶
func (s *SpotifyState) FetchPlaylists(ctx context.Context) tea.Cmd
func (*SpotifyState) FetchTopTracks ¶
func (*SpotifyState) GetCacheStats ¶
func (s *SpotifyState) GetCacheStats(sourceID spotify.ID) (loadedTracks, totalTracks, originalTotal, filteredCount int, hasMore bool)
GetCacheStats returns debug information about the cache entry
func (*SpotifyState) GetCachedTracks ¶
func (s *SpotifyState) GetCachedTracks(sourceID spotify.ID) (*CacheEntry, bool)
func (*SpotifyState) GetDeviceState ¶
func (s *SpotifyState) GetDeviceState() []spotify.PlayerDevice
func (*SpotifyState) GetOathToken ¶
func (s *SpotifyState) GetOathToken() *oauth2.Token
func (*SpotifyState) GetPlayerState ¶
func (s *SpotifyState) GetPlayerState() spotify.PlayerState
func (*SpotifyState) GetPlaylists ¶
func (s *SpotifyState) GetPlaylists() []spotify.SimplePlaylist
func (*SpotifyState) GetSearchResultAlbums ¶
func (s *SpotifyState) GetSearchResultAlbums() []spotify.SimpleAlbum
func (*SpotifyState) GetSearchResultArtists ¶
func (s *SpotifyState) GetSearchResultArtists() []spotify.FullArtist
func (*SpotifyState) GetSearchResultPlaylists ¶
func (s *SpotifyState) GetSearchResultPlaylists() []spotify.SimplePlaylist
func (*SpotifyState) GetSearchResultTracks ¶
func (s *SpotifyState) GetSearchResultTracks() []spotify.FullTrack
func (*SpotifyState) GetSelectedID ¶
func (s *SpotifyState) GetSelectedID() spotify.ID
func (*SpotifyState) GetTotalTracks ¶
func (s *SpotifyState) GetTotalTracks(sourceID spotify.ID) int
func (*SpotifyState) GetTracks ¶
func (s *SpotifyState) GetTracks() []spotify.SimpleTrack
func (*SpotifyState) HasMoreTracks ¶
func (s *SpotifyState) HasMoreTracks(sourceID spotify.ID) bool
func (*SpotifyState) IncreaseVolume ¶
func (s *SpotifyState) IncreaseVolume(ctx context.Context) tea.Cmd
IncreaseVolume increases the volume by 10%
func (*SpotifyState) Mute ¶
func (s *SpotifyState) Mute(ctx context.Context) tea.Cmd
Mute toggles the mute state of the player
func (*SpotifyState) PausePlayback ¶
func (s *SpotifyState) PausePlayback(ctx context.Context) tea.Cmd
func (*SpotifyState) PreviousTrack ¶
func (s *SpotifyState) PreviousTrack(ctx context.Context) tea.Cmd
This doesn't work as of right now either I need to manually keep state of prior songs or convert to the context autoplay approach
func (*SpotifyState) SearchEverything ¶
func (*SpotifyState) SelectDevice ¶
func (*SpotifyState) SelectPlaylist ¶
func (s *SpotifyState) SelectPlaylist(playlistID string) tea.Cmd
func (*SpotifyState) SetSelectedID ¶
func (s *SpotifyState) SetSelectedID(id spotify.ID)
func (*SpotifyState) StartPlayback ¶
func (s *SpotifyState) StartPlayback(ctx context.Context) tea.Cmd
func (*SpotifyState) ToggleRepeatMode ¶
func (s *SpotifyState) ToggleRepeatMode(ctx context.Context) tea.Cmd
func (*SpotifyState) ToggleShuffleMode ¶
func (s *SpotifyState) ToggleShuffleMode(ctx context.Context) tea.Cmd
type TracksUpdatedMsg ¶
type TracksUpdatedMsg struct {
SourceID spotify.ID
Tracks []spotify.SimpleTrack
NextPage *spotify.PlaylistItemPage
}
Click to show internal directories.
Click to hide internal directories.