Documentation
¶
Index ¶
- type FetchLibraryItemsMsg
- type GoBackMsg
- type KeyMap
- type LibraryItemsMsg
- type ListItem
- type Model
- func (m *Model) Configure(libraryID string, libraries []abs.Library)
- func (m Model) Error() error
- func (m Model) HasActiveFilter() bool
- func (m Model) Init() tea.Cmd
- func (m *Model) InvalidateLibrary(libraryID string)
- func (m Model) IsFiltering() bool
- func (m Model) Items() []abs.LibraryItem
- func (m Model) Loading() bool
- func (m Model) Page() int
- func (m *Model) ReloadCmd() tea.Cmd
- func (m *Model) RemoveEpisode(itemID, episodeID string)
- func (m *Model) RemoveItem(itemID string)
- func (m *Model) ReplaceItem(updated abs.LibraryItem)
- func (m Model) SelectedLibraryID() string
- func (m Model) SelectedLibraryMediaType() string
- func (m Model) SelectedPaletteActions() []components.PaletteItem
- func (m *Model) SetSize(width, height int)
- func (m Model) TotalItems() int
- func (m Model) Update(msg tea.Msg) (Model, tea.Cmd)
- func (m Model) View() string
- type NavigateDetailMsg
- type NavigateSeriesListMsg
- type SearchCacheReadyMsg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FetchLibraryItemsMsg ¶
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 (ListItem) FilterValue ¶ added in v0.6.0
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 ¶
Configure updates the active library context while preserving cached pages.
func (Model) HasActiveFilter ¶ added in v0.5.0
func (*Model) InvalidateLibrary ¶ added in v0.3.0
InvalidateLibrary removes cached library pages for a library.
func (Model) IsFiltering ¶ added in v0.5.0
func (Model) Items ¶
func (m Model) Items() []abs.LibraryItem
Items returns the current library items.
func (*Model) ReloadCmd ¶ added in v0.4.0
ReloadCmd forces a fresh data fetch for the current library and resets to page 0.
func (*Model) RemoveEpisode ¶ added in v0.4.0
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
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
SelectedLibraryID returns the ID of the currently selected library, or empty string.
func (Model) SelectedLibraryMediaType ¶
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) TotalItems ¶
TotalItems returns the total number of items available.
type NavigateDetailMsg ¶
type NavigateDetailMsg struct {
}
NavigateDetailMsg requests navigation to the detail screen for an item.
type NavigateSeriesListMsg ¶
type NavigateSeriesListMsg struct {
}
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.