Documentation
¶
Overview ¶
Package epmarker is the single authority for reading S##E## episode markers out of release names and archive member filenames. Every site that asks "which season and episode does this name claim?" reads the same scanner, so the scoring layer, the archive extractor and the AnimeTosho provider can no longer disagree about what a marker is.
Views (all pure, all case-insensitive):
- Find: every well-formed marker in the name, in order of appearance.
- FirstIndex / Present: where the first marker-SHAPED token starts, and whether one exists at all. Shape presence is deliberately independent of Find: a token whose digits overflow an int is still shaped like a marker, so it must keep suppressing a "this name carries no marker" fallback, but it yields no usable season/episode and Find therefore omits it.
- Season: the season claimed by the leading S## token, whether or not an E## follows it — a season pack ("Show.S04.Complete") has no E##.
Deliberately NOT here, because it is per-site policy rather than marker syntax: the archive extractor's multi-episode range scan (E01-E02) and its filepath.Base narrowing, and the AnimeTosho provider's standalone absolute-number probes (" - 26", "e26"). Those live at their one call site.
Seed evidence (2026-07 triplication removal): the table below is the union of the three scanners it replaced — scoring's bounded pair (S\d{1,2}E\d{1,3} plus S(\d{1,2}) for the season-only form) and the byte-identical unbounded S(\d+)E(\d+) used by archive and animetosho. The unbounded reading won: the bounded one mis-read zero-padded and long markers ("S001E01" scanned as season 0 with NO episode marker, so a single episode was classified as a season pack), and it truncated long episode numbers ("S01E1234" -> 123). See TestFind_diverged_from_bounded_scoring_reading for the exact inputs whose reading changed and why.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FirstIndex ¶
FirstIndex returns the byte offset at which the first marker-shaped token starts, or -1 when name carries none. Used to split a release name into its title portion and its marker portion.
Types ¶
type Marker ¶
Marker is the season/episode pair one S##E## token claims. Both numbers are non-negative: they are read from digit runs, so "S00E00" is a legitimate Marker{0, 0} rather than a miss.
func Find ¶
Find returns every well-formed marker in name, in order of appearance. Callers that care about precedence pick from the returned order themselves (the archive extractor accepts any match, AnimeTosho accepts any exact season+episode match). A marker-shaped token whose season or episode does not fit an int is skipped here but still reported by Present.