matcher

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter struct {
	*regexp.Regexp
}

Filter is a wrapper for regexp

func (Filter) MarshalJSON

func (t Filter) MarshalJSON() ([]byte, error)

MarshalJSON returns a string from regexp and place it in the JSON stream

func (*Filter) UnmarshalJSON

func (t *Filter) UnmarshalJSON(b []byte) error

UnmarshalJSON takes the string from the stream and compile the regexp

type MatchRequest

type MatchRequest struct {
	Provider string
	// Fields for matching
	Show  string
	Title string
	// ShowID   string // Future use
	// TitleID  string // Future use
	// Pitch    string // Future use
	// Playlist    string // Playlist search is implemented in providers.
	MaxAgedDays int // Retrive media younger than MaxAgedDays when not zero

	// Fields for managing download
	Type               nfo.ShowType    // Determine the type of show for file layout and naming
	Destination        string          // Download base destination code defined in config
	ShowRootPath       string          `json:"ShowPath"` // Show/Movie path. Bypass destinations. For expisodes, actual season will append to the path
	SeasonPathTemplate *TemplateString // Template for season path, can be empty to skip season in path. When missing uses default naming
	ShowNameTemplate   *TemplateString // Template for the name of mp4 file, can't be empty. When missing, uses default naming
	RetentionDays      int             // Media retention time, when not zero the system will delete old files
	TitleFilter        Filter          // ShowTitle or Episode title must match this regexp to be downloaded
	TitleExclude       Filter          // ShowTitle and Episode title must not match this regexp to be downloaded
	KeepBonus          bool            // When trie bonuses and trailer are retrieved

}

MatchRequest holds criterions for selecting show

func (*MatchRequest) Accepted

func (m *MatchRequest) Accepted(n *nfo.MediaInfo) bool

Accepted check if ShowTitle or episode Title matches the filter

func (MatchRequest) IsTitleMatch

func (m MatchRequest) IsTitleMatch(title string) bool

TODO implement IsTitleMatch for all providers

type TemplateString

type TemplateString struct {
	S string
	T *template.Template
}

func (TemplateString) MarshalJSON

func (t TemplateString) MarshalJSON() ([]byte, error)

MarshalJSON returns a string from regexp and place it in the JSON stream

func (*TemplateString) Set

func (t *TemplateString) Set(s string) error

func (TemplateString) String

func (t TemplateString) String() string

func (TemplateString) Type

func (t TemplateString) Type() string

func (*TemplateString) UnmarshalJSON

func (t *TemplateString) UnmarshalJSON(b []byte) error

UnmarshalJSON takes the string from the stream and compile the template

Jump to

Keyboard shortcuts

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