ui

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2026 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Overview

Package ui is the Bubble Tea TUI for OpenDeezer: a menu/list browser with an always-visible now-playing footer. Network calls run as tea.Cmds.

Index

Constants

This section is empty.

Variables

View Source
var Version = "dev"

Version is the app version, set from main at startup.

Functions

func LoadARL

func LoadARL() string

LoadARL resolves the Deezer ARL from, in order: $DEEZER_ARL, then ~/.config/opendeezer/arl.txt. Returns "" if neither is set.

func LoadQuality

func LoadQuality() int

LoadQuality reads the persisted quality level: 0=Normal, 1=High, 2=HiFi.

func SaveARL

func SaveARL(arl string) error

SaveARL writes the ARL to ~/.config/opendeezer/arl.txt (0600).

func SaveQuality

func SaveQuality(level int) error

SaveQuality persists the quality level (0..2).

Types

type Model

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

Model is the root Bubble Tea model.

func New

func New(client *deezer.Client, player *audio.Player) *Model

New builds the root model.

func (*Model) Init

func (m *Model) Init() tea.Cmd

Init kicks off login + the UI tick.

func (*Model) StartMedia

func (m *Model) StartMedia(send func(tea.Msg))

StartMedia wires OS media controls (MPRIS) to the running program. Commands from the desktop are delivered as mediaCmdMsg via the program's Send so they run on the Bubble Tea update loop. Call after tea.NewProgram, before Run.

func (*Model) Update

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

Update handles all messages.

func (*Model) View

func (m *Model) View() string

View renders the whole screen.

Jump to

Keyboard shortcuts

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