Skip to content

Commit

Permalink
Made the series play button play the next episode
Browse files Browse the repository at this point in the history
  • Loading branch information
beef331 committed Oct 3, 2023
1 parent 3c443e2 commit e377b46
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion src/components/playback/playbackmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -1848,7 +1848,33 @@ class PlaybackManager {
SortBy: options.shuffle ? 'Random' : 'SortName',
MediaTypes: 'Audio'
});
} else if (firstItem.IsFolder && firstItem.CollectionType === 'homevideos') {
} else if (firstItem.Type === 'Series'){
promise = new Promise(function (resolve, reject) {
const apiClient = ServerConnections.getApiClient(firstItem.ServerId);
apiClient.getEpisodes(firstItem.Id, {
IsVirtualUnaired: false,
IsMissing: false,
UserId: apiClient.getCurrentUserId(),
Fields: 'Chapters'
}).then(function (episodesResult) {
let foundItem = false;
episodesResult.Items = episodesResult.Items.filter(function (e) {
if (foundItem) {
return true;
}
if (!e.UserData.Played) {
foundItem = true;
return true;
}

return false;
});
episodesResult.TotalRecordCount = episodesResult.Items.length;
resolve(episodesResult);
}, reject);
});

}else if (firstItem.IsFolder && firstItem.CollectionType === 'homevideos') {
promise = getItemsForPlayback(serverId, mergePlaybackQueries({
ParentId: firstItem.Id,
Filters: 'IsNotFolder',
Expand Down

0 comments on commit e377b46

Please sign in to comment.