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

58 lines
1.2 KiB
JavaScript
Raw Normal View History

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