Add Play All and Shuffle buttons to Music Videos Libraries (#6866)

* Add play all & shuffle to Music Videos

* Update comments

---------

Co-authored-by: Max <no@example.com>
This commit is contained in:
theguymadmax
2025-10-10 00:10:04 -05:00
committed by GitHub
parent e83279b69f
commit ae99ac8b03
2 changed files with 13 additions and 4 deletions

View File

@@ -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) {

View File

@@ -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);