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

56 lines
1.4 KiB
JavaScript
Raw Normal View History

2013-04-01 08:59:56 -07:00
(function ($, document) {
$(document).on('pageshow', "#moviesRecommendedPage", function () {
var page = this;
var options = {
SortBy: "DateCreated",
SortOrder: "Descending",
IncludeItemTypes: "Movie",
Limit: 5,
Recursive: true,
Fields: "PrimaryImageAspectRatio"
};
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
2013-04-01 22:14:37 -07:00
$('#recentlyAddedItems', page).html(LibraryBrowser.getPosterViewHtml({
2013-04-01 08:59:56 -07:00
items: result.Items,
useAverageAspectRatio: true
}));
});
options = {
SortBy: "DatePlayed",
SortOrder: "Descending",
IncludeItemTypes: "Movie",
Filters: "IsResumable",
Limit: 5,
Recursive: true,
Fields: "PrimaryImageAspectRatio"
};
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
if (result.Items.length) {
$('#resumableSection', page).show();
} else {
$('#resumableSection', page).hide();
}
2013-04-01 22:14:37 -07:00
$('#resumableItems', page).html(LibraryBrowser.getPosterViewHtml({
2013-04-01 08:59:56 -07:00
items: result.Items,
useAverageAspectRatio: true
}));
});
});
})(jQuery, document);