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

85 lines
2.2 KiB
JavaScript
Raw Normal View History

2013-04-01 08:59:56 -07:00
(function ($, document) {
$(document).on('pagebeforeshow', "#moviesRecommendedPage", function () {
2013-04-01 08:59:56 -07:00
var page = this;
var options = {
SortBy: "DateCreated",
SortOrder: "Descending",
IncludeItemTypes: "Movie",
Limit: 5,
Recursive: true,
2013-04-04 21:15:00 -07:00
Fields: "PrimaryImageAspectRatio",
Filters: "IsUnplayed"
2013-04-01 08:59:56 -07:00
};
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,
2013-04-09 21:38:04 -07:00
useAverageAspectRatio: true,
showNewIndicator: false
2013-04-01 08:59:56 -07:00
}));
});
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
}));
});
2013-04-04 21:15:00 -07:00
options = {
SortBy: "DateCreated",
SortOrder: "Descending",
IncludeItemTypes: "Trailer",
Limit: 5,
Recursive: true,
2013-04-09 21:38:04 -07:00
Fields: "PrimaryImageAspectRatio,DateCreated",
2013-04-04 21:15:00 -07:00
Filters: "IsUnplayed"
};
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
if (result.Items.length) {
$('#trailerSection', page).show();
} else {
$('#trailerSection', page).hide();
}
$('#trailerItems', page).html(LibraryBrowser.getPosterViewHtml({
items: result.Items,
useAverageAspectRatio: true
}));
});
2013-04-01 08:59:56 -07:00
});
})(jQuery, document);