From ef00d439b1148de5acad9a5d9a928aa86ff7a792 Mon Sep 17 00:00:00 2001 From: viown <48097677+viown@users.noreply.github.com> Date: Tue, 27 Aug 2024 23:39:34 +0300 Subject: [PATCH] Fix play all & shuffle not working on genres (#5949) * Fix play all/shuffle not working on genres * re-order * add check for genre type * Update src/controllers/list.js Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/components/playback/playbackmanager.js | 9 +++++++++ src/controllers/list.js | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/src/components/playback/playbackmanager.js b/src/components/playback/playbackmanager.js index a848416b52..4fcc333b5c 100644 --- a/src/components/playback/playbackmanager.js +++ b/src/components/playback/playbackmanager.js @@ -1862,6 +1862,15 @@ class PlaybackManager { SortBy: options.shuffle ? 'Random' : 'SortName', MediaTypes: 'Audio' }, queryOptions)); + case 'Genre': + return getItemsForPlayback(serverId, mergePlaybackQueries({ + GenreIds: firstItem.Id, + ParentId: firstItem.ParentId, + Filters: 'IsNotFolder', + Recursive: true, + SortBy: options.shuffle ? 'Random' : 'SortName', + MediaTypes: 'Video' + }, queryOptions)); case 'Series': case 'Season': return getSeriesOrSeasonPlaybackPromise(firstItem, options, items); diff --git a/src/controllers/list.js b/src/controllers/list.js index 54afc87ebe..41613932c8 100644 --- a/src/controllers/list.js +++ b/src/controllers/list.js @@ -851,6 +851,10 @@ class ItemsView { setTitle(null); getItem(params).then(function (item) { setTitle(item); + if (item.Type == 'Genre') { + item.ParentId = params.parentId; + } + self.currentItem = item; const refresh = !isRestored; self.itemsContainer.resume({