Documentation ¶
Index ¶
- func AddMultipleResults(s *status.Status, mediaType database.MediaType, mediaData int64, ...) error
- func AddPerson(s *status.Status, mediaType database.MediaType, mediaData int64, ...) error
- func AddTag(s *status.Status, mediaType database.MediaType, mediaData int64, ...) error
- func ListScraperConfiguration(s *status.Status, mediaType database.MediaType) ([]string, map[string](map[string]string), error)
- func SelectBestItem(items []common.SearchData, title string, year int) (common.SearchData, error)
- func SelectScraperResult(s *status.Status, mediaType database.MediaType, mediaData int64, id int) (common.SearchData, error)
- func StartScan(s *status.Status, mediaType database.MediaType, lib int64, ...) error
- type Scraper
- type ScraperScanConfig
- type SelectionResult
- type TVSScraper
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
Types ¶
type Scraper ¶
type Scraper interface { Scan(idlib int64, conf ScraperScanConfig) error UpdateWithSelectionResult(mediaData int64, selection SelectionResult) error }
scraper definition
type ScraperScanConfig ¶
type SelectionResult ¶
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