list

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: 8 Imported by: 0

Documentation

Index

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

func Subtitles

func Subtitles(subs ...types.Subtitle) types.SubtitleList

Subtitles creates a new list of subtitles from variadic argument

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

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) Len

func (l *LocalMedia) Len() int

Len returns the number of media in the list

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

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 NewVideo

func NewVideo(video ...types.Video) *Video

NewVideo creates a new list of video media

func (*Video) FilterMissingSubs

func (l *Video) FilterMissingSubs(lang set.Interface) (types.VideoList, error)

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

func (*Video) Len

func (l *Video) Len() int

Len returns the length of the video list

func (*Video) List

func (l *Video) List() []types.Video

List returns the slice representation of the video list

Jump to

Keyboard shortcuts

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