1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00
jellyfin-web/dashboard-ui/scripts/tvrecommended.js

70 lines
2.1 KiB
JavaScript
Raw Normal View History

2013-04-01 18:28:01 -07:00
(function ($, document) {
2013-04-30 23:28:26 -04:00
$(document).on('pagebeforeshow', "#tvRecommendedPage", function () {
var screenWidth = $(window).width();
2013-04-30 23:28:26 -04:00
var page = this;
var options = {
SortBy: "DateCreated",
SortOrder: "Descending",
IncludeItemTypes: "Episode",
Limit: screenWidth >= 1920 ? 20 : (screenWidth >= 1440 ? 16 : 15),
2013-04-30 23:28:26 -04:00
Recursive: true,
2013-05-03 22:33:44 -04:00
Fields: "PrimaryImageAspectRatio,SeriesInfo,UserData",
Filters: "IsUnplayed",
ExcludeLocationTypes: "Virtual"
2013-04-30 23:28:26 -04:00
};
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
$('#recentlyAddedItems', page).html(LibraryBrowser.getPosterViewHtml({
items: result.Items,
useAverageAspectRatio: true,
shape: "backdrop",
showTitle: true,
2013-12-22 12:16:24 -05:00
showParentTitle: true,
overlayText: true
2014-01-14 10:50:39 -05:00
})).createPosterItemHoverMenu();
2013-04-30 23:28:26 -04:00
});
options = {
SortBy: "DatePlayed",
SortOrder: "Descending",
IncludeItemTypes: "Episode",
Filters: "IsResumable",
Limit: screenWidth >= 1920 ? 5 : (screenWidth >= 1440 ? 4 : 3),
2013-04-30 23:28:26 -04:00
Recursive: true,
2013-10-24 13:49:24 -04:00
Fields: "PrimaryImageAspectRatio,SeriesInfo,UserData",
ExcludeLocationTypes: "Virtual"
2013-04-30 23:28:26 -04:00
};
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,
2013-05-03 22:33:44 -04:00
showParentTitle: true,
2013-12-22 12:16:24 -05:00
overlayText: true
2014-01-14 10:50:39 -05:00
})).createPosterItemHoverMenu();
2013-04-30 23:28:26 -04:00
});
});
2013-04-01 18:28:01 -07:00
})(jQuery, document);