Documentation
¶
Index ¶
- Variables
- func DeleteKittyImageCmd(id uint32) tea.Cmd
- func DetectKittySupport() bool
- func DetectTrueColorSupport() bool
- func DownloadCoverImage(url string) (image.Image, string, error)
- func RenderCoverImage(img image.Image, maxWidth int, protocol Protocol, cachePath string, ...) string
- func ResizeImage(img image.Image, maxWidth, maxHeight int) image.Image
- type AniListLoginMsg
- type CoverImageLoadedMsg
- type EpisodeMetadataFetchTriggered
- type EpisodeMetadataLoadedMsg
- type EpisodeMetadataPanel
- type EpisodeState
- type EpisodesLoadedMsg
- type KittyRenderResult
- type MetadataBatchLoadedMsg
- type MetadataFetchTriggered
- type MetadataLoadedMsg
- type MetadataPanel
- type PlayStreamMsg
- type Protocol
- type SearchErrorMsg
- type SearchModel
- type SearchResultsMsg
- type SearchState
- type SelectionResult
- type SettingsState
- type TUIErrorMsg
- type TrackingStatusLoadedMsg
- type TrackingUpdateMsg
- type UpdateCheckMsg
- type UpdateCompleteMsg
Constants ¶
This section is empty.
Variables ¶
var Theme = struct { Primary color.Color Secondary color.Color Border color.Color Text color.Color Faint color.Color Success color.Color Warning color.Color Error color.Color Gradient []color.Color }{ Primary: lipgloss.Color("#00d4ff"), Secondary: lipgloss.Color("#9d4edd"), Border: lipgloss.Color("#444444"), Text: lipgloss.Color("#e4e4e7"), Faint: lipgloss.Color("#666666"), Success: lipgloss.Color("#10b981"), Warning: lipgloss.Color("#f59e0b"), Error: lipgloss.Color("#ef4444"), Gradient: []color.Color{ lipgloss.Color("#00d4ff"), lipgloss.Color("#00bfff"), lipgloss.Color("#6366f1"), lipgloss.Color("#a855f7"), lipgloss.Color("#d946ef"), lipgloss.Color("#f43f5e"), }, }
Theme holds all color constants for the TUI.
Functions ¶
func DeleteKittyImageCmd ¶ added in v1.6.0
DeleteKittyImageCmd returns a tea.Cmd that deletes a Kitty graphics image from terminal memory. Should be called when leaving the detail view or switching to a different image.
func DetectKittySupport ¶ added in v1.6.0
func DetectKittySupport() bool
DetectKittySupport checks if the terminal supports Kitty graphics protocol.
func DetectTrueColorSupport ¶
func DetectTrueColorSupport() bool
DetectTrueColorSupport checks if the terminal supports 24-bit color.
func DownloadCoverImage ¶
DownloadCoverImage downloads an image from a URL and returns both the decoded image and the local cache file path.
func RenderCoverImage ¶
func RenderCoverImage(img image.Image, maxWidth int, protocol Protocol, cachePath string, maxRows int) string
RenderCoverImage renders an image for the terminal, using the best available protocol. For Kitty protocol, returns the placeholder text (transmit seq is sent separately). maxRows limits the image height (0 = use protocol default).
Types ¶
type AniListLoginMsg ¶ added in v1.6.0
type AniListLoginMsg struct {
Err error
}
AniListLoginMsg is sent when the AniList OAuth login flow completes.
type CoverImageLoadedMsg ¶
type CoverImageLoadedMsg struct {
Rendered string // Rendered image (SGR half-block or Unicode placeholder text)
KittyTransmitSeq string // APC sequence for Kitty graphics (empty for non-Kitty)
KittyImageID uint32 // Image ID for Kitty graphics cleanup
Index int // Result index this cover belongs to
}
CoverImageLoadedMsg is sent when a cover image has been downloaded and rendered.
type EpisodeMetadataFetchTriggered ¶
type EpisodeMetadataFetchTriggered struct {
Index int
}
type EpisodeMetadataLoadedMsg ¶
type EpisodeMetadataLoadedMsg struct {
Metadata *EpisodeMetadataPanel
Index int
CacheKey string `json:"-"`
RawEpisode *jikan.Episode `json:"-"`
}
type EpisodeMetadataPanel ¶
type EpisodeMetadataPanel struct {
Title string
TitleJapanese string
Aired string
Score float64
Filler bool
Recap bool
Synopsis string
Duration int
}
EpisodeMetadataPanel holds metadata for a single episode
type EpisodeState ¶
type EpisodeState struct {
AnimeID string
Episodes []string
EpisodeTitles []string
Selected int
Loading bool
Err error
EpisodeMetadata *EpisodeMetadataPanel
MetadataLoading bool
Playing bool
TrackingStatus string // "CURRENT", "COMPLETED", etc.
TrackingProgress int
}
EpisodeState holds the state for episode selection
func NewEpisodeState ¶
func NewEpisodeState() *EpisodeState
NewEpisodeState creates a new episode state
type EpisodesLoadedMsg ¶
type KittyRenderResult ¶ added in v1.6.0
KittyRenderResult holds the output of rendering an image with the Kitty graphics protocol. TransmitSeq is sent via tea.Raw() to transmit the image to terminal memory. Placeholder is text with Unicode placeholders that tells the terminal where to display the stored image. ImageID is used to delete the image from terminal memory when no longer needed.
func RenderCoverImageKitty ¶ added in v1.6.0
func RenderCoverImageKitty(img image.Image, maxWidth int, protocol Protocol, cachePath string, maxRows int) KittyRenderResult
RenderCoverImageKitty renders an image using Kitty protocol and returns the full result including the APC transmit sequence. For non-Kitty protocols, the TransmitSeq will be empty.
func RenderKittyCover ¶ added in v1.6.0
func RenderKittyCover(img image.Image, cols, rows int) KittyRenderResult
RenderKittyCover renders an image using the Kitty graphics protocol with Unicode placeholders. Returns the APC transmit sequence (for tea.Raw) and the placeholder text (for view.Content).
type MetadataBatchLoadedMsg ¶
type MetadataBatchLoadedMsg struct {
MetadataMap map[int]*MetadataPanel
}
MetadataBatchLoadedMsg carries all metadata for a search result set.
type MetadataFetchTriggered ¶
type MetadataFetchTriggered struct {
Index int
}
type MetadataLoadedMsg ¶
type MetadataLoadedMsg struct {
Metadata *MetadataPanel
Index int
}
MetadataLoadedMsg is sent when a single API source returns.
type MetadataPanel ¶
type MetadataPanel struct {
Title string
TitleEnglish string
TitleNative string
Cover string
CoverImage string // Rendered ANSI cover art (half-block), empty if not available
Year int
Type string
Status string
Episodes int
Score float64
Rank int
Popularity int
Genres []string
Synopsis string
Source string // "Jikan", "AniList", or "Jikan + AniList"
}
MetadataPanel holds merged metadata to display on the right panel
type PlayStreamMsg ¶
type PlayStreamMsg struct{}
type Protocol ¶
type Protocol int
Protocol represents a terminal image rendering protocol.
func DetectTerminalProtocol ¶
func DetectTerminalProtocol() Protocol
DetectTerminalProtocol returns the best image protocol for the current terminal.
Kitty graphics uses Unicode placeholders (\U0010EEEE + combining marks) that survive Bubbletea v2's ultraviolet cell buffer. The image data is transmitted via APC sequences using tea.Raw(), which bypasses the renderer entirely.
type SearchErrorMsg ¶
type SearchErrorMsg struct {
Err error
}
type SearchModel ¶
type SearchModel struct {
// contains filtered or unexported fields
}
func NewSearchModel ¶
func NewSearchModel() *SearchModel
func (*SearchModel) GetSelectedAnime ¶
func (m *SearchModel) GetSelectedAnime() *source.Anime
func (*SearchModel) Init ¶
func (m *SearchModel) Init() tea.Cmd
func (*SearchModel) View ¶
func (m *SearchModel) View() tea.View
type SearchResultsMsg ¶
type SearchState ¶
type SearchState struct {
Query string
Results []*source.Anime
Selected int
Metadata *MetadataPanel
Loading bool
MetadataLoading bool
Err error
TranslationType string
}
SearchState holds the state for the anime search TUI
type SelectionResult ¶
SelectionResult holds the selected anime and episode
func RunSearch ¶
func RunSearch() (*SelectionResult, error)
type SettingsState ¶
type SettingsState struct {
Quality string // "1080p", "720p", "480p", "360p", "auto"
AniskipEnabled bool
Cursor int // 0 = quality, 1 = aniskip, 2 = anilist, 3 = update
UpdateStatus string // "", "checking", "updated", "error"
UpdateVersion string // latest version tag, e.g. "v1.7.0"
UpdateError error
}
SettingsState holds the state for the settings popup
type TUIErrorMsg ¶
type TUIErrorMsg struct {
Err error
}
type TrackingStatusLoadedMsg ¶ added in v1.6.0
TrackingStatusLoadedMsg is sent when the current tracking status for an anime is fetched.
type TrackingUpdateMsg ¶ added in v1.6.0
TrackingUpdateMsg is sent after a tracking progress update completes.
type UpdateCheckMsg ¶ added in v1.6.1
UpdateCheckMsg is sent after checking GitHub for the latest release.
type UpdateCompleteMsg ¶ added in v1.6.1
type UpdateCompleteMsg struct {
Err error
}
UpdateCompleteMsg is sent after downloading and installing the update.