support channel folders

This commit is contained in:
Luke Pulverenti 2014-05-04 20:46:52 -04:00
parent b88819dd78
commit 636ea91460
4 changed files with 20 additions and 10 deletions

View File

@ -9,7 +9,7 @@
<div data-role="content">
<div class="viewSettings">
<h1 style="margin: 0 1em 0 0; display: inline-block; vertical-align: middle;">Trailers</h1>
<h1 class="categoryTitle" style="margin: 0 1em 0 0; display: inline-block; vertical-align: middle;"></h1>
<div class="viewControls" data-role="controlgroup" data-type="horizontal">
<button data-mini="true" data-icon="sort" data-inline="true" data-iconpos="notext" title="${ButtonSort}" onclick="$('#sortPanel', $(this).parents('.page')).panel( 'toggle' );">${ButtonSort}</button>

View File

@ -9,7 +9,7 @@
};
function getSavedQueryId() {
return 'channels-' + getParameterByName('id');
return 'channels-' + getParameterByName('id') + (getParameterByName('categoryId') || '');
}
function showLoadingMessage(page) {
@ -26,9 +26,15 @@
showLoadingMessage(page);
var channelId = getParameterByName('id');
var categoryId = getParameterByName('categoryId');
query.UserId = Dashboard.getCurrentUserId();
ApiClient.getItem(query.UserId, categoryId || channelId).done(function (item) {
$('.categoryTitle', page).html(item.Name);
});
$.getJSON(ApiClient.getUrl("Channels/" + channelId + "/Items", query)).done(function (result) {
// Scroll back up so they can see the results from the beginning
@ -42,7 +48,7 @@
html = LibraryBrowser.getPosterViewHtml({
items: result.Items,
shape: "portrait",
shape: "auto",
context: 'channels',
showTitle: true,
centerText: true

View File

@ -16,10 +16,9 @@
$('.myLibrary', page).html(LibraryBrowser.getPosterViewHtml({
items: result.Items,
preferBackdrop: true,
shape: 'backdrop',
overlayText: true,
showTitle: true
showTitle: true,
centerText: true
})).createPosterItemMenus();

View File

@ -1,11 +1,11 @@
var LibraryBrowser = (function (window, document, $, screen, localStorage) {
$(function() {
$(function () {
$("body").on("create", function () {
$(".lazy").unveil(200);
});
});
var defaultBackground = "#333";
return {
@ -346,7 +346,7 @@
if (!item) {
throw new Error('item cannot be null');
}
if (item.url) {
return item.url;
}
@ -362,6 +362,9 @@
if (item.Type == "Channel") {
return "channelitems.html?id=" + id;
}
if (item.Type == "ChannelCategoryItem") {
return "channelitems.html?id=" + item.ChannelId + '&categoryId=' + item.Id;
}
if (item.Type == "Program") {
return "livetvprogram.html?id=" + id;
}
@ -440,10 +443,12 @@
var html = "";
var primaryImageAspectRatio = options.shape == 'auto' ? LibraryBrowser.getAveragePrimaryImageAspectRatio(items) : null;
var primaryImageAspectRatio;
if (options.shape == 'auto') {
primaryImageAspectRatio = options.shape == 'auto' ? LibraryBrowser.getAveragePrimaryImageAspectRatio(items) : null;
if (primaryImageAspectRatio && Math.abs(primaryImageAspectRatio - 1.777777778) < .3) {
options.shape = 'backdrop';
}