datastructure

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2020 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ItemTypeBook    ItemType = "book"
	ItemTypeFilm             = "film"
	ItemTypeTvserie          = "tvserie"
	ItemTypeUnkown           = "unknown"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Experiences

type Experiences struct {
	List  []ExperiencesEntry
	Page  int
	Pages int
	Query string
}

func (Experiences) NextPage

func (e Experiences) NextPage() int

func (Experiences) PrevPage

func (e Experiences) PrevPage() int

type ExperiencesEntry

type ExperiencesEntry struct {
	ItemInfo
	Type     string
	Id       string
	Code     string
	Datetime time.Time
}

func (ExperiencesEntry) FormatDatetime

func (e ExperiencesEntry) FormatDatetime(strings i18n.Translation) string

type Item

type Item interface {
	GetItemInfo() ItemInfo
	GetItemType() ItemType
}

type ItemInfo

type ItemInfo struct {
	Cover      string
	Status     string
	Title      string
	YearStart  int
	YearEnd    int
	BasedOn    string
	Genres     string
	Runtime    int
	Collection int
	Part       int
	Episodes   int
}

func (ItemInfo) GetGenres

func (i ItemInfo) GetGenres(genres map[int]string) string

func (ItemInfo) IsUnreleased

func (i ItemInfo) IsUnreleased(itemType ItemType) bool

type ItemType

type ItemType string

type List

type List interface {
	SetGenres(map[int]string)
	GetType() ItemType
}

type TvQueue

type TvQueue struct {
	List   []TvQueueEntry
	Page   int
	Pages  int
	Genres map[int]string
	Query  string
}

func (*TvQueue) GetType

func (q *TvQueue) GetType() ItemType

func (TvQueue) NextPage

func (q TvQueue) NextPage() int

func (TvQueue) PrevPage

func (q TvQueue) PrevPage() int

func (*TvQueue) SetGenres

func (q *TvQueue) SetGenres(m map[int]string)

type TvQueueEntry

type TvQueueEntry struct {
	ItemInfo
	Id              string
	HasPrevious     bool
	WatchedEpisodes int
	SkippedEpisodes int
}

func (TvQueueEntry) CalculateProgress

func (e TvQueueEntry) CalculateProgress() int

func (TvQueueEntry) GetYears

func (e TvQueueEntry) GetYears() string

type ValueError

type ValueError struct {
	Message string
}

func (ValueError) Error

func (e ValueError) Error() string

type Watchlist

type Watchlist struct {
	List   []WatchlistEntry
	Page   int
	Pages  int
	Genres map[int]string
	Query  string
}

func (*Watchlist) GetType

func (w *Watchlist) GetType() ItemType

func (Watchlist) NextPage

func (w Watchlist) NextPage() int

func (Watchlist) PrevPage

func (w Watchlist) PrevPage() int

func (*Watchlist) SetGenres

func (w *Watchlist) SetGenres(m map[int]string)

type WatchlistEntry

type WatchlistEntry struct {
	ItemInfo
	Id          string
	HasPrevious bool
}

Jump to

Keyboard shortcuts

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