Skip to content

feat: parse XVID 3-digit season/episode scheme (Show.103 → S01E03) - #54

Open
warplayer wants to merge 1 commit into
AIOStreams:mainfrom
warplayer:feat/xvid-3digit-episode-scheme
Open

warplayer wants to merge 1 commit into
AIOStreams:mainfrom
warplayer:feat/xvid-3digit-episode-scheme

Conversation

@warplayer

Copy link
Copy Markdown

What

Adds a late-running episodes handler for the classic XVID-era naming where season+episode is a single 3-digit number:

Input Result
Yes.Dear.103.dsr.xvid-saints.avi S01E03, title "Yes Dear"
Yes.Dear.106.Gregs.Big.Day.DSRip.XviD-SAiNT.avi S01E06
Yes.Dear.301.Spanks.But.No.Spanks.SDTV.avi S03E01
Yes.Dear.110.Talk.Time.DSRip.XviD-SAiNT.avi S01E10

The handler also fills in the seasons field when no explicit season marker is present, and strips the digits from the title (remove: true).

Why

Old shows on NZB indexers often exist only as DVD/DSRip XVID season packs with this naming. Downstream consumers (AIOStreams' file selection inside season packs, see Viren070/AIOStreams#1162) rely on parsed season/episodes to pick the right file; without them every episode resolves to an arbitrary file.

Design / false-positive guards

The handler runs late in the episodes batch so structured markers (S01E03, ep, Cap., …) win first. The 264/265 codec handler above takes precedence for those values. A validateMatch + transform reject:

  • codec numbers (H.264 / H.265, and x264/x265 via the word-boundary lookbehind)
  • absolute-episode conventions ("- 107 -", "523 23") — left to the existing fallback handler
  • bracket/slash contexts (anime ranges [166-192TV], par2 (003/101))
  • numbers followed by another number ("523 23")
  • PPV event numbers (UFC.218.PPV — the ppv feature handler consumes the marker first, so the check reads the parsed ppv field)
  • movie-title numbers followed by a year (Crime.101.2026 — year handler removes the year from the title, so the check reads the parsed year field)
  • 100/200-style values that would yield episode 0

Ambiguity note

110 is parsed as S01E10 (season = leading digit, episode = trailing two digits, seasons 1–9 only). This matches the convention used by the classic parse-torrent-name library. The 3-digit scheme is inherently ambiguous for shows with 10+ seasons; restricting to [1-9]-led values keeps the common case correct.

Tests

10 new tests in episodes.test.ts covering the scheme, the guards above, and the exact filenames from AIOStreams#1162. Full suite: 1253 passed, 0 failed.

Closes #53

Adds a late-running episodes handler for the classic XVID-era naming where
season+episode is a single 3-digit number (Show.103.Episode.Name.avi =
S01E03, Show.301 = S03E01, Show.110 = S01E10). The handler also fills in
the seasons field when no explicit season marker is present.

Deliberately excluded to avoid false positives:
- codec numbers (H.264/H.265)
- absolute-episode conventions ("- 107 -", "523 23")
- bracket/slash contexts (anime ranges, par2 numbering)
- movie-title numbers followed by a year ("Crime.101.2026")
- PPV event numbers ("UFC.218.PPV")
- 100/200-style values that would yield episode 0

Closes AIOStreams#53

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parse the classic XVID 3-digit season/episode scheme (Show.103 → S01E03)

1 participant