fix(stalker): align season markers and preserve episode loading (#1545)

This commit is contained in:
4gray authored and GitHub committed 2026-09-05 22:22:46 +02:00
1 parent 812ec69fd4
commit 249cd38a66
16 files changed
+546 -74

No files matched your search

+11
View File
@@ -1415,6 +1415,17 @@ records. Both accept the same closed set: boolean `true`, numeric `1`, or string
- Treated as series flow from VOD context.
- Seasons are fetched lazily.
- Episodes are fetched on season select.
- The season resource depends on the VOD item id and series mode, so a TMDB
metadata patch does not reload seasons or discard loaded episodes. Pending
episode requests belong to the exact loading season VM; replies from an old
selection cannot fill a replacement list with reused provider season ids.
- A single-season item's explicit title marker (`s02`, `season2`, `(2 сезон)`,
etc., in `name` or `o_name`) supplies the displayed season number, quick-start
code and episode/playback/download metadata, independently of UI language and
TMDB availability. Regular and embedded VOD series apply the same rule.
Multi-season items keep provider numbering. Lazy VOD retains the original
season key/number separately for stable tracking IDs and compatible legacy
progress; provider request ids remain unchanged.
- The series quick-start CTA can load the first unloaded VOD-series season
before playback. Unloaded seasons are considered unplayed in full season
order, so an earlier unloaded season is not skipped just because a later
+19 -5
View File
@@ -261,14 +261,28 @@ keep provider numbering. `normalizeTitleKeys` strips the same markers
(including number-first forms like "2 сезон") from search titles, so the
show-level match is unaffected by them.
Stalker applies the same correction before rendering: single-season regular,
embedded VOD and lazy `is_series` items use the resolved season for tabs,
quick-start labels, episode metadata and TMDB lookups. Lazy VOD corrects the
season VM before episodes load, retaining `providerSeasonKey` and
`providerSeasonNumber` for stable tracking IDs and legacy-position matching.
Portal requests still use the original `video_id` and season `id`. The marker
parser is independent of the UI language and accepts Russian and English
markers in either title field (`name` or `o_name`).
Lazy VOD season resources depend on provider item identity and mode rather
than the full selected metadata object, so a TMDB patch cannot reload the
season resource and discard loaded episodes. Episode replies apply only to
the exact loading season VM; a response from a previous selection or refresh
cannot populate a replacement season that happens to reuse its provider id.
Wiring: Xtream — `XtreamStore.enrichSelectedSerialSeason(seasonKey)` fired
from the serial detail's `(seasonSelected)`; Stalker — the series view
keeps a `${tmdbId}|${seasonKey}`-keyed map and overlays it inside its
`mappedSeasons` computed. Each Stalker entry records the RESOLVED season
it was fetched for: per-season slices of one show share
(tmdbId, provider key "1") but resolve to different seasons, and a fetch
made with stale detail-to-detail navigation context is overwritten once
the real context re-resolves. The fetch effect gates on coherence rather
`mappedSeasons` computed using the corrected display keys. Each Stalker entry
also records the resolved season it was fetched for, so a fetch made with
stale detail-to-detail navigation context can be replaced once the real
context resolves. The fetch effect gates on coherence rather
than timing: it waits while the season resource reloads and requires the
selected key to exist in the map with episodes. The retained season
selection deliberately survives navigation — the season container