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

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

View file

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

View file

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