From 3dd636d5200806141a47573fa7ebd5dfb3b31556 Mon Sep 17 00:00:00 2001 From: thornbill Date: Mon, 17 Nov 2025 11:14:12 -0500 Subject: [PATCH] Backport pull request #7301 from jellyfin-web/release-10.11.z Fix first episode when playing a series Original-merge: f077e294a971ff71cbb3fa54479a863dac66baa0 Merged-by: thornbill Backported-by: thornbill --- src/components/playback/playbackmanager.js | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/components/playback/playbackmanager.js b/src/components/playback/playbackmanager.js index f9c1f2512..39d39eaa1 100644 --- a/src/components/playback/playbackmanager.js +++ b/src/components/playback/playbackmanager.js @@ -1980,28 +1980,18 @@ export class PlaybackManager { const startSeasonId = firstItem.Type === 'Season' ? items[options.startIndex || 0].Id : undefined; const seasonId = (startSeasonId && items.length === 1) ? startSeasonId : undefined; - const seriesId = firstItem.SeriesId || firstItem.Id; + const SeriesId = firstItem.SeriesId || firstItem.Id; const UserId = apiClient.getCurrentUserId(); let startItemId; // Start from a specific (the next unwatched) episode if we want to watch in order and have not chosen a specific season if (!options.shuffle && !seasonId) { - const initialUnplayedEpisode = await getItems(apiClient, UserId, { - SortBy: 'SeriesSortName,SortName', - SortOrder: 'Ascending', - IncludeItemTypes: 'Episode', - Recursive: true, - IsMissing: false, - ParentId: seriesId, - limit: 1, - Filters: 'IsUnplayed' - }); - - startItemId = initialUnplayedEpisode?.Items?.at(0)?.Id; + const nextUp = await apiClient.getNextUpEpisodes({ SeriesId, UserId }); + startItemId = nextUp?.Items?.[0]?.Id; } - const episodesResult = await apiClient.getEpisodes(seriesId, { + const episodesResult = await apiClient.getEpisodes(SeriesId, { IsVirtualUnaired: false, IsMissing: false, SeasonId: seasonId,