streams

package
v0.0.0-...-1d4877a Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2019 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ServerStaticHtml = `` /* 15453-byte string literal not displayed */

Functions

func NewLinkIdentifier

func NewLinkIdentifier(identifier *Identifier, linkId int) (string, error)

Types

type API

type API struct {
	Config              config.Config
	Jobs                *JobPool
	HtmlContent         func() []byte
	LinkSet             func() *LinkSet
	LinkSetRefresh      func()
	MarkWatched         func([]string) ([]string, []string)
	ExecuteLinkAction   func(config.StreamAction, *Identifier, int) *Job
	ExecuteGlobalAction func(config.StreamAction) *Job
	ResolveLink         func(linkId int) (string, error)
}

func (*API) Run

func (a *API) Run(listen string) error

noinspection ALL

type AvailableSeriesResponse

type AvailableSeriesResponse struct {
	Series []*Series `json:"series"`
}

type Episode

type Episode struct {
	ID          int     `json:"id"`
	Series      int     `json:"series"`
	Season      int     `json:"season"`
	Episode     int     `json:"episode"`
	German      string  `json:"german"`
	English     string  `json:"english"`
	Description string  `json:"description"`
	Links       []*Link `json:"links"`
	Language    struct {
		German  bool `json:"german"`
		English bool `json:"english"`
		GerSub  bool `json:"ger-sub"`
	} `json:"language"`
}

func (Episode) LinksInLanguage

func (e Episode) LinksInLanguage(language int) []*Link

type Identifier

type Identifier struct {
	Series      string `json:"series"`
	SeriesSlug  string `json:"series_slug"`
	SeriesId    int    `json:"series_id"`
	Language    string `json:"language"`
	Season      int    `json:"season"`
	Episode     int    `json:"episode"`
	EpisodeName string `json:"episode_name"`
}

func IdentifierFromString

func IdentifierFromString(id string) (*Identifier, error)

func LinkIdentifierFromString

func LinkIdentifierFromString(idString string) (*Identifier, int, error)

func NewIdentifier

func NewIdentifier(series string, seriesSlug string, seriesId int, language string, season int, episode int, name string) *Identifier

func (*Identifier) AsString

func (i *Identifier) AsString() (string, error)

type Job

type Job struct {
	Id       string `json:"id"`
	Running  bool   `json:"running"`
	Finished bool   `json:"finished"`
	Error    error  `json:"error"`
	// contains filtered or unexported fields
}

func NewJob

func NewJob(runnable Runnable) *Job

func (*Job) Response

func (j *Job) Response() map[string]interface{}

func (*Job) Run

func (j *Job) Run()

type JobPool

type JobPool struct {
	// contains filtered or unexported fields
}

func NewJobPool

func NewJobPool() *JobPool

func (*JobPool) Get

func (jp *JobPool) Get(id string) (*Job, bool)

func (*JobPool) Set

func (jp *JobPool) Set(id string, job *Job)
type Link struct {
	ID          int    `json:"id"`
	Link        string `json:"link"`
	Hoster      string `json:"hoster"`
	HosterTitle string `json:"hosterTitle"`
	Language    int    `json:"language"`
}

type LinkSet

type LinkSet struct {
	// contains filtered or unexported fields
}

func NewLinkSet

func NewLinkSet(config config.Config, streams *Streams, index *index.SeriesIndex) *LinkSet

func (*LinkSet) Entries

func (l *LinkSet) Entries() []*LinkSetEntry

func (*LinkSet) GrabLinksFor

func (l *LinkSet) GrabLinksFor(watched []WatchedSeries)

func (*LinkSet) GroupedEntries

func (l *LinkSet) GroupedEntries() map[string][]*LinkSetEntry

type LinkSetEntry

type LinkSetEntry struct {
	Id          string              `json:"id"`
	Series      string              `json:"series"`
	Language    string              `json:"language"`
	Season      int                 `json:"season"`
	Episode     int                 `json:"episode"`
	EpisodeId   int                 `json:"episode_id"`
	EpisodeName string              `json:"episode_name"`
	Filename    string              `json:"filename"`
	Links       []*LinkSetEntryLink `json:"links"`
}
type LinkSetEntryLink struct {
	Id     string `json:"id"`
	Hoster string `json:"hoster"`
	Link   string `json:"link"`
}

type LoginResponse

type LoginResponse struct {
	Avatar   string `json:"avatar"`
	Session  string `json:"session"`
	Success  bool   `json:"success"`
	UID      int    `json:"uid"`
	UserLink string `json:"userlink"`
	Username string `json:"username"`
}

type Runnable

type Runnable func(io.Writer) error

type Series

type Series struct {
	Id   int    `json:"id"`
	Name string `json:"name"`
	Link string `json:"link"`
}
func (s Series) AbsoluteLink() string

type SeriesWithEpisodesResponse

type SeriesWithEpisodesResponse struct {
	Series   []*Series  `json:"series"`
	Episodes []*Episode `json:"episodes"`
}

type SeriesWithSeasonsResponse

type SeriesWithSeasonsResponse struct {
	Series  []*Series `json:"series"`
	Seasons []int     `json:"seasons"`
}

type Streams

type Streams struct {
	Config config.Config
	// contains filtered or unexported fields
}

func NewStreams

func NewStreams(config config.Config) *Streams

func (*Streams) AvailableSeries

func (s *Streams) AvailableSeries() []*Series

func (*Streams) Episodes

func (s *Streams) Episodes(series *Series, season int) []*Episode

func (*Streams) LinkUrl

func (s *Streams) LinkUrl(linkId int) string

func (*Streams) Login

func (s *Streams) Login(email string, password string) (string, error)
func (s *Streams) ResolveLink(linkId int, session string) (string, error)

func (*Streams) Seasons

func (s *Streams) Seasons(series *Series) []int

type WatchedSeries

type WatchedSeries struct {
	Series            *Series
	SeriesNameInIndex string
	SeriesLanguages   map[string]int
}

Jump to

Keyboard shortcuts

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