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

63 lines
1.7 KiB
JavaScript
Raw Normal View History

2013-04-01 18:28:01 -07:00
(function ($, document) {
2013-04-30 20:28:26 -07:00
$(document).on('pagebeforeshow', "#tvRecommendedPage", function () {
var page = this;
var options = {
SortBy: "DateCreated",
SortOrder: "Descending",
IncludeItemTypes: "Episode",
Limit: 6,
Recursive: true,
Fields: "PrimaryImageAspectRatio,SeriesInfo",
Filters: "IsUnplayed"
};
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
$('#recentlyAddedItems', page).html(LibraryBrowser.getPosterViewHtml({
items: result.Items,
useAverageAspectRatio: true,
showNewIndicator: false,
shape: "backdrop",
showTitle: true,
showParentTitle: true
}));
});
options = {
SortBy: "DatePlayed",
SortOrder: "Descending",
IncludeItemTypes: "Episode",
Filters: "IsResumable",
Limit: 6,
Recursive: true,
Fields: "PrimaryImageAspectRatio,SeriesInfo,DateCreated"
};
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
if (result.Items.length) {
$('#resumableSection', page).show();
} else {
$('#resumableSection', page).hide();
}
$('#resumableItems', page).html(LibraryBrowser.getPosterViewHtml({
items: result.Items,
useAverageAspectRatio: true,
shape: "backdrop",
showTitle: true,
showParentTitle: true
}));
});
});
2013-04-01 18:28:01 -07:00
})(jQuery, document);