types

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2020 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIKeys added in v1.0.0

type APIKeys interface {
	TheTVDB() string
	TheMovieDB() string
}

APIKeys is the interface for configuration of 3rd party APIs

type App

type App interface {
	Provider
	http.Handler
	Config() Config
	Scrapers() []Scraper
	FindMedia(...string) (LocalMediaList, error)
	DownloadSubtitles(LocalMediaList, set.Interface, chan<- *notify.Entry) ([]LocalSubtitle, error)
	RenameMedia(LocalMediaList) error
	FindArchives(...string) ([]MediaArchive, error)
	ExtractMedia(MediaReadCloser) error
}

App is the interface for the top level capabilities of the application. It is an HTTP handler, a provider (for subtitles) and a CLI application. It means App can both be used as a HTTP server and a CLI application.

type Config added in v0.2.0

type Config interface {
	Providers() []Provider
	Scrapers() []Scraper
	Languages() set.Interface
	Impaired() bool
	Limit() int
	Modified() time.Duration
	Dry() bool
	Score() int
	Delay() time.Duration
	Force() bool
	Config() string
	Logfile() string
	Verbose() bool
	Strict() bool
	Plugins() []Plugin
	APIKeys() APIKeys
	Movies() MediaConfig
	TVShows() MediaConfig
	MediaFilter() MediaFilter
	RenameAction() string
	Evaluator() Evaluator
	ProxyPath() string
}

Config is the interface for application configuration

type Downloadable

type Downloadable interface {
	Download() (io.ReadCloser, error)
}

Downloadable is an interface for media that can be downloaded from the internet

type Episode

type Episode interface {
	Metadata
	TVShow() string
	EpisodeName() string
	Episode() int
	Season() int
}

Episode interface is for TV show type material

type Evaluator

type Evaluator interface {
	Evaluate(Media, Media) float32
}

Evaluator determines how well two media types are alike

type Linker

type Linker interface {
	Link() string
}

Linker is an object which can be fetched from the internet

type List

type List interface {
	Len() int
}

List interface describes all common properties of lists

type Local added in v0.2.0

type Local interface {
	os.FileInfo
	Pather
}

Local is an interface for media content which is stored on disk

type LocalMedia

type LocalMedia interface {
	Local
	Media
}

LocalMedia is an interface for media found locally on disk

type LocalMediaList

type LocalMediaList interface {
	List
	Add(LocalMedia)
	List() []LocalMedia
	Filter(MediaFilter) LocalMediaList
	FilterModified(time.Duration) LocalMediaList
	FilterVideo() VideoList
	FilterMovies() LocalMediaList
	FilterEpisodes() LocalMediaList
	FilterSubtitles() LocalMediaList
}

LocalMediaList is a list of media which can be manipulated

type LocalSubtitle added in v0.2.0

type LocalSubtitle interface {
	Local
	Subtitle
}

LocalSubtitle is an subtitle which is stored on disk

type Media

type Media interface {
	Meta() Metadata
	Merge(Media) error
	String() string
	Identity() string
	Similar(Media) bool
	TypeMovie() (Movie, bool)
	TypeEpisode() (Episode, bool)
	TypeSubtitle() (Subtitle, bool)
}

Media is an interface for movies and TV shows

type MediaArchive added in v1.0.0

type MediaArchive interface {
	Next() (MediaReadCloser, error)
	io.Closer
}

MediaArchive is an interface for media sourced from archives

type MediaConfig added in v1.0.0

type MediaConfig interface {
	Directory() string
	Template() *template.Template
}

MediaConfig is the configuration interface for media collections

type MediaFilter added in v1.0.0

type MediaFilter func(Media) bool

MediaFilter is used to filter out local media

type MediaReadCloser added in v1.0.0

type MediaReadCloser interface {
	os.FileInfo
	Media
	io.ReadCloser
}

MediaReadCloser is an interface for media from streams

type Metadata

type Metadata interface {
	Group() string
	Codec() codec.Tag
	Quality() quality.Tag
	Source() source.Tag
	Misc() misc.List
	AllTags() []string
}

Metadata is an interface metadata information

type Movie

type Movie interface {
	Metadata
	MovieName() string
	Year() int
}

Movie interface is for movie type media material

type OnlineSubtitle

type OnlineSubtitle interface {
	Linker
	Downloadable
	Subtitle
}

OnlineSubtitle is a subtitle obtained from the internet and can be downloaded and stored on disk

type Pather added in v1.0.0

type Pather interface {
	Path() string
}

Pather is an interface for resources which can be accessed in a local path

type Plugin added in v0.2.0

type Plugin interface {
	Name() string
	Run(LocalSubtitle) error
}

Plugin is an interface for external functionality

type Provider

type Provider interface {
	SearchSubtitles(LocalMedia) ([]OnlineSubtitle, error)
	ResolveSubtitle(Linker) (Downloadable, error)
}

Provider interfaces with subtitles websites to provide subtitles

type Rateable added in v1.0.0

type Rateable interface {
	Score() float32
}

Rateable is a interface for types which has been rated by some metric

type RatedSubtitle added in v1.0.0

type RatedSubtitle interface {
	Rateable
	Subtitle() Subtitle
}

RatedSubtitle is a subtitle which has been rated by how well it matches another media type (i.e. how similar it is so another media item). Subtitles with a high score has a high probability of being synchronized with the media

type RatedSubtitleList added in v1.0.0

type RatedSubtitleList interface {
	List
	List() []RatedSubtitle
	Best() RatedSubtitle
	FilterScore(float32) RatedSubtitleList
}

RatedSubtitleList is a collection of subtitle ordered by rating

type Scraper added in v1.0.0

type Scraper interface {
	Scrape(Media) (Media, error)
}

Scraper interfaces with 3rd party APIs to scrape meta data

type Subtitle

type Subtitle interface {
	ForMedia() Media
	Language() language.Tag
	HearingImpaired() bool
}

Subtitle can be downloaded

type SubtitleList

type SubtitleList interface {
	List
	Add(...Subtitle)
	List() []Subtitle
	LanguageSet() set.Interface
	FilterLanguage(language.Tag) SubtitleList
	HearingImpaired(bool) SubtitleList
	RateByMedia(Media, Evaluator) RatedSubtitleList
}

SubtitleList is a collection of subtitles

type Video added in v1.0.0

type Video interface {
	LocalMedia
	ExistingSubtitles() (SubtitleList, error)
	SaveSubtitle(io.Reader, language.Tag) (LocalSubtitle, error)
}

Video is an interface for media which can have subtitles

type VideoList added in v1.0.0

type VideoList interface {
	List
	List() []Video
	FilterMissingSubs(set.Interface) (VideoList, error)
}

VideoList is a list of video

Jump to

Keyboard shortcuts

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