Documentation
¶
Overview ¶
Package rank answers how well a subtitle's release fits the video's, as tri-state facts and a Fit grade with no number anywhere. It reads release names parsed by internal/release; ordering and picking live in search.
Index ¶
Constants ¶
const RateTolerance = 0.0011
RateTolerance is the relative distance within which an fps value is a family member (subliminal's fps_matches).
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Facts ¶
type Facts struct {
// Hash is a validated hash claim: void when identity was not confirmed
// or Source or Cut is Differs.
Hash bool
Source, Group, Service, Cut, Rate Tri
// PreRelease is true when exactly one side is a cam, telesync,
// telecine, screener, regional or workprint release.
PreRelease bool
// SeasonPack is true when an episode's subtitle name states a season
// and no episode; a tie-break only.
SeasonPack bool
// EpisodeByNumber marks a pack member chosen by its number alone: its
// episode is unconfirmed, so its timing is never skipped. The engine
// sets it, never Compare, and FitOf never reads it.
EpisodeByNumber bool
}
Facts compares one subtitle's release with the video's.
func Compare ¶
func Compare(video release.Parsed, videoFPS float64, sub release.Parsed, subFPS float64, m MatchedBy, identityOK bool) Facts
Compare builds the facts. Same and Differs need both sides known; Service compares only when both sources are web; Cut is Unknown when one side is unlabelled, compares primary cut tokens when both sides carry one (Same when they share one), is Differs when only one side does, and compares the Unrated, Uncut and Uncensored qualifiers only when neither side carries a primary cut; two pre-release sources compare Unknown. Hash holds only when m is Hash, identityOK is true and neither Source nor Cut is Differs.
type Fit ¶
type Fit uint8
Fit grades Facts, ascending; the zero value is not a grade.
func FitOf ¶
FitOf grades f: a hash is Exact; a differing cut or a one-sided pre-release is a Conflict; the same group with no differing source, service or rate is SameRelease; the same source with no differing rate is SameSource; anything else is Other.
func (Fit) MarshalText ¶
MarshalText is conflict, other, same_source, same_release or exact; the zero value has no name.
func (*Fit) UnmarshalText ¶
UnmarshalText reads a grade's name and refuses every other spelling.
type MatchedBy ¶
type MatchedBy uint8
MatchedBy is how the provider matched the query; diagnostic, except that only Hash can make a hash fact.
func (MatchedBy) MarshalText ¶
MarshalText is title, id or hash; the zero value has no name.
func (*MatchedBy) UnmarshalText ¶
UnmarshalText reads title, id or hash and refuses every other spelling.
type RateFamily ¶
type RateFamily uint8
RateFamily groups frame rates that need no linear correction.
const ( RateUnknown RateFamily = iota PAL // 25, 50 Film // 23.976, 24, 29.97, 30, 47.95, 48, 59.94, 60 )
The families; RateUnknown is the zero value.
func RateFamilyOf ¶
func RateFamilyOf(fps float64) RateFamily
RateFamilyOf answers RateUnknown for 0 and for a rate in no family.
type Tri ¶
type Tri uint8
Tri is one fact's answer; Same and Differs need both sides known.
func (Tri) MarshalText ¶
MarshalText is unknown, same or differs.
func (*Tri) UnmarshalText ¶
UnmarshalText reads unknown, same or differs and refuses every other spelling.