Documentation
¶
Overview ¶
Package delay implements the delay profile (as in Sonarr): which download protocols are used, which is preferred, and how long to wait after a release is published before grabbing it automatically, so a better release has time to show up.
The delay applies to automatic grabs from RSS sync. A release still inside its delay is stored as pending and grabbed later if it is still the best wanted release. Searches the user triggers are not delayed.
Index ¶
- Constants
- type Profile
- func (p Profile) Allows(proto plugin.Protocol) bool
- func (p Profile) Bypasses(q plugin.Quality, prof *quality.Profile) bool
- func (p Profile) Delay(proto plugin.Protocol) time.Duration
- func (p Profile) EligibleAt(proto plugin.Protocol, ageDays float64, now time.Time) time.Time
- func (p Profile) Preferred(proto plugin.Protocol) bool
- func (p Profile) Validate() error
- type Store
- type ValidationError
Constants ¶
const MaxDelayMinutes = 7 * 24 * 60
MaxDelayMinutes caps a delay at one week.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Profile ¶
type Profile struct {
UsenetEnabled bool `json:"usenet_enabled"`
TorrentEnabled bool `json:"torrent_enabled"`
// PreferredProtocol is "usenet" or "torrent". It breaks ties between
// releases of equal quality and revision.
PreferredProtocol string `json:"preferred_protocol"`
UsenetDelayMinutes int `json:"usenet_delay_minutes"`
TorrentDelayMinutes int `json:"torrent_delay_minutes"`
// BypassIfHighestQuality grabs immediately when the release is the
// best quality the series' profile allows.
BypassIfHighestQuality bool `json:"bypass_if_highest_quality"`
}
Profile is the delay profile.
func Default ¶
func Default() Profile
Default is the profile used until one is saved: both protocols, prefer usenet, no delay. With no delay, behavior is the same as before delay profiles existed.
func (Profile) Bypasses ¶
Bypasses reports whether a release of quality q skips the delay: the option is on and q is the best quality the profile allows (resolution and source; the cutoff when the profile lists no qualities).
func (Profile) EligibleAt ¶
EligibleAt is when a release published ageDays ago (as of now) may be grabbed: its publish time plus the delay for its protocol.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store loads and saves the profile in the settings table.
type ValidationError ¶
type ValidationError struct{ Msg string }
ValidationError explains why a profile can't be saved.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string