Help us shape the future of Go! Take the 2026 Go Developer Survey

app

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackMsg

type BackMsg struct{}

BackMsg requests navigation back to the previous screen.

type BookDetailLoadedMsg

type BookDetailLoadedMsg struct {
	ItemID string
	Item   *abs.LibraryItem
	Err    error
}

BookDetailLoadedMsg carries an enriched library item fetched from ABS.

type CaptionLoadedMsg added in v0.6.0

type CaptionLoadedMsg struct {
	Generation uint64
	Cues       []captions.Cue
}

CaptionLoadedMsg carries parsed VTT cues for the current play generation.

type EpisodesLoadedMsg

type EpisodesLoadedMsg struct {
	ItemID   string
	Episodes []abs.PodcastEpisode
	Err      error
}

EpisodesLoadedMsg carries podcast episodes fetched from the API.

type KeyMap

type KeyMap struct {
	Quit           key.Binding
	Back           key.Binding
	Help           key.Binding
	ChapterOverlay key.Binding
	Captions       key.Binding
	NextInQueue    key.Binding
	SleepTimer     key.Binding
	GlobalPalette  key.Binding
}

KeyMap defines the global keybindings for the root model.

func DefaultKeyMap

func DefaultKeyMap(cfg config.KeybindsConfig) KeyMap

DefaultKeyMap returns the default keybindings using the given config.

type Model

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

Model is the root application model that manages screen routing.

func New

func New(cfg config.Config, store *db.Store, client *cache.Client, cacheStore *cache.Store) Model

New creates a new root model. If client is non-nil (authenticated), the initial screen is Home; otherwise it starts at Login.

func NewWithPlayer

func NewWithPlayer(cfg config.Config, store *db.Store, client *cache.Client, cacheStore *cache.Store, mpv player.Player) Model

NewWithPlayer creates a new root model with a specific player implementation.

func (Model) ActiveScreen

func (m Model) ActiveScreen() Screen

ActiveScreen returns the currently active screen.

func (Model) BackStack

func (m Model) BackStack() []Screen

BackStack returns a copy of the current back stack.

func (Model) Cleanup

func (m Model) Cleanup()

Cleanup performs synchronous cleanup of playback resources.

func (Model) Init

func (m Model) Init() tea.Cmd

Init returns the initial command for the active screen.

func (Model) Queue

func (m Model) Queue() []QueueEntry

Queue returns a copy of the current playback queue.

func (*Model) SetProgram added in v0.2.0

func (m *Model) SetProgram(p *tea.Program)

SetProgram sets the bubbletea program reference and starts the MPRIS bridge.

func (Model) Update

func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update dispatches messages to the active screen and handles navigation.

func (Model) View

func (m Model) View() string

View composes the header, error banner, active screen, and player footer.

type MprisState added in v0.2.0

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

MprisState holds playback state shared between the Model and MPRIS accessor. The Model writes to it via Update; the MPRIS adapter reads from it via the getter methods. All access is guarded by mu.

func (*MprisState) CanGoNext added in v0.6.0

func (s *MprisState) CanGoNext() bool

func (*MprisState) CanGoPrevious added in v0.6.0

func (s *MprisState) CanGoPrevious() bool

func (*MprisState) CanSeek added in v0.6.0

func (s *MprisState) CanSeek() bool

func (*MprisState) CurrentAuthors added in v0.5.0

func (s *MprisState) CurrentAuthors() []string

func (*MprisState) CurrentItemID added in v0.5.0

func (s *MprisState) CurrentItemID() string

func (*MprisState) CurrentTitle added in v0.5.0

func (s *MprisState) CurrentTitle() string

func (*MprisState) HasActiveItem added in v0.2.0

func (s *MprisState) HasActiveItem() bool

func (*MprisState) IsPaused added in v0.2.0

func (s *MprisState) IsPaused() bool

func (*MprisState) IsPlaying added in v0.2.0

func (s *MprisState) IsPlaying() bool

func (*MprisState) PlayerDuration added in v0.5.0

func (s *MprisState) PlayerDuration() float64

func (*MprisState) PlayerMaximumRate added in v0.6.0

func (s *MprisState) PlayerMaximumRate() float64

func (*MprisState) PlayerMinimumRate added in v0.6.0

func (s *MprisState) PlayerMinimumRate() float64

func (*MprisState) PlayerPosition added in v0.5.0

func (s *MprisState) PlayerPosition() float64

func (*MprisState) PlayerSpeed added in v0.5.0

func (s *MprisState) PlayerSpeed() float64

func (*MprisState) PlayerVolume added in v0.5.0

func (s *MprisState) PlayerVolume() int

func (*MprisState) QueueLength added in v0.2.0

func (s *MprisState) QueueLength() int

func (*MprisState) Update added in v0.5.0

func (s *MprisState) Update(fn func(s *MprisState))

Update runs fn with the write lock held. fn must not call the getter methods on s (or any *MprisState that aliases the same receiver) to avoid deadlocks.

type NavigateMsg struct {
	Screen Screen
}

NavigateMsg requests navigation to a different screen. Data carries optional context (e.g., a library item ID for detail view).

type PaletteContextProvider added in v0.2.0

type PaletteContextProvider interface {
	SelectedPaletteActions() []components.PaletteItem
}

type PlaySessionData

type PlaySessionData struct {
	SessionID        string
	ItemID           string
	EpisodeID        string
	CurrentTime      float64
	SyncedTime       float64 // book position that the server has
	Duration         float64
	Title            string
	Authors          []string
	Chapters         []abs.Chapter
	TrackStartOffset float64
	TrackDuration    float64
	TrackFilename    string
	TranscriptIno    string
}

PlaySessionData carries the data returned from ABS when starting a session.

type PlaySessionMsg

type PlaySessionMsg struct {
	Session   PlaySessionData
	StreamURL string
	AuthToken string
}

PlaySessionMsg is sent after a play session is successfully started on ABS.

type PlaybackErrorMsg

type PlaybackErrorMsg struct {
	Err error
}

PlaybackErrorMsg carries an error from the playback lifecycle.

type PlaybackStoppedMsg

type PlaybackStoppedMsg struct{}

PlaybackStoppedMsg signals that playback cleanup is complete.

type PrewarmDoneMsg added in v0.2.0

type PrewarmDoneMsg struct{}

PrewarmDoneMsg is sent after cache pre-warming completes. No action needed, just used to keep the command chain alive.

type QueueEntry

type QueueEntry struct {
	Item    abs.LibraryItem
	Episode *abs.PodcastEpisode
}

QueueEntry represents a queued book or podcast episode.

type RestorePlaySessionMsg added in v0.1.1

type RestorePlaySessionMsg struct {
	PlaySessionMsg PlaySessionMsg
}

RestorePlaySessionMsg carries a restore-initiated play session that should launch paused.

type RestoreSessionMsg

type RestoreSessionMsg struct {
	Item           *abs.LibraryItem
	Episode        *abs.PodcastEpisode
	SavedEpisodeID string
}

RestoreSessionMsg carries the result of a session restore attempt. If Item is nil, no session was found or the restore failed — the app proceeds to the Home screen as usual.

type Screen

type Screen int

Screen represents a screen identifier in the application.

const (
	ScreenLogin Screen = iota
	ScreenHome
	ScreenLibrary
	ScreenDetail
	ScreenMetadataEdit
	ScreenSeriesList
	ScreenSeries
)

func (Screen) String

func (s Screen) String() string

String returns the display name for a screen.

type SeriesContinueMsg added in v0.2.0

type SeriesContinueMsg struct {
	Item abs.LibraryItem
	Err  error
}

SeriesContinueMsg carries the next book in a series after auto-continue lookup. Empty Item.ID with nil Err means the finished book was the last in the series.

type SessionSyncedMsg added in v0.8.1

type SessionSyncedMsg struct {
	SessionID    string
	NewSessionID string
	CurrentTime  float64
	TimeListened float64
	Err          error
}

SessionSyncedMsg carries the result of a sync of the playback session. NewSessionID is the session that pine opened because the server did not have the session SessionID.

type SleepTimerExpiredMsg

type SleepTimerExpiredMsg struct {
	Generation uint64
}

SleepTimerExpiredMsg fires when the sleep timer reaches zero.

type SyncTickMsg

type SyncTickMsg struct{}

SyncTickMsg fires every 30 seconds to sync playback progress with ABS.

Jump to

Keyboard shortcuts

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