Documentation ¶
Index ¶
- Variables
- func HandleCheck(job *Job)
- func HandleDelete(job *Job)
- func HandleDownloadImages(job *Job)
- func HandleIndex(job *Job)
- func HandleMeta(job *Job)
- func HandleMove(job *Job)
- func HandleProbe(job *Job)
- func HandleResizeImages(job *Job)
- func HandleSave(job *Job)
- func HandleSearch(job *Job)
- func HandleSubtitles(job *Job)
- type File
- type Indexer
- func (i *Indexer) AddToCache(hash string)
- func (i *Indexer) CheckCache(hash string) bool
- func (i *Indexer) Images(result *m.Result) error
- func (i *Indexer) Job(sequence string) (*Job, error)
- func (i *Indexer) LogEnabled() bool
- func (i *Indexer) MovieDetail(id int) (*m.MovieDetail, error)
- func (i *Indexer) MovieResult(detail *m.MovieDetail, file File) *m.Result
- func (i *Indexer) MovieSearch(name string) (int, error)
- func (i *Indexer) Next(job *Job)
- func (i *Indexer) Probe(result *m.Result) error
- func (i *Indexer) PurgeCacheEntry(hash string)
- func (i *Indexer) RegisterTasks(tasks map[string]func(*Job))
- func (i *Indexer) ResizeImages(result *m.Result) error
- func (i *Indexer) Sequence(name string, maxRetries int, s ...string) error
- func (i *Indexer) ShowSearch(name string) (int, error)
- func (i *Indexer) Start()
- func (i *Indexer) Stop()
- func (i *Indexer) Submit(job *Job)
- func (i *Indexer) Subtitles(result *m.Result) error
- func (i *Indexer) Visit(md m.Source) filepath.WalkFunc
- func (i *Indexer) Walk(md m.Source)
- type Job
- type Step
- type Worker
Constants ¶
This section is empty.
Variables ¶
var ( ErrTaskNotFound = errors.New("Task with this name not found") ErrDuplicateSequence = errors.New("A Sequence with this name already exists") ErrSequenceNotFound = errors.New("Sequence with this name not found") ErrImageDownload = errors.New("There was an error while downloading the image") )
var (
ErrorNoSearchResults = errors.New("No search results for this query")
)
var (
ErrorTooManyRetries = errors.New("Too many retries")
)
Functions ¶
func HandleCheck ¶
func HandleCheck(job *Job)
HandleCheck handles the check if the provided file is already indexed and an entry in the database exists or another worker has already put this movie / show into the queue for further processing
func HandleDelete ¶
func HandleDelete(job *Job)
HandleDelete handles the deletion of an database entry if the file watcher encounters a file deletion
func HandleDownloadImages ¶
func HandleDownloadImages(job *Job)
HandleDownloadImages handles the download of all provided images
func HandleIndex ¶
func HandleIndex(job *Job)
HandleIndex handles the indexing based on the search result and fetches all details of the movie / show
func HandleMeta ¶
func HandleMeta(job *Job)
func HandleMove ¶
func HandleMove(job *Job)
HandleMove handles the update of an database entry if the file watcher encounters a file move
func HandleProbe ¶
func HandleProbe(job *Job)
HandleProbe handles the process of extracting fps, width and height of the media file
func HandleResizeImages ¶
func HandleResizeImages(job *Job)
HandleResizeImages handles the resizing of all downloaded images
func HandleSave ¶
func HandleSave(job *Job)
HandleSave handles the saving of the indexed movie / show to the database
func HandleSearch ¶
func HandleSearch(job *Job)
HandleSearch handles the search of the movie / show via the TMDB API search endpoint
func HandleSubtitles ¶
func HandleSubtitles(job *Job)
HandleSubtitles handles the process of extracting subtitles to a srt file
Types ¶
type Indexer ¶
type Indexer struct {
// contains filtered or unexported fields
}
func (*Indexer) AddToCache ¶
AddToCache adds a hash to the internal cache
func (*Indexer) CheckCache ¶
CheckCache checks if a hash is present in the internal cache
func (*Indexer) LogEnabled ¶
LogEnabled returns if log is anabled
func (*Indexer) MovieDetail ¶
func (i *Indexer) MovieDetail(id int) (*m.MovieDetail, error)
MovieDetail performs a request against the TheMovieDB API querying for all details about the provided movie
func (*Indexer) MovieResult ¶
func (*Indexer) MovieSearch ¶
MovieSearch performs a search of the provided filename against the TheMovieDB API. If no movie is found this will return 0 as ID and an error
func (*Indexer) Probe ¶
Probe executes a ffprobe on the source file to extract video fps, width and height
func (*Indexer) PurgeCacheEntry ¶
PurgeCacheEntry removes a specific hash from the internal cache
func (*Indexer) RegisterTasks ¶
RegisterTasks registers a task map
func (*Indexer) ResizeImages ¶
ResizeImages resizes all provided images to the given sizes and saves them in their appropriate directory
func (*Indexer) Sequence ¶
Sequence registers a new step sequence or returns an error if a sequence with the same name already exists
func (*Indexer) Subtitles ¶
Subtitles executes a ffmpeg cmd on the source file to extract the subtitles
type Job ¶
type Job struct { SequenceName string Sequence []Step Current int Delay float64 File File Result *m.Result Indexer *Indexer // contains filtered or unexported fields }
func (*Job) GetMaxRetries ¶
GetMaxRetries returns the current retries
func (*Job) Retry ¶
Retry increases the retry counter or returns an error if there were more than 3 retries
func (*Job) SetGeneral ¶
SetGeneral sets some general values