scraper

package
v0.0.0-...-991d8a3 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddMultipleResults

func AddMultipleResults(s *status.Status, mediaType database.MediaType, mediaData int64, searchResults []common.SearchData, name string) error

Add multiple results for a given mediaType/mediaData to the database also deletes the previous entries for the given mediaType/mediaData

func AddPerson

func AddPerson(s *status.Status, mediaType database.MediaType, mediaData int64, person common.PersonData) error

Link a person to a mediaType/mediaData in the database if the person doesn't exists, it is automatically created

func AddTag

func AddTag(s *status.Status, mediaType database.MediaType, mediaData int64, tag common.TagData) error

Link a tag to a mediaType/mediaData in the database if the tag doesn't exists, it is automatically created

func ListScraperConfiguration

func ListScraperConfiguration(s *status.Status, mediaType database.MediaType) ([]string, map[string](map[string]string), error)

Returns a list of the enabled scrapers and map of scraper name to config for a specific mediaType sorted by priority

func SelectBestItem

func SelectBestItem(items []common.SearchData, title string, year int) (common.SearchData, error)

Select the best SearchData from an array based on a provided title and an optionnal year if no matching item is found or that the score is too low, an error is returned

func SelectScraperResult

func SelectScraperResult(s *status.Status, mediaType database.MediaType, mediaData int64, id int) (common.SearchData, error)

Select the result at index id for the given mediaType/mediaData and returns the selected SearchData

func StartScan

func StartScan(s *status.Status, mediaType database.MediaType, lib int64, conf ScraperScanConfig) error

Types

type Scraper

type Scraper interface {
	Scan(idlib int64, conf ScraperScanConfig) error
	UpdateWithSelectionResult(mediaData int64, selection SelectionResult) error
}

scraper definition

type ScraperScanConfig

type ScraperScanConfig struct {
	AutoAdd            bool
	AddUnknown         bool
	Enable3DScan       bool
	MaxConcurrentScans int64
}

type SelectionResult

type SelectionResult struct {
	ScraperName string
	ScraperID   string
	ScraperData string
}

type TVSScraper

type TVSScraper struct {
	MediaType     database.MediaType
	IDLib         int64
	LibPath       string
	AutoAdd       bool
	AddUnknown    bool
	App           *status.Status
	Providers     map[string]common.TVShowProvider
	ProviderNames []string // list used to keep the order of preferences
	RegexSeason   *regexp.Regexp
	RegexEpisode  *regexp.Regexp
}

func NewTVSScraper

func NewTVSScraper(s *status.Status) TVSScraper

func (*TVSScraper) Scan

func (t *TVSScraper) Scan(idlib int64, conf ScraperScanConfig) error

func (*TVSScraper) UpdateWithSelectionResult

func (t *TVSScraper) UpdateWithSelectionResult(id int64, selection SelectionResult) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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