From 6e35785a5c77595b4666535543e78de6e5a1b07b Mon Sep 17 00:00:00 2001 From: Gauvain Date: Tue, 2 Jun 2026 00:32:59 +0200 Subject: [PATCH] fix(casting): exclude Virtual (missing) episodes from cast episode list & nav MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- utils/casting/episodes.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utils/casting/episodes.ts b/utils/casting/episodes.ts index a6f879c36..86fdeb926 100644 --- a/utils/casting/episodes.ts +++ b/utils/casting/episodes.ts @@ -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"); };