mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-18 11:28:23 -07:00
64 lines
1.8 KiB
JavaScript
64 lines
1.8 KiB
JavaScript
(function ($, document) {
|
|
|
|
$(document).on('pagebeforeshow', "#tvRecommendedPage", function () {
|
|
|
|
var page = this;
|
|
|
|
var options = {
|
|
|
|
SortBy: "DateCreated",
|
|
SortOrder: "Descending",
|
|
IncludeItemTypes: "Episode",
|
|
Limit: 8,
|
|
Recursive: true,
|
|
Fields: "PrimaryImageAspectRatio,SeriesInfo,UserData",
|
|
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: 8,
|
|
Recursive: true,
|
|
Fields: "PrimaryImageAspectRatio,SeriesInfo,UserData"
|
|
};
|
|
|
|
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,
|
|
showProgressBar: true
|
|
}));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
})(jQuery, document); |