define(['libraryBrowser', 'appSettings', 'components/groupedcards', 'scrollStyles', 'emby-button', 'paper-icon-button-light', 'emby-itemscontainer'], function (LibraryBrowser, appSettings, groupedcards) {
function getUserViews(userId) {
return ApiClient.getUserViews({}, userId).then(function (result) {
var items = result.Items;
var list = [];
for (var i = 0, length = items.length; i < length; i++) {
var view = items[i];
if (AppInfo.isNativeApp && browserInfo.safari && view.CollectionType == 'livetv') {
continue;
}
list.push(view);
}
return list;
});
}
function enableScrollX() {
return browserInfo.mobile && AppInfo.enableAppLayouts;
}
function getThumbShape() {
return enableScrollX() ? 'overflowBackdrop' : 'backdrop';
}
function getPortraitShape() {
return enableScrollX() ? 'overflowPortrait' : 'portrait';
}
function getLibraryButtonsHtml(items) {
var html = "";
// "My Library" backgrounds
for (var i = 0, length = items.length; i < length; i++) {
var item = items[i];
var icon;
var backgroundColor = 'rgba(82, 181, 75, 0.9)';
switch (item.CollectionType) {
case "movies":
icon = "local_movies";
backgroundColor = 'rgba(176, 94, 81, 0.9)';
break;
case "music":
icon = "library_music";
backgroundColor = 'rgba(217, 145, 67, 0.9)';
break;
case "photos":
icon = "photo";
backgroundColor = 'rgba(127, 0, 0, 0.9)';
break;
case "livetv":
icon = "live_tv";
backgroundColor = 'rgba(217, 145, 67, 0.9)';
break;
case "tvshows":
icon = "live_tv";
backgroundColor = 'rgba(77, 88, 164, 0.9)';
break;
case "games":
icon = "folder";
backgroundColor = 'rgba(183, 202, 72, 0.9)';
break;
case "trailers":
icon = "local_movies";
backgroundColor = 'rgba(176, 94, 81, 0.9)';
break;
case "homevideos":
icon = "video_library";
backgroundColor = 'rgba(110, 52, 32, 0.9)';
break;
case "musicvideos":
icon = "video_library";
backgroundColor = 'rgba(143, 54, 168, 0.9)';
break;
case "books":
icon = "folder";
break;
case "channels":
icon = "folder";
backgroundColor = 'rgba(51, 136, 204, 0.9)';
break;
case "playlists":
icon = "folder";
break;
default:
icon = "folder";
break;
}
var cssClass = 'card smallBackdropCard buttonCard';
if (item.CollectionType) {
cssClass += ' ' + item.CollectionType + 'buttonCard';
}
var href = item.url || LibraryBrowser.getHref(item);
var onclick = item.onclick ? ' onclick="' + item.onclick + '"' : '';
icon = item.icon || icon;
html += '';
html += '
';
if (index) {
html += '
A beautiful app for your TV and large screen tablet. ' + nameText + ' runs on Windows, Xbox One, Google Chrome, FireFox, Microsoft Edge and Opera.
'; html += 'Design beautiful Cover Art, enjoy free access to Emby apps, and more. ' + learnMoreText + '
'; html += 'Combined horizontal and vertical swiping, better detail layouts, and more. ' + learnMoreText + '
'; html += '