jellyfin-web/dashboard-ui/scripts/livetvsuggested.js
2014-10-15 23:26:39 -04:00

61 lines
1.4 KiB
JavaScript

(function ($, document) {
function reload(page) {
Dashboard.showLoadingMsg();
ApiClient.getLiveTvRecommendedPrograms({
userId: Dashboard.getCurrentUserId(),
IsAiring: true,
limit: 10
}).done(function (result) {
var html = LibraryBrowser.getPosterViewHtml({
items: result.Items,
shape: "homePageSquare",
showTitle: true,
showParentTitle: true,
overlayText: true,
coverImage: true
});
$('.activeProgramItems', page).html(html).createCardMenus();
});
ApiClient.getLiveTvRecommendedPrograms({
userId: Dashboard.getCurrentUserId(),
IsAiring: false,
HasAired: false,
limit: 10
}).done(function (result) {
var html = LibraryBrowser.getPosterViewHtml({
items: result.Items,
shape: "homePageSquare",
showTitle: true,
showParentTitle: true,
overlayText: true,
coverImage: true
});
$('.upcomingProgramItems', page).html(html).createCardMenus();
});
}
$(document).on('pagebeforeshow', "#liveTvSuggestedPage", function () {
var page = this;
reload(page);
});
})(jQuery, document);