mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Include season id in request when retrieving episodes
This also fixes shuffling an individual season (broken since at least 10.8.13, probably earlier)
This commit is contained in:
parent
27984fe083
commit
f71cc8026a
1 changed files with 4 additions and 18 deletions
|
@ -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.TotalRecordCount = episodesResult.Items.length;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue