mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-06-02 20:18:29 +01:00
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:
@@ -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");
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user