util

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Seasons = []string{"Winter", "Spring", "Summer", "Fall"}

Functions

func BuildEntryChoiceString

func BuildEntryChoiceString(e *api.AnimeThemeEntry) string

BuildEntryChoiceString builds a string to be shown to user in selection displaying all information about an entry

func BuildThemeString

func BuildThemeString(t *api.AnimeTheme) string

BuildThemeString builds a string displaying information about a theme e.g. OP1 sister's noise [1-16] 1080p BD Creditless

It also displays additional information about entry and video (e.g. resolution, episodes) if there's only one of them.

func BuildVideoChoiceString

func BuildVideoChoiceString(v *api.Video) string

BuildVideoChoiceString builds a string to be shown to user in selection displaying all information about a video

func HasNextPage

func HasNextPage(links *api.Links) bool

func SimpleSelection

func SimpleSelection(title string, items []string) int

SimpleSelection shows a choice of items and returns the index of the selected item

Types

type CurrentSeason

type CurrentSeason struct {
	Season int
	Year   int
	Page   int
}

type Flags

type Flags struct {
	OnlyOpenings bool
	OnlyEndings  bool
	OpeningN     uint
	EndingN      uint
	First        bool
}

type Interface

type Interface struct {
	Player        player
	Flags         Flags
	CurrentSeason CurrentSeason
	Exit          func()
}

I don't know how to call it, so I'll call it Interface (as an Interface to interact with utils)

func NewInterface

func NewInterface(flags Flags) Interface

NewInterface creates a new working Interface to use utils

func (Interface) AskEntries

func (a Interface) AskEntries(entries []api.AnimeThemeEntry)

func (Interface) AskSeason

func (a Interface) AskSeason()

func (Interface) AskThemes

func (a Interface) AskThemes(anime api.Anime)

func (Interface) AskVideos

func (a Interface) AskVideos(videos []api.Video)

func (Interface) FetchCurrentPage

func (a Interface) FetchCurrentPage() *api.AnimeSearch

FetchPage returns results from current page

type Real

type Real struct{}

func (Real) Play

func (Real) Play(video *api.Video)

Jump to

Keyboard shortcuts

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