Documentation
¶
Index ¶
- type APIKeys
- type App
- type Config
- type Downloadable
- type Episode
- type Evaluator
- type Linker
- type List
- type Local
- type LocalMedia
- type LocalMediaList
- type LocalSubtitle
- type Media
- type MediaArchive
- type MediaConfig
- type MediaFilter
- type MediaReadCloser
- type Metadata
- type Movie
- type OnlineSubtitle
- type Pather
- type Plugin
- type Provider
- type Rateable
- type RatedSubtitle
- type RatedSubtitleList
- type Scraper
- type Subtitle
- type SubtitleList
- type Video
- type VideoList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 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 LocalMedia ¶
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
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
MediaConfig is the configuration interface for media collections
type MediaFilter ¶ added in v1.0.0
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 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
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 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