releaseparse

package
v0.2.39 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2026 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package releaseparse parses scene and P2P release names into core.ReleaseInfo. It is pure string work and safe for concurrent use.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareTitleIDs added in v0.2.4

func CompareTitleIDs(reported, expected core.IDs) (matched, conflicting bool)

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

func EpisodeSeriesYear(name string, parsedYear int) int

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

func EpisodeTitleMatches(name, want string) bool

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

func ExplicitDub(name string) bool

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

func IsObfuscated(title string) bool

IsObfuscated reports whether a name/title looks like a hash or random string with no readable words.

func MiniseriesPart added in v0.2.4

func MiniseriesPart(name string) (seriesTitle string, part int, ok bool)

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

func NormalizeEdition(name string) string

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

func NormalizeTitle(s string) string

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

func ParseEdition(name string) string

ParseEdition identifies explicit cut labels without guessing from runtime.

func SeriesYearMatches added in v0.2.4

func SeriesYearMatches(releaseYear, showYear int) bool

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

func TitleAliases(title string) []string

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

func TitlesMatch(a, b string) bool

TitlesMatch reports whether two raw titles are the same after normalisation.

func TrailingRegionTag added in v0.2.4

func TrailingRegionTag(title string) string

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

func YearMatches(got, want int) bool

YearMatches reports whether two years agree within ±1 (zero = unknown).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL