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

62 lines
1.5 KiB
JavaScript
Raw Normal View History

2014-01-12 08:58:47 -07:00
(function ($, document, apiClient) {
function reload(page) {
Dashboard.showLoadingMsg();
2014-05-09 12:43:06 -07:00
var screenWidth = $(window).width();
2014-01-12 08:58:47 -07:00
apiClient.getLiveTvRecommendedPrograms({
userId: Dashboard.getCurrentUserId(),
IsAiring: true,
limit: 12
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,
shape: "square",
2014-01-12 08:58:47 -07:00
showTitle: true,
showParentTitle: true,
2014-05-09 12:43:06 -07:00
overlayText: screenWidth >= 600,
2014-01-12 08:58:47 -07:00
coverImage: true
});
$('.activeProgramItems', page).html(html).createPosterItemMenus();
2014-01-12 08:58:47 -07:00
});
apiClient.getLiveTvRecommendedPrograms({
userId: Dashboard.getCurrentUserId(),
IsAiring: false,
HasAired: false,
limit: 12
2014-01-12 08:58:47 -07:00
}).done(function (result) {
var html = LibraryBrowser.getPosterViewHtml({
items: result.Items,
shape: "square",
2014-01-12 08:58:47 -07:00
showTitle: true,
showParentTitle: true,
2014-05-09 12:43:06 -07:00
overlayText: screenWidth >= 600,
2014-01-12 08:58:47 -07:00
coverImage: true
});
$('.upcomingProgramItems', page).html(html).createPosterItemMenus();
2014-01-12 08:58:47 -07:00
});
}
$(document).on('pagebeforeshow', "#liveTvSuggestedPage", function () {
var page = this;
reload(page);
});
})(jQuery, document, ApiClient);