importer

package
v0.0.0-...-30262a5 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2017 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package importer provides functions for importing movies into the library

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	// Close this channel to stop all import workers
	Stop chan struct{}

	Library *library.Library
	Config  *config.Config

	// Channel for unrecoverable pipeline errors, to be read by a human
	Errors chan error

	// Files which have failed to identify correctly during import
	FilesWithErrors []*library.VideoFile
	// contains filtered or unexported fields
}

Context contains common data for all importers

func NewContext

func NewContext(library *library.Library, config *config.Config) *Context

NewContext initializes a context with the given library and config

func (*Context) Errorf

func (c *Context) Errorf(message string, arguments ...interface{})

Errorf sends an error message to the Errors channel

func (*Context) FileInfo

func (c *Context) FileInfo(filenames <-chan string, files chan<- *library.VideoFile)

FileInfo takes filenames and constructs video file data

func (*Context) ImdbIdentifier

func (c *Context) ImdbIdentifier(
	shows <-chan library.ShowWithFile,
	doneSeries chan<- *library.Series,
	done chan<- library.ShowWithFile,
)

ImdbIdentifier fetches data from imdb for the given shows (they must have an ImdbID). For shows which are episodes, it fetches the respective series.

func (*Context) Import

func (c *Context) Import(paths []string)

Import imports and processes all shows from the given paths into the library

func (*Context) OsdbClient

func (c *Context) OsdbClient() (*osdb.Client, error)

OsdbClient returns a logged in Osdb client

func (*Context) OsdbIdentifier

func (c *Context) OsdbIdentifier(
	files <-chan *library.VideoFile, shows chan<- library.ShowWithFile,
	done chan<- *library.VideoFile,
)

OsdbIdentifier identifies the video files (matching them to shows) using the opensubtitles.org database

func (*Context) ProcessShows

func (c *Context) ProcessShows(shows <-chan library.ShowWithFile)

ProcessShows fetches data for each show from online sources

func (*Context) SubtitleDownloader

func (c *Context) SubtitleDownloader(
	files <-chan library.ShowWithFile,
	subtitles chan<- *library.Subtitle,
	done chan<- library.ShowWithFile,
)

SubtitleDownloader downloads subtitles for each file, using information from its associated show.

func (*Context) WalkPaths

func (c *Context) WalkPaths(paths []string, filenames chan<- string)

WalkPaths recursively searches for video files in the given directories and sends them on the channel. Non-folder paths are sent as-are.

Jump to

Keyboard shortcuts

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