mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
fixes #839 - Support getting latest channel items
This commit is contained in:
parent
77b267a916
commit
4beb349afe
17 changed files with 239 additions and 19 deletions
|
@ -1,8 +1,6 @@
|
|||
(function ($, document) {
|
||||
|
||||
function loadNextUp(page) {
|
||||
|
||||
var screenWidth = $(window).width();
|
||||
function reload(page) {
|
||||
|
||||
var query = {
|
||||
|
||||
|
@ -18,10 +16,47 @@
|
|||
|
||||
$('.scopedLibraryViewNav', page).show();
|
||||
$('.globalNav', page).hide();
|
||||
$('.homeEhsContent', page).css('text-align', 'left');
|
||||
$('.scopedContent', page).show();
|
||||
|
||||
loadResume(page);
|
||||
|
||||
} else {
|
||||
$('.scopedLibraryViewNav', page).hide();
|
||||
$('.globalNav', page).show();
|
||||
$('.homeEhsContent', page).css('text-align', 'center');
|
||||
$('.scopedContent', page).hide();
|
||||
}
|
||||
|
||||
loadNextUp(page);
|
||||
}
|
||||
|
||||
function loadNextUp(page) {
|
||||
|
||||
var screenWidth = $(window).width();
|
||||
|
||||
var query = {
|
||||
|
||||
Limit: 24,
|
||||
Fields: "PrimaryImageAspectRatio,SeriesInfo,DateCreated",
|
||||
UserId: Dashboard.getCurrentUserId(),
|
||||
ExcludeLocationTypes: "Virtual"
|
||||
};
|
||||
|
||||
query.ParentId = LibraryMenu.getTopParentId();
|
||||
|
||||
if (query.ParentId) {
|
||||
|
||||
$('.scopedLibraryViewNav', page).show();
|
||||
$('.globalNav', page).hide();
|
||||
$('.ehsContent', page).css('text-align', 'left').removeClass('homeEhsContent');
|
||||
$('.scopedContent', page).show();
|
||||
|
||||
} else {
|
||||
$('.scopedLibraryViewNav', page).hide();
|
||||
$('.globalNav', page).show();
|
||||
$('.ehsContent', page).css('text-align', 'center').addClass('homeEhsContent');
|
||||
$('.scopedContent', page).hide();
|
||||
}
|
||||
|
||||
ApiClient.getNextUpEpisodes(query).done(function (result) {
|
||||
|
@ -46,11 +81,50 @@
|
|||
});
|
||||
}
|
||||
|
||||
function loadResume(page) {
|
||||
|
||||
var screenWidth = $(window).width();
|
||||
|
||||
var parentId = LibraryMenu.getTopParentId();
|
||||
|
||||
var options = {
|
||||
|
||||
SortBy: "DatePlayed",
|
||||
SortOrder: "Descending",
|
||||
IncludeItemTypes: "Episode",
|
||||
Filters: "IsResumable",
|
||||
Limit: screenWidth >= 1920 ? 5 : 4,
|
||||
Recursive: true,
|
||||
Fields: "PrimaryImageAspectRatio,SeriesInfo,UserData",
|
||||
ExcludeLocationTypes: "Virtual",
|
||||
ParentId: parentId
|
||||
};
|
||||
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
|
||||
|
||||
if (result.Items.length) {
|
||||
$('#resumableSection', page).show();
|
||||
} else {
|
||||
$('#resumableSection', page).hide();
|
||||
}
|
||||
|
||||
$('#resumableItems', page).html(LibraryBrowser.getPosterViewHtml({
|
||||
items: result.Items,
|
||||
shape: "backdrop",
|
||||
showTitle: true,
|
||||
showParentTitle: true,
|
||||
overlayText: screenWidth >= 600
|
||||
|
||||
})).createPosterItemMenus();
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
$(document).on('pagebeforeshow', "#tvRecommendedPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
loadNextUp(page);
|
||||
reload(page);
|
||||
});
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue