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

Hide play all and shuffle buttons for unsupported types

This commit is contained in:
Bill Thornton 2021-09-09 11:43:51 -04:00
parent 4573a1a233
commit b9d503f10f

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')
) {
// Hide Play All buttons
hideOrShowAll(view.querySelectorAll('.btnPlay'), false);
} else {
// Show 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')
) {
// Hide Shuffle buttons
hideOrShowAll(view.querySelectorAll('.btnShuffle'), false);
} else {
// Show Shuffle buttons
hideOrShowAll(view.querySelectorAll('.btnShuffle'), true);
}
if (item && playbackManager.canQueue(item)) {
// Hide Queue button
hideOrShowAll(view.querySelectorAll('.btnQueue'), false);
} else {
// Show Queue button
hideOrShowAll(view.querySelectorAll('.btnQueue'), true);
}
});