Documentation
¶
Overview ¶
Package decision holds the rules for whether a release is worth grabbing for an episode, given its quality profile and the file the episode already has. Automatic search and RSS sync share these rules so they can't drift apart.
Index ¶
Constants ¶
const ( // ReasonBelowProfile: the profile doesn't accept this quality (not in // its allowed list, or below its cutoff resolution when it has none). // The string is kept for the UI's filtered-rows display. ReasonBelowProfile = "below_quality_profile" ReasonNotAnUpgrade = "not_an_upgrade" ReasonUpgradesDisabled = "upgrades_disabled" ReasonUpgradeLimit = "upgrade_until_reached" ReasonCurrentUnknown = "current_quality_unknown" )
Rejection reasons, stable strings suitable for logs and API responses.
Variables ¶
This section is empty.
Functions ¶
func Evaluate ¶
Evaluate decides whether to grab a release of quality candidate for an episode whose current file has quality current (nil when the episode has no file). It returns ok=true, or ok=false with a reason.
Rules, in order:
- The candidate must meet the profile minimum.
- No current file: grab.
- Current quality unknown (e.g. imported before quality was tracked): don't upgrade automatically; a manual search still can.
- Same quality (resolution + source; codec doesn't matter, as in Sonarr), higher revision (PROPER/REPACK): grab. A proper fixes a broken release of the quality you already chose, so it is taken even when the cutoff is met or upgrades are off, as Sonarr's default "prefer and upgrade" does.
- Not strictly better than the current file: reject.
- Current file below the cutoff: grab.
- Cutoff met: grab only if the profile allows upgrades and the current file is below its upgrade-until ceiling.
func MeetsProfileMinimum ¶
MeetsProfileMinimum reports whether q is acceptable for profile p at all.
When the profile lists allowed qualities, q must be one of them (resolution + source, see quality.Profile.Allows). That's how a "Bluray only" profile rejects WEB-DL, and how a profile accepts WEBRip as a fallback by listing it.
A profile with no list falls back to the cutoff's resolution as a floor. A nil profile, or one with neither a list nor a cutoff, accepts everything.
Types ¶
This section is empty.