Documentation
¶
Index ¶
- Constants
- Variables
- func Iso639_3(l string) string
- type APIError
- type AnidbData
- type AnimeTitles
- type Data
- type ErrMsg
- type ImageTransmittedMsg
- type KeyMap
- type LangFilter
- type Model
- type Option
- type Pane
- func (m *Pane) Clear()
- func (m Pane) Data() Data
- func (m Pane) Init() tea.Cmd
- func (m Pane) OpenBrowser() tea.Msg
- func (m *Pane) SetData(d ...Data)
- func (m *Pane) SetErr(e error)
- func (m *Pane) SetHeight(h int)
- func (m *Pane) SetWidth(w int)
- func (m Pane) Update(msg tea.Msg) (Pane, tea.Cmd)
- func (m *Pane) UpdateViewport()
- func (m Pane) View() string
- type Poster
- type RemoteId
- type SearchResult
- type State
- type Styles
- type Title
- type TodoIDs
- type TvdbClient
- type TvdbData
Constants ¶
View Source
const ( MainTitle = "main" OfficialTitle = "official" SynTitle = "syn" ShortTitle = "short" )
View Source
const AnidbImageThumb = "https://cdn-us.anidb.net/images/65/%s.jpg-thumb.jpg"
View Source
const AnidbSeriesUrl = "https://anidb.net/anime/%s"
View Source
const AnidbTitles string = "./animetitles.xml"
View Source
const MasterFile string = "./anime-list-master.xml"
View Source
const NumResults string = "4"
Number of TVDB search results to request
View Source
const TmdbRemoteType int64 = 12
View Source
const TodoFile string = "./anime-list-todo.xml"
View Source
const TvdbApiURL string = "https://api4.thetvdb.com/v4"
View Source
const TvdbSeriesUrl string = "https://thetvdb.com/series/%s"
Variables ¶
View Source
var Keys = &KeyMap{ Commit: key.NewBinding( key.WithKeys("enter", "c"), key.WithHelp("/c", "commit"), ), Next: key.NewBinding( key.WithKeys("space"), key.WithHelp("", "skip"), ), PrevPage: key.NewBinding( key.WithKeys("left", "h"), ), NextPage: key.NewBinding( key.WithKeys("right", "l"), key.WithHelp("h/l ←/→", "page"), ), Edit: key.NewBinding( key.WithKeys("e"), key.WithHelp("e", "edit"), ), Lookup: key.NewBinding( key.WithKeys("i"), key.WithHelp("i", "lookup id"), ), Search: key.NewBinding( key.WithKeys("s"), key.WithHelp("s", "search tvdb"), ), Open: key.NewBinding( key.WithKeys("o"), key.WithHelp("o", "browser"), ), Help: key.NewBinding( key.WithKeys("?", "ctrl+/"), key.WithHelp("?", "toggle help"), ), Lang: key.NewBinding( key.WithKeys("f"), key.WithHelp("f", "langs"), ), Quit: key.NewBinding( key.WithKeys("ctrl+q", "esc", "ctrl+c"), key.WithHelp("ctrl+q/esc", "quit"), ), }
Functions ¶
Types ¶
type APIError ¶
type AnidbData ¶
type AnimeTitles ¶
type AnimeTitles struct {
// contains filtered or unexported fields
}
func LoadTitles ¶
func LoadTitles(path string) (*AnimeTitles, error)
type ImageTransmittedMsg ¶
type ImageTransmittedMsg struct {
// contains filtered or unexported fields
}
type KeyMap ¶
type KeyMap struct {
Commit key.Binding
Next key.Binding
NextPage key.Binding
PrevPage key.Binding
Lookup key.Binding
Search key.Binding
Edit key.Binding
Lang key.Binding
Open key.Binding
Quit key.Binding
Help key.Binding
}
KeyMap implements help.KeyMap from the help bubble
type LangFilter ¶
type LangFilter uint8
const ( LangJa LangFilter = 1 << 0 // 1 0b001 LangKo LangFilter = 1 << 1 // 2 0b010 LangZh LangFilter = 1 << 2 // 4 0b100 LangAll LangFilter = LangJa | LangKo | LangZh )
func (LangFilter) Cycle ¶
func (f LangFilter) Cycle() LangFilter
func (LangFilter) Matches ¶
func (f LangFilter) Matches(lang string) bool
Matches returns true if the language is selected in the filter
type Pane ¶
type Pane struct {
// contains filtered or unexported fields
}
Pane wraps a viewport to display 1 or more sets of Data
func (Pane) OpenBrowser ¶
Open the series site in a browser as a tea.Cmd
func (*Pane) UpdateViewport ¶
func (m *Pane) UpdateViewport()
UpdateViewport refreshes the display of data content in this pane
type Poster ¶
type Poster struct {
Width, Height int
// contains filtered or unexported fields
}
func (Poster) DeleteImage ¶
func (m Poster) DeleteImage()
DeleteImage frees the associated image from the terminal
type SearchResult ¶
Automatically generated with https://github.com/bashtian/jsonutils
type Styles ¶
type Styles struct {
// Doc lg.Style
Pane lg.Style
Body lg.Style
Heading lg.Style
Title lg.Style
Label lg.Style
Page lg.Style
Filter lg.Style
Error lg.Style
Info lg.Style
}
var DefaultStyles Styles = Styles{ Pane: lg.NewStyle(). Border(lg.RoundedBorder()). BorderForeground(lg.Color("245")). Padding(1, 1, 0), Heading: lg.NewStyle(). Bold(true). PaddingBottom(1). Foreground(lg.Magenta), Title: lg.NewStyle(). Bold(true). Foreground(lg.BrightYellow), Label: lg.NewStyle(). MarginRight(2). Bold(true). Foreground(lg.Color("245")), Filter: lg.NewStyle(). Bold(true). Padding(0, 1). AlignHorizontal(lg.Center). Foreground(lg.BrightCyan), Info: lg.NewStyle(). Italic(true). Padding(0, 1). AlignHorizontal(lg.Left). Foreground(lg.White), Error: lg.NewStyle(). Italic(true). Padding(0, 1). AlignHorizontal(lg.Left). Foreground(lg.Red). Faint(true), Page: lg.NewStyle().Foreground(lg.BrightMagenta).SetString("•"), Body: lg.NewStyle().Foreground(lg.NoColor{}), }
type TvdbClient ¶
func NewTvdbClient ¶
func NewTvdbClient() *TvdbClient
NewTvdbClient create a TVDB client. Example from https://req.cool/docs/examples/build-sdk-quickly-with-req
func (*TvdbClient) LoginWithKey ¶
func (c *TvdbClient) LoginWithKey(key string) *TvdbClient
type TvdbData ¶
type TvdbData struct {
// Numeric id
Id string `json:"tvdb_id"`
// Slug is used for direct URL
Slug string `json:"slug"`
Type string `json:"type"`
Name string `json:"name"`
Status string `json:"status"`
FirstAirTime string `json:"first_air_time"`
Year string `json:"year"`
Language string `json:"primary_language"`
Country string `json:"country"`
Director string `json:"director"`
Overview string `json:"overview"`
Network string `json:"network"`
ImageURL string `json:"image_url"`
Thumbnail string `json:"thumbnail"`
Overviews struct {
Eng string `json:"eng"`
Jpn string `json:"jpn"`
}
Translations struct {
Eng string `json:"eng"`
Jpn string `json:"jpn"`
}
Aliases []string `json:"aliases"`
Genres []string `json:"genres"`
Studios []string `json:"studios"`
Companies []string `json:"companies"`
RemoteIds []RemoteId `json:"remote_ids"`
// filled later with image data
ImagePlaceholder string
}
Click to show internal directories.
Click to hide internal directories.