1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Merge pull request #2943 from thornbill/fix-play-all

Fix play all and shuffle buttons
This commit is contained in:
Bill Thornton 2021-09-17 14:03:18 -04:00 committed by GitHub
commit 2cf9f05c43
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 3 deletions

View file

@ -791,21 +791,37 @@ class ItemsView {
const itemType = item ? item.Type : null;
if (itemType === 'MusicGenre' || params.type !== 'Programs' && itemType !== 'Channel') {
if ((itemType === 'MusicGenre' || params.type !== 'Programs' && itemType !== 'Channel')
// Folder, Playlist views
&& itemType !== 'UserView'
// Only Photo (homevideos) CollectionFolders are supported
&& !(itemType === 'CollectionFolder' && item?.CollectionType !== 'homevideos')
) {
// Show Play All buttons
hideOrShowAll(view.querySelectorAll('.btnPlay'), false);
} else {
// Hide Play All buttons
hideOrShowAll(view.querySelectorAll('.btnPlay'), true);
}
if (itemType === 'MusicGenre' || params.type !== 'Programs' && params.type !== 'nextup' && itemType !== 'Channel') {
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 !== 'homevideos')
) {
// Show Shuffle buttons
hideOrShowAll(view.querySelectorAll('.btnShuffle'), false);
} else {
// Hide Shuffle buttons
hideOrShowAll(view.querySelectorAll('.btnShuffle'), true);
}
if (item && playbackManager.canQueue(item)) {
// Show Queue button
hideOrShowAll(view.querySelectorAll('.btnQueue'), false);
} else {
// Hide Queue button
hideOrShowAll(view.querySelectorAll('.btnQueue'), true);
}
});