Skip to content

fix: parse Russian season pack notation ("N сезон (A-B серии)", "Сезоны A-B") - #66

Merged
Viren070 merged 2 commits into
AIOStreams:mainfrom
a1d4r:fix/russian-season-notation
Oct 3, 2026
Merged

Viren070 merged 2 commits into
AIOStreams:mainfrom
a1d4r:fix/russian-season-notation

Conversation

@a1d4r

@a1d4r a1d4r commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Fixes two cases in Russian season-pack titles (common on Kinozal / RuTracker).

1. N сезон (A-B серии) was parsed the other way round

The episode range ended up in seasons and the season number in episodes:

Title Before After
Игра Престолов 1 сезон (1-10 серии из 10) / Game of Thrones / 2011 S [1..10], E [1] S [1], E [1..10]
Игра престолов (2 сезон: 1-10 серии из 10) S [1..10], E [2] S [2], E [1..10]
Игра Престолов 2 сезон 1-10 серия S [1..10], E [2] S [2], E [1..10]
Во все тяжкие (5 сезон: 1-16 серии из 16) S [1..16], E [5] S [5], E [1..16]

The season-range handler matched singular сезон and grabbed the range that follows it. It now skips a range that is followed by an episode word (серии / эпизоды), so Сезон: 1-8 is still parsed as seasons 1–8.

2. Russian plural Сезоны wasn't recognized

Only the Ukrainian Сезони was matched, so the range fell through to episodes and Сезоны leaked into the title:

Title Before After
Игра престолов / Сезоны 1-8 / Game of Thrones S —, E [1..8], title Сезоны S [1..8], title Игра престолов
Игра престолов / Сезоны: 1-8 S —, E [1..8], title Сезоны S [1..8], title Игра престолов
Игра престолов (Сезоны 1-8: 1-73 серии из 73) S —, E [1..73] S [1..8], E [1..73]
Игра престолов / Сезоны 1, 2, 3 S —, E [1, 2, 3] S [1, 2, 3]

[Сс]езони? → [Сс]езон[иы]? in all season-related patterns, including the validateNotMatch guards of the episode-range handlers.

Tests

Added 9 tests to seasons.test.ts covering both cases, plus a regression check for Сезон: 1-8. The full suite passes (38 suites, 1301 tests). Existing Russian/Ukrainian and English season formats (Сезон: 2 / Серии: 1-10, Сезони 1-8, 01x01-10, Season.1-8, S01-S08, S02E01) are unchanged.

Context

In AIOStreams, case 1 made a request for S02E01 return the season 1 pack and drop the correct season 2 pack.

@Viren070
Viren070 merged commit 55eddcb into AIOStreams:main Oct 3, 2026
3 checks passed
@a1d4r
a1d4r deleted the fix/russian-season-notation branch October 6, 2026 18:50
@github-actions github-actions Bot mentioned this pull request Oct 30, 2026
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.

3 participants