Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrFileSizeTooSmall is the error that is thrown when the file is too short ErrFileSizeTooSmall = errors.New("The file is too short to be hashed (< 64K).") )
Functions ¶
This section is empty.
Types ¶
type Subtitle ¶
type Subtitle struct { FileName string Hash string Format string URL string Source SubtitleProvider }
Subtitle is a reference to a subtitle, i.e. it wasn't downloaded yet, just found.
type SubtitleDB ¶
type SubtitleDB interface { Get(path, language string) error GetAll(paths []string, language string) // contains filtered or unexported methods }
SubtitleDB is the interface through which we search for subtitles
func GetSubtitleDB ¶
func GetSubtitleDB() SubtitleDB
GetSubtitleDB returns a SubtitleDB through which we can search for subtitles
type SubtitleProvider ¶
type SubtitleProvider interface { // Name returns the name of this provider Name() string // GetSubtitle accepts a filepath and a language, and searches for subtitles GetSubtitles(filePath, language string) ([]Subtitle, error) // Download returns the path of the downloaded subtitle Download(subtitle Subtitle, filePath string) (string, error) }
SubtitleProvider is the interface a provider needs to implement
Click to show internal directories.
Click to hide internal directories.