Documentation
¶
Overview ¶
Package episodematch decides which member of a season pack, and whether a single name, is an item's episode, from evidence alone: a pack's numbers follow whatever order its uploader used, so a number is trusted only when the evidence leaves no other reading.
A name gives its claims (through epmarker) and its episode title. Titles are assigned to episodes one to one by the measured normaliser and thresholds; a member's identity is its assigned episode, else its claims. The known orders that no assigned member contradicts, and whose count of the pack's distinct episodes matches the item's season, then decide by number, or name the members a reference track must settle. It is pure over its inputs and imports no provider.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Choice ¶
type Choice struct {
// Compare lists, in archive order, every serving member of each group the
// disagreeing orders name.
Compare []int
// Member is the member taken, -1 when none.
Member int
Refusal Refusal
// ByNumber is set when a number, not a confident title, chose Member or
// Compare.
ByNumber bool
}
Choice is Select's answer: one member taken, members to compare against the reference track (the one with the highest confidence is taken), or a refusal.
type Identity ¶
type Identity struct {
// Refuted: its title is confidently another episode's, or, with no such
// title, its numbers match none of the item's.
Refuted bool
// Titled: its title is confidently the item's episode.
Titled bool
// ByNumber: on a series whose numbers may follow another order, nothing
// but its numbers says it is the item's episode.
ByNumber bool
}
Identity is what a single name says about the item it is offered for.
func Identify ¶
Identify reads one release or file name offered for Items[item]. Its numbers match the item when a claim is its Numbering or SeriesNumbering, or, with no claim, the number it states with no season is its aired absolute number or either numbering's episode. On an index-false series the numbers are trusted and the title is never read.
type Input ¶
type Input struct {
Series Series
// Members are in archive order.
Members []Member
// Item is the index in Series.Items of the episode the pack is for.
Item int
Variant language.Variant
// Manual is a user's pick, which no count or undetermined order refuses:
// past a title it takes the group the orders agree on, else the one the
// series' own order names.
Manual bool
// NoReference is set once the reference comparison found no reference
// track, so a disagreement between the orders refuses the pack.
NoReference bool
}
Input is one pack offered for one item and variant.
type Member ¶
Member is one pack member: its name as the archive lists it, folders included, and the variant flags the caller read from it.
type Name ¶
type Name struct {
// Title is the episode title the name carries, "" when none.
Title string
// Claims are the episodes the name states, ranges expanded; nil when
// none.
Claims []epmarker.Marker
// Special is set for a season 0 claim, an episode 0 claim (x00, E00) or
// the word "Special".
Special bool
// Bare marks Claims read from a bare leading number under the pack's
// season, which the name itself does not state.
Bare bool
}
Name is what one member or release name says about its episode.
func ReadPack ¶
ReadPack reads every member name of one pack by its base name. season is the pack's season, the one its search asked for: a name with no claim states its bare leading number under it, marked Bare, but only when no member claims a marker (epmarker.Target.MatchesBareEpisode's precondition) and season is 0 or more.
type Refusal ¶
type Refusal uint8
Refusal is why a pack gives the item no member.
const ( // NoMember means no member is the item's, or none of them serves the // variant. NoMember Refusal // EpisodeCount means under every compatible order the pack's distinct regular // episodes differ from the items of the item's season. EpisodeCount // OrderUndetermined means no order is compatible with the pack, or the // compatible ones disagree at the item and there is no reference track. OrderUndetermined )
type Series ¶
type Series struct {
// Reading is the root's bound reading, nil when there is none. A reading
// lacking the item's aired episode counts as none.
Reading *mediasource.SeriesEvidence
// Languages are the ISO 639-2/T codes of the reading's title sets to read:
// the subtitle's language and English. A set the reading lacks is skipped.
Languages []string
// Items are the root's items, with their titles as the source lists them.
Items []mediasource.Item
Order mediasource.Order
}
Series is what the steps read about the item's series.