diff --git a/src/components/playback/playbackmanager.js b/src/components/playback/playbackmanager.js index 67083788c5..a3e86ac4da 100644 --- a/src/components/playback/playbackmanager.js +++ b/src/components/playback/playbackmanager.js @@ -1868,16 +1868,17 @@ class PlaybackManager { }, queryOptions)); } else if (firstItem.Type === 'Series' || firstItem.Type === 'Season') { const apiClient = ServerConnections.getApiClient(firstItem.ServerId); + const isSeason = firstItem.Type === 'Season'; promise = apiClient.getEpisodes(firstItem.SeriesId || firstItem.Id, { IsVirtualUnaired: false, IsMissing: false, + SeasonId: isSeason ? firstItem.Id : undefined, SortBy: options.shuffle ? 'Random' : undefined, UserId: apiClient.getCurrentUserId(), Fields: ['Chapters', 'Trickplay'] }).then(function (episodesResult) { const originalResults = episodesResult.Items; - const isSeries = firstItem.Type === 'Series'; let foundItem = false; @@ -1887,7 +1888,7 @@ class PlaybackManager { return true; } - if (!e.UserData.Played && (isSeries || e.SeasonId === firstItem.Id)) { + if (!e.UserData.Played) { foundItem = true; return true; } @@ -1897,22 +1898,7 @@ class PlaybackManager { } if (episodesResult.Items.length === 0) { - if (isSeries) { - episodesResult.Items = originalResults; - } else { - episodesResult.Items = originalResults.filter(function (e) { - if (foundItem) { - return true; - } - - if (e.SeasonId === firstItem.Id) { - foundItem = true; - return true; - } - - return false; - }); - } + episodesResult.Items = originalResults; } episodesResult.TotalRecordCount = episodesResult.Items.length;