jellyfin-web/dashboard-ui/scripts/tvupcoming.js

55 lines
1.4 KiB
JavaScript
Raw Normal View History

2013-10-24 10:49:24 -07:00
(function ($, document) {
$(document).on('pagebeforeshow', "#tvUpcomingPage", function () {
var page = this;
var query = {
2013-10-24 10:49:24 -07:00
2014-03-05 22:17:13 -07:00
Limit: 32,
Fields: "SeriesInfo,UserData",
2014-05-29 12:34:20 -07:00
UserId: Dashboard.getCurrentUserId()
2013-10-24 10:49:24 -07:00
};
2014-06-14 16:13:09 -07:00
query.ParentId = LibraryMenu.getTopParentId();
2014-07-10 21:27:46 -07:00
var context = '';
if (query.ParentId) {
$('.scopedLibraryViewNav', page).show();
$('.globalNav', page).hide();
context = 'tv';
} else {
$('.scopedLibraryViewNav', page).hide();
$('.globalNav', page).show();
}
2014-07-01 22:16:59 -07:00
ApiClient.getJSON(ApiClient.getUrl("Shows/Upcoming", query)).done(function (result) {
2014-03-05 22:17:13 -07:00
var items = result.Items;
2014-03-31 14:04:22 -07:00
if (items.length) {
$('.noItemsMessage', page).hide();
} else {
$('.noItemsMessage', page).show();
2013-10-24 10:49:24 -07:00
}
2013-10-24 10:49:24 -07:00
$('#upcomingItems', page).html(LibraryBrowser.getPosterViewHtml({
2014-03-05 22:17:13 -07:00
items: items,
2013-10-24 10:49:24 -07:00
showLocationTypeIndicator: false,
shape: "backdrop",
showTitle: true,
showPremiereDate: true,
showPremiereDateIndex: true,
2014-05-29 12:34:20 -07:00
preferThumb: true,
2014-07-10 21:27:46 -07:00
context: context || 'home-upcoming',
lazy: true,
2014-03-05 22:17:13 -07:00
2014-05-29 12:34:20 -07:00
})).trigger('create').createPosterItemMenus();
2013-10-24 10:49:24 -07:00
});
});
})(jQuery, document);