mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 19:08:18 -07:00
Merge pull request #418 from Abbe98/nonplayable-collection
if collection has no playable items hide play and shuffle btns
This commit is contained in:
commit
046deb4a50
@ -880,6 +880,16 @@ define(["loading", "appRouter", "layoutManager", "connectionManager", "cardBuild
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function canPlaySomeItemInCollection(items) {
|
||||||
|
var i = 0;
|
||||||
|
for (length = items.length; i < length; i++) {
|
||||||
|
if (playbackManager.canPlay(items[i])) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
function renderCollectionItems(page, parentItem, types, items) {
|
function renderCollectionItems(page, parentItem, types, items) {
|
||||||
page.querySelector(".collectionItems").innerHTML = "";
|
page.querySelector(".collectionItems").innerHTML = "";
|
||||||
var i, length;
|
var i, length;
|
||||||
@ -904,6 +914,12 @@ define(["loading", "appRouter", "layoutManager", "connectionManager", "cardBuild
|
|||||||
renderChildren(page, parentItem)
|
renderChildren(page, parentItem)
|
||||||
};
|
};
|
||||||
for (i = 0, length = containers.length; i < length; i++) containers[i].notifyRefreshNeeded = notifyRefreshNeeded
|
for (i = 0, length = containers.length; i < length; i++) containers[i].notifyRefreshNeeded = notifyRefreshNeeded
|
||||||
|
|
||||||
|
// if nothing in the collection can be played hide play and shuffle buttons
|
||||||
|
if (!canPlaySomeItemInCollection(items)) {
|
||||||
|
hideAll(page, "btnPlay", false);
|
||||||
|
hideAll(page, "btnShuffle", false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderCollectionItemType(page, parentItem, type, items) {
|
function renderCollectionItemType(page, parentItem, type, items) {
|
||||||
|
Loading…
Reference in New Issue
Block a user