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

61 lines
1.4 KiB
JavaScript
Raw Normal View History

2014-01-12 08:58:47 -07:00
(function ($, document, apiClient) {
function reload(page) {
Dashboard.showLoadingMsg();
apiClient.getLiveTvRecommendedPrograms({
userId: Dashboard.getCurrentUserId(),
IsAiring: true,
2014-07-11 19:31:08 -07:00
limit: 10
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,
2014-08-01 19:34:45 -07:00
shape: "homePageSquare",
2014-01-12 08:58:47 -07:00
showTitle: true,
showParentTitle: true,
2014-08-01 19:34:45 -07:00
overlayText: true,
2014-01-12 08:58:47 -07:00
coverImage: true
});
2014-08-01 19:34:45 -07:00
$('.activeProgramItems', page).html(html).createCardMenus();
2014-01-12 08:58:47 -07:00
});
apiClient.getLiveTvRecommendedPrograms({
userId: Dashboard.getCurrentUserId(),
IsAiring: false,
HasAired: false,
2014-07-11 19:31:08 -07:00
limit: 10
2014-01-12 08:58:47 -07:00
}).done(function (result) {
var html = LibraryBrowser.getPosterViewHtml({
items: result.Items,
2014-08-01 19:34:45 -07:00
shape: "homePageSquare",
2014-01-12 08:58:47 -07:00
showTitle: true,
showParentTitle: true,
2014-08-01 19:34:45 -07:00
overlayText: true,
2014-01-12 08:58:47 -07:00
coverImage: true
});
2014-08-01 19:34:45 -07:00
$('.upcomingProgramItems', page).html(html).createCardMenus();
2014-01-12 08:58:47 -07:00
});
}
$(document).on('pagebeforeshow', "#liveTvSuggestedPage", function () {
var page = this;
reload(page);
});
})(jQuery, document, ApiClient);