Documentation ¶
Index ¶
- func NewRatedSubtitles(media types.Media, e types.Evaluator, subs ...types.Subtitle) types.RatedSubtitleList
- func NewSubtitlesFromInterface(subs ...interface{}) (l types.SubtitleList, err error)
- func Subtitles(subs ...types.Subtitle) types.SubtitleList
- type LocalMedia
- func (l *LocalMedia) Add(m types.LocalMedia)
- func (l *LocalMedia) Filter(p types.MediaFilter) types.LocalMediaList
- func (l *LocalMedia) FilterEpisodes() types.LocalMediaList
- func (l *LocalMedia) FilterModified(d time.Duration) types.LocalMediaList
- func (l *LocalMedia) FilterMovies() types.LocalMediaList
- func (l *LocalMedia) FilterSubtitles() types.LocalMediaList
- func (l *LocalMedia) FilterVideo() types.VideoList
- func (l *LocalMedia) Len() int
- func (l *LocalMedia) List() []types.LocalMedia
- func (l *LocalMedia) MarshalJSON() (b []byte, err error)
- type RatedSubtitles
- type Video
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRatedSubtitles ¶
func NewRatedSubtitles(media types.Media, e types.Evaluator, subs ...types.Subtitle) types.RatedSubtitleList
NewRatedSubtitles returns a new subtitles collection
func NewSubtitlesFromInterface ¶
func NewSubtitlesFromInterface(subs ...interface{}) (l types.SubtitleList, err error)
NewSubtitlesFromInterface construct a subtitle list from interface values
Types ¶
type LocalMedia ¶
type LocalMedia struct {
// contains filtered or unexported fields
}
LocalMedia is a list of locally stored media
func NewLocalMedia ¶
func NewLocalMedia(media ...types.LocalMedia) *LocalMedia
NewLocalMedia return a new local media list from its arguments
func (*LocalMedia) Add ¶
func (l *LocalMedia) Add(m types.LocalMedia)
Add adds new local media to the list
func (*LocalMedia) Filter ¶
func (l *LocalMedia) Filter(p types.MediaFilter) types.LocalMediaList
Filter return the list of local media which satisfies some predicate
func (*LocalMedia) FilterEpisodes ¶
func (l *LocalMedia) FilterEpisodes() types.LocalMediaList
FilterEpisodes returns only media which is of type episode
func (*LocalMedia) FilterModified ¶
func (l *LocalMedia) FilterModified(d time.Duration) types.LocalMediaList
FilterModified returns only media which has been modified since some duration
func (*LocalMedia) FilterMovies ¶
func (l *LocalMedia) FilterMovies() types.LocalMediaList
FilterMovies return only media which is of type movie
func (*LocalMedia) FilterSubtitles ¶
func (l *LocalMedia) FilterSubtitles() types.LocalMediaList
FilterSubtitles returns only media which is of type subtitles
func (*LocalMedia) FilterVideo ¶
func (l *LocalMedia) FilterVideo() types.VideoList
FilterVideo returns only media which is of type video (e.g. not subtites)
func (*LocalMedia) List ¶
func (l *LocalMedia) List() []types.LocalMedia
List returns the list of localmedia as a plain slice
func (*LocalMedia) MarshalJSON ¶
func (l *LocalMedia) MarshalJSON() (b []byte, err error)
MarshalJSON returns a JSON representation of the media list
type RatedSubtitles ¶
type RatedSubtitles []types.RatedSubtitle
RatedSubtitles is a subtitle which is rated by some score
func (RatedSubtitles) Best ¶
func (s RatedSubtitles) Best() types.RatedSubtitle
Best returns the best matching subtitle
func (RatedSubtitles) FilterScore ¶
func (s RatedSubtitles) FilterScore(score float32) types.RatedSubtitleList
FilterScore return all subtitles with score greater than or equal to some value
func (RatedSubtitles) Len ¶
func (s RatedSubtitles) Len() int
func (RatedSubtitles) Less ¶
func (s RatedSubtitles) Less(i, j int) bool
func (RatedSubtitles) List ¶
func (s RatedSubtitles) List() []types.RatedSubtitle
List returns the list of subtitles as a slice
func (RatedSubtitles) Swap ¶
func (s RatedSubtitles) Swap(i, j int)
type Video ¶
type Video struct {
// contains filtered or unexported fields
}
Video is a list of video media
func (*Video) FilterMissingSubs ¶
FilterMissingSubs returns a filtered list of video media which does not satisfy one or more of the subtitle languages in the input set. A language is satisfied if a subtitle with that language can be found on disk relative to the location of the video media