media

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2018 License: GPL-3.0 Imports: 18 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsSample

func IsSample(m types.Media) bool

func New

func New(path string) (types.LocalMedia, error)

New parses a file into media attributes

func NewLocalSubtitle

func NewLocalSubtitle(file os.FileInfo) (types.Subtitle, error)

func NewMetadata

func NewMetadata(str string) (types.Metadata, error)

NewMetadata returns a metadata object parsed from the string

Types

type EpisodeMeta

type EpisodeMeta struct {
	Metadata
	// contains filtered or unexported fields
}

EpisodeMeta represents an episode from a TV show

func NewEpisode

func NewEpisode(filename string) (*EpisodeMeta, error)

NewEpisode parses media info from a file

func (*EpisodeMeta) Episode

func (e *EpisodeMeta) Episode() int

Episode is the episode number in the season

func (*EpisodeMeta) MarshalJSON

func (e *EpisodeMeta) MarshalJSON() (b []byte, err error)

func (*EpisodeMeta) Matches

func (e *EpisodeMeta) Matches(types.Subtitle) bool

Matches an episode against a subtitle

func (*EpisodeMeta) Score

func (e *EpisodeMeta) Score(types.Subtitle) float32

Score returns the likelyhood of the subtitle maching the episode

func (*EpisodeMeta) Season

func (e *EpisodeMeta) Season() int

Season is the season number of the show

func (*EpisodeMeta) String

func (e *EpisodeMeta) String() string

func (*EpisodeMeta) TVShow

func (e *EpisodeMeta) TVShow() string

TVShow is the name of the TV show

type File

type File struct {
	os.FileInfo
	types.Media
	// contains filtered or unexported fields
}

func NewFile

func NewFile(file os.FileInfo, meta types.Metadata, path string) *File

func (*File) ExistingSubtitles

func (f *File) ExistingSubtitles() (types.SubtitleList, error)

func (*File) MarshalJSON

func (f *File) MarshalJSON() (b []byte, err error)

func (*File) Path

func (f *File) Path() string

func (*File) SaveSubtitle

func (f *File) SaveSubtitle(s types.Downloadable, lang language.Tag) (types.LocalSubtitle, error)

SaveSubtitle saves the subtitle for the given media to disk

func (*File) String

func (f *File) String() string

type FilePath added in v0.2.0

type FilePath string

FilePath is a string describing a path to a file

func (FilePath) Path added in v0.2.0

func (p FilePath) Path() string

type LocalSubtitle

type LocalSubtitle struct {
	os.FileInfo
	// contains filtered or unexported fields
}

func (*LocalSubtitle) Download

func (l *LocalSubtitle) Download() (io.ReadCloser, error)

func (*LocalSubtitle) IsHI

func (l *LocalSubtitle) IsHI() bool

func (*LocalSubtitle) IsLang

func (l *LocalSubtitle) IsLang(tag language.Tag) bool

func (*LocalSubtitle) Language

func (l *LocalSubtitle) Language() language.Tag

func (*LocalSubtitle) MarshalJSON

func (l *LocalSubtitle) MarshalJSON() (b []byte, err error)

func (*LocalSubtitle) Meta

func (l *LocalSubtitle) Meta() types.Metadata

func (*LocalSubtitle) String

func (l *LocalSubtitle) String() string

func (*LocalSubtitle) TypeEpisode

func (l *LocalSubtitle) TypeEpisode() (types.Episode, bool)

func (*LocalSubtitle) TypeMovie

func (l *LocalSubtitle) TypeMovie() (types.Movie, bool)

type Metadata

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

Metadata provides release information for media

func ParseMetadata

func ParseMetadata(tags string) Metadata

ParseMetadata generates meta data from a string

func (Metadata) AllTags

func (m Metadata) AllTags() []string

AllTags returns all metadata as a list of tags

func (Metadata) Codec

func (m Metadata) Codec() codec.Tag

Codec returns the codec

func (Metadata) Group

func (m Metadata) Group() string

Group returns the release group

func (Metadata) MarshalJSON

func (m Metadata) MarshalJSON() (b []byte, err error)

func (Metadata) Quality

func (m Metadata) Quality() quality.Tag

Quality returns the quality of the media

func (Metadata) Source

func (m Metadata) Source() source.Tag

Source returns the source of the media

func (Metadata) String

func (m Metadata) String() string

String return a description of the metadata

type MovieMeta

type MovieMeta struct {
	Metadata
	// contains filtered or unexported fields
}

MovieMeta represents a movie file

func NewMovie

func NewMovie(filename string) (*MovieMeta, error)

NewMovie parses media info from a file

func (*MovieMeta) MarshalJSON

func (m *MovieMeta) MarshalJSON() (b []byte, err error)

func (*MovieMeta) Matches

func (m *MovieMeta) Matches(types.Subtitle) bool

Matches a movie against a subtitle

func (*MovieMeta) MovieName

func (m *MovieMeta) MovieName() string

MovieName is the name of the movie

func (*MovieMeta) Score

func (m *MovieMeta) Score(types.Subtitle) float32

Score returns the likelyhood of the subtitle maching the movie

func (*MovieMeta) String

func (m *MovieMeta) String() string

func (*MovieMeta) Year

func (m *MovieMeta) Year() int

Year is the release year of the movie

type Type

type Type struct {
	types.Metadata
}

func NewType

func NewType(m types.Metadata) *Type

func (*Type) Meta

func (m *Type) Meta() types.Metadata

func (*Type) TypeEpisode

func (m *Type) TypeEpisode() (r types.Episode, ok bool)

func (*Type) TypeMovie

func (m *Type) TypeMovie() (r types.Movie, ok bool)

Jump to

Keyboard shortcuts

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