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

63 lines
1.4 KiB
JavaScript
Raw Normal View History

2014-10-15 20:26:39 -07:00
(function ($, document) {
2014-01-12 08:58:47 -07:00
function reload(page) {
Dashboard.showLoadingMsg();
2014-10-15 20:26:39 -07:00
ApiClient.getLiveTvRecommendedPrograms({
2014-01-12 08:58:47 -07:00
userId: Dashboard.getCurrentUserId(),
IsAiring: true,
limit: 18
2014-01-12 08:58:47 -07:00
}).done(function (result) {
2014-05-09 12:43:06 -07:00
2014-01-12 08:58:47 -07:00
var html = LibraryBrowser.getPosterViewHtml({
items: result.Items,
2015-01-04 07:18:28 -07:00
shape: "square",
2014-01-12 08:58:47 -07:00
showTitle: true,
showParentTitle: true,
2014-08-01 19:34:45 -07:00
overlayText: true,
2015-01-22 23:15:15 -07:00
coverImage: true,
lazy: true
2014-01-12 08:58:47 -07:00
});
2015-01-22 23:15:15 -07:00
$('.activeProgramItems', page).html(html).lazyChildren();
2014-01-12 08:58:47 -07:00
});
2014-10-15 20:26:39 -07:00
ApiClient.getLiveTvRecommendedPrograms({
2014-01-12 08:58:47 -07:00
userId: Dashboard.getCurrentUserId(),
IsAiring: false,
HasAired: false,
limit: 18
2014-01-12 08:58:47 -07:00
}).done(function (result) {
var html = LibraryBrowser.getPosterViewHtml({
items: result.Items,
2015-01-04 07:18:28 -07:00
shape: "square",
2014-01-12 08:58:47 -07:00
showTitle: true,
showParentTitle: true,
2014-08-01 19:34:45 -07:00
overlayText: true,
2015-01-22 23:15:15 -07:00
coverImage: true,
lazy: true
2014-01-12 08:58:47 -07:00
});
2015-01-22 23:15:15 -07:00
$('.upcomingProgramItems', page).html(html).lazyChildren();
2014-01-12 08:58:47 -07:00
});
}
$(document).on('pagebeforeshow', "#liveTvSuggestedPage", function () {
var page = this;
reload(page);
});
2014-10-15 20:26:39 -07:00
})(jQuery, document);