providers

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2015 License: Apache-2.0 Imports: 17 Imported by: 0

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

Jump to

Keyboard shortcuts

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