From ae99ac8b033e3be6830b1c2d69c75060aa632894 Mon Sep 17 00:00:00 2001 From: theguymadmax Date: Fri, 10 Oct 2025 00:10:04 -0500 Subject: [PATCH] Add Play All and Shuffle buttons to Music Videos Libraries (#6866) * Add play all & shuffle to Music Videos * Update comments --------- Co-authored-by: Max --- src/components/playback/playbackmanager.js | 9 +++++++++ src/controllers/list.js | 8 ++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/components/playback/playbackmanager.js b/src/components/playback/playbackmanager.js index 8fad4915f4..d8855fc018 100644 --- a/src/components/playback/playbackmanager.js +++ b/src/components/playback/playbackmanager.js @@ -1940,6 +1940,15 @@ export class PlaybackManager { MediaTypes: 'Photo', Limit: UNLIMITED_ITEMS }, queryOptions)); + } else if (firstItem.IsFolder && firstItem.CollectionType === 'musicvideos') { + return getItemsForPlayback(serverId, mergePlaybackQueries({ + ParentId: firstItem.Id, + Filters: 'IsFolder', + Recursive: true, + SortBy: options.shuffle ? 'Random' : 'SortName', + MediaTypes: 'Video', + Limit: UNLIMITED_ITEMS + }, queryOptions)); } else if (firstItem.IsFolder) { let sortBy = null; if (options.shuffle) { diff --git a/src/controllers/list.js b/src/controllers/list.js index 2c3d09019e..1e2a77fbc2 100644 --- a/src/controllers/list.js +++ b/src/controllers/list.js @@ -889,8 +889,8 @@ class ItemsView { if ((itemType === 'MusicGenre' || params.type !== 'Programs' && itemType !== 'Channel') // Folder, Playlist views && itemType !== 'UserView' - // Only Photo (homevideos) CollectionFolders are supported - && !(itemType === 'CollectionFolder' && item?.CollectionType !== CollectionType.Homevideos) + // Only Photo (homevideos) and Music Video CollectionFolders are supported + && !(itemType === 'CollectionFolder' && item?.CollectionType !== CollectionType.Homevideos && item?.CollectionType !== CollectionType.Musicvideos) ) { // Show Play All buttons hideOrShowAll(view.querySelectorAll('.btnPlay'), false); @@ -902,8 +902,8 @@ class ItemsView { if ((itemType === 'MusicGenre' || params.type !== 'Programs' && params.type !== 'nextup' && itemType !== 'Channel') // Folder, Playlist views && itemType !== 'UserView' - // Only Photo (homevideos) CollectionFolders are supported - && !(itemType === 'CollectionFolder' && item?.CollectionType !== CollectionType.Homevideos) + // Only Photo (homevideos) and Music Video CollectionFolders are supported + && !(itemType === 'CollectionFolder' && item?.CollectionType !== CollectionType.Homevideos && item?.CollectionType !== CollectionType.Musicvideos) ) { // Show Shuffle buttons hideOrShowAll(view.querySelectorAll('.btnShuffle'), false);