Documentation
¶
Overview ¶
Package releaseparse parses scene and P2P release names into core.ReleaseInfo. It is pure string work and safe for concurrent use.
Index ¶
- func CompareTitleIDs(reported, expected core.IDs) (matched, conflicting bool)
- func EpisodeMatches(parsed core.ReleaseInfo, season, episode int) bool
- func EpisodeSeriesYear(name string, parsedYear int) int
- func EpisodeTitleMatches(name, want string) bool
- func ExplicitDub(name string) bool
- func HasUsableInfo(info core.ReleaseInfo) bool
- func IsObfuscated(title string) bool
- func MiniseriesPart(name string) (seriesTitle string, part int, ok bool)
- func NormalizeEdition(name string) string
- func NormalizeTitle(s string) string
- func Parse(name string) core.ReleaseInfo
- func ParseEdition(name string) string
- func SeriesYearMatches(releaseYear, showYear int) bool
- func TitleAliases(title string) []string
- func TitleMatches(parsed core.ReleaseInfo, want string) bool
- func TitleYearMatches(parsed core.ReleaseInfo, want string, wantYear int) bool
- func TitlesMatch(a, b string) bool
- func TrailingRegionTag(title string) string
- func YearMatches(got, want int) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareTitleIDs ¶ added in v0.2.4
CompareTitleIDs compares only shared identifier namespaces. A matching identifier is positive evidence; any explicit conflict wins over a match. Missing identifiers carry no evidence and never become a match merely because the indexer was queried with the expected identifiers.
func EpisodeMatches ¶
func EpisodeMatches(parsed core.ReleaseInfo, season, episode int) bool
EpisodeMatches reports whether parsed info is exactly the wanted episode (not a season pack, season matches, episode is listed).
func EpisodeSeriesYear ¶ added in v0.2.4
EpisodeSeriesYear reads only the series portion of a TV name. A year in an episode title must not be mistaken for the show's premiere year.
func EpisodeTitleMatches ¶ added in v0.2.4
EpisodeTitleMatches rejects an explicitly different episode title between SxxExx and the technical metadata. Unnamed scene releases remain eligible. A title is only extracted when a recognized metadata boundary follows it.
func ExplicitDub ¶ added in v0.2.9
ExplicitDub reports a dub declaration in release metadata, not a title word. Language parsing alone is not enough: foreign originals remain welcome.
func HasUsableInfo ¶
func HasUsableInfo(info core.ReleaseInfo) bool
HasUsableInfo reports whether parsed info carries enough technical detail to consider a release whose title cannot be verified.
func IsObfuscated ¶
IsObfuscated reports whether a name/title looks like a hash or random string with no readable words.
func MiniseriesPart ¶ added in v0.2.4
MiniseriesPart extracts the series title and 1-based part number from a miniseries release named "Show.Name.Part.3.Episode.Title.1080p.BluRay" or "Show.Name.1990.Pt.01.720p". It is used only when resolving a Season 1 episode so movie titles ("Dune Part Two") are unaffected.
func NormalizeEdition ¶
NormalizeEdition maps an edition label found in a release name (or an already-normalized one) to the canonical cut name, "" when there is no explicit cut. Two releases belong to the same cut when their normalized editions match.
func NormalizeTitle ¶
NormalizeTitle lowercases, strips diacritics and punctuation, expands "&" to "and", and drops a leading article, for title comparisons.
func Parse ¶
func Parse(name string) core.ReleaseInfo
Parse extracts structured info from a release name.
func ParseEdition ¶
ParseEdition identifies explicit cut labels without guessing from runtime.
func SeriesYearMatches ¶ added in v0.2.4
SeriesYearMatches distinguishes same-named series and reboots. A year explicitly present in a TV release identifies the series, not the episode's air year. Releases omitting a year remain eligible.
func TitleAliases ¶ added in v0.2.4
TitleAliases returns alternative search query titles for titles with initialisms, explicit subtitles, parenthetical disambiguators or Roman numerals. Ordinary titles return nil so standard searches spend no extra budget hits.
func TitleMatches ¶
func TitleMatches(parsed core.ReleaseInfo, want string) bool
TitleMatches reports whether a parsed release title matches the wanted title.
func TitleYearMatches ¶
func TitleYearMatches(parsed core.ReleaseInfo, want string, wantYear int) bool
TitleYearMatches is TitleMatches plus a year check with ±1 tolerance. A zero year on either side skips the year check.
func TitlesMatch ¶
TitlesMatch reports whether two raw titles are the same after normalisation.
func TrailingRegionTag ¶ added in v0.2.4
TrailingRegionTag returns the canonical region code ("us", "uk", "au", "ca", "nz") when a release or show title ends with an explicit country disambiguator ("The.Office.US", "Ghosts (UK)"), or "".
func YearMatches ¶
YearMatches reports whether two years agree within ±1 (zero = unknown).
Types ¶
This section is empty.