fix(casting): exclude Virtual (missing) episodes from cast episode list & nav

The cast player derives the episode list, prev/next buttons and autoplay
target from fetchSeriesEpisodes, which returned every episode including
"Virtual" (missing) ones — e.g. an empty Specials/Season 0 entry. That
made a bogus "previous" button appear on S1E1 (its previous was the missing
S0E1) and could load/autoplay an unplayable episode. Filter them out at the
source so they never surface in the cast UI.
This commit is contained in:
Gauvain
2026-06-02 00:32:59 +02:00
parent c7c3aa8a34
commit 6e35785a5c

View File

@@ -34,5 +34,8 @@ export const fetchSeriesEpisodes = async (
seriesId,
userId: api.accessToken ? undefined : "",
});
return res.data.Items ?? [];
// Drop "Virtual" (missing) episodes — e.g. an empty Specials/Season 0 entry
// that has no media file. They must not appear in the cast episode list nor
// be offered as prev/next/autoplay targets (they can't be cast).
return (res.data.Items ?? []).filter((e) => e.LocationType !== "Virtual");
};