library

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FetchLibraryItemsMsg

type FetchLibraryItemsMsg struct {
	Page  int
	Limit int
}

FetchLibraryItemsMsg is the command payload to request a page of items.

type GoBackMsg

type GoBackMsg struct{}

GoBackMsg requests navigating back from the library screen.

type KeyMap

type KeyMap struct {
	Enter    key.Binding
	Back     key.Binding
	NextLib  key.Binding
	PageUp   key.Binding
	PageDown key.Binding
	Series   key.Binding
	Select   key.Binding
}

KeyMap defines keybindings for the library screen.

func DefaultKeyMap

func DefaultKeyMap() KeyMap

DefaultKeyMap returns the default keybindings for the library screen.

type LibraryItemsMsg

type LibraryItemsMsg struct {
	Items     []abs.LibraryItem
	Total     int
	Page      int
	LibraryID string
	Err       error
}

LibraryItemsMsg carries the result of fetching library items.

type ListItem added in v0.6.0

type ListItem struct {
	Item abs.LibraryItem
}

ListItem wraps a LibraryItem to implement the bubbles list.Item interface. Used by library and search screens for items without progress tracking.

func (ListItem) Description added in v0.6.0

func (i ListItem) Description() string

func (ListItem) FilterValue added in v0.6.0

func (i ListItem) FilterValue() string

func (ListItem) Title added in v0.6.0

func (i ListItem) Title() string

type Model

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

Model is the bubbletea model for the library screen.

func New

func New(styles ui.Styles, client *cache.Client, searchCache *search.Cache, libraryID string, libraries []abs.Library) Model

New creates a new library screen model.

func (*Model) Configure

func (m *Model) Configure(libraryID string, libraries []abs.Library)

Configure updates the active library context while preserving cached pages.

func (Model) Error

func (m Model) Error() error

Error returns the last error, if any.

func (Model) HasActiveFilter added in v0.5.0

func (m Model) HasActiveFilter() bool

func (Model) Init

func (m Model) Init() tea.Cmd

Init returns the initial command that fetches the first page of library items.

func (*Model) InvalidateLibrary added in v0.3.0

func (m *Model) InvalidateLibrary(libraryID string)

InvalidateLibrary removes cached library pages for a library.

func (Model) IsFiltering added in v0.5.0

func (m Model) IsFiltering() bool

func (Model) Items

func (m Model) Items() []abs.LibraryItem

Items returns the current library items.

func (Model) Loading

func (m Model) Loading() bool

Loading returns whether data is being fetched.

func (Model) Page

func (m Model) Page() int

Page returns the current page number.

func (*Model) ReloadCmd added in v0.4.0

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

ReloadCmd forces a fresh data fetch for the current library and resets to page 0.

func (*Model) RemoveEpisode added in v0.4.0

func (m *Model) RemoveEpisode(itemID, episodeID string)

RemoveEpisode removes an episode from items, and drops the item entirely if it was featured as a recent episode.

func (*Model) RemoveItem added in v0.4.0

func (m *Model) RemoveItem(itemID string)

RemoveItem removes an item from visible and cached items.

func (*Model) ReplaceItem added in v0.3.0

func (m *Model) ReplaceItem(updated abs.LibraryItem)

ReplaceItem updates matching visible and cached items with fresh metadata.

func (Model) SelectedLibraryID added in v0.3.0

func (m Model) SelectedLibraryID() string

SelectedLibraryID returns the ID of the currently selected library, or empty string.

func (Model) SelectedLibraryMediaType

func (m Model) SelectedLibraryMediaType() string

SelectedLibraryMediaType returns the media type of the current library, or empty string.

func (Model) SelectedPaletteActions added in v0.2.0

func (m Model) SelectedPaletteActions() []components.PaletteItem

func (*Model) SetSize

func (m *Model) SetSize(width, height int)

SetSize updates the terminal dimensions for the library screen.

func (Model) TotalItems

func (m Model) TotalItems() int

TotalItems returns the total number of items available.

func (Model) Update

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

Update handles messages for the library screen.

func (Model) View

func (m Model) View() string

View renders the library screen.

type NavigateDetailMsg struct {
	Item abs.LibraryItem
}

NavigateDetailMsg requests navigation to the detail screen for an item.

type NavigateSeriesListMsg struct {
	LibraryID   string
	LibraryName string
}

NavigateSeriesListMsg requests navigation to the current library's series browser.

type SearchCacheReadyMsg added in v0.4.0

type SearchCacheReadyMsg struct{}

SearchCacheReadyMsg signals that the search cache has finished building its snapshot.

Jump to

Keyboard shortcuts

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