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

115 lines
2.8 KiB
JavaScript
Raw Normal View History

2014-10-15 20:26:39 -07:00
(function ($, document) {
2014-01-12 08:58:47 -07:00
2015-05-15 11:28:34 -07:00
function loadRecommendedPrograms(page) {
2014-01-12 08:58:47 -07:00
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,
2015-04-11 18:38:38 -07:00
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-03-14 13:56:50 -07:00
shape: "auto",
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();
2015-05-15 11:28:34 -07:00
Dashboard.hideLoadingMsg();
2014-01-12 08:58:47 -07:00
});
2015-05-15 11:28:34 -07:00
}
function reload(page) {
loadRecommendedPrograms(page);
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,
2015-04-11 18:38:38 -07:00
limit: 9,
2015-04-03 09:31:56 -07:00
IsMovie: false,
IsSports: false
2014-01-12 08:58:47 -07:00
}).done(function (result) {
var html = LibraryBrowser.getPosterViewHtml({
items: result.Items,
2015-03-14 13:56:50 -07:00
shape: "auto",
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
});
2015-03-14 13:56:50 -07:00
ApiClient.getLiveTvRecommendedPrograms({
userId: Dashboard.getCurrentUserId(),
IsAiring: false,
HasAired: false,
2015-04-11 18:38:38 -07:00
limit: 9,
2015-03-14 13:56:50 -07:00
IsMovie: true
}).done(function (result) {
var html = LibraryBrowser.getPosterViewHtml({
items: result.Items,
shape: "auto",
2015-04-11 18:38:38 -07:00
showTitle: false,
2015-03-14 13:56:50 -07:00
coverImage: true,
overlayText: false,
lazy: true
});
$('.upcomingTvMovieItems', page).html(html).lazyChildren();
});
2015-04-03 09:31:56 -07:00
ApiClient.getLiveTvRecommendedPrograms({
userId: Dashboard.getCurrentUserId(),
IsAiring: false,
HasAired: false,
2015-04-11 18:38:38 -07:00
limit: 9,
2015-04-03 09:31:56 -07:00
IsSports: true
}).done(function (result) {
var html = LibraryBrowser.getPosterViewHtml({
items: result.Items,
shape: "auto",
2015-04-11 18:38:38 -07:00
showTitle: false,
2015-04-03 09:31:56 -07:00
coverImage: true,
overlayText: false,
lazy: true
});
$('.upcomingSportsItems', page).html(html).lazyChildren();
});
2014-01-12 08:58:47 -07:00
}
2015-05-19 12:15:40 -07:00
$(document).on('pageshowready', "#liveTvSuggestedPage", function () {
2014-01-12 08:58:47 -07:00
var page = this;
reload(page);
});
2014-10-15 20:26:39 -07:00
})(jQuery, document);