2013-04-14 20:37:07 -07:00
|
|
|
(function ($, document) {
|
|
|
|
|
2013-09-08 14:16:13 -07:00
|
|
|
$(document).on('pagebeforeshow', "#gamesRecommendedPage", function () {
|
2013-04-14 20:37:07 -07:00
|
|
|
|
2013-09-08 14:16:13 -07:00
|
|
|
var page = this;
|
2013-04-14 20:37:07 -07:00
|
|
|
|
2013-09-08 14:16:13 -07:00
|
|
|
var options = {
|
2013-04-14 20:37:07 -07:00
|
|
|
|
2013-09-08 14:16:13 -07:00
|
|
|
SortBy: "DateCreated",
|
|
|
|
SortOrder: "Descending",
|
|
|
|
MediaTypes: "Game",
|
|
|
|
Limit: 5,
|
2013-10-28 07:56:57 -07:00
|
|
|
Recursive: true
|
2013-09-08 14:16:13 -07:00
|
|
|
};
|
2013-04-14 20:37:07 -07:00
|
|
|
|
2013-09-08 14:16:13 -07:00
|
|
|
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
|
2013-04-14 20:37:07 -07:00
|
|
|
|
2013-09-08 14:16:13 -07:00
|
|
|
$('#recentlyAddedItems', page).html(LibraryBrowser.getPosterViewHtml({
|
|
|
|
items: result.Items,
|
2013-10-28 07:56:57 -07:00
|
|
|
useAverageAspectRatio: false,
|
2013-09-08 14:16:13 -07:00
|
|
|
showNewIndicator: false,
|
|
|
|
transparent: true,
|
2013-10-04 17:44:43 -07:00
|
|
|
borderless: true
|
2013-09-08 14:16:13 -07:00
|
|
|
}));
|
2013-04-14 20:37:07 -07:00
|
|
|
|
2013-09-08 14:16:13 -07:00
|
|
|
});
|
2013-04-14 20:37:07 -07:00
|
|
|
|
2013-09-08 14:16:13 -07:00
|
|
|
options = {
|
2013-04-14 20:37:07 -07:00
|
|
|
|
2013-09-08 14:16:13 -07:00
|
|
|
SortBy: "DatePlayed",
|
|
|
|
SortOrder: "Descending",
|
|
|
|
MediaTypes: "Game",
|
|
|
|
Limit: 5,
|
|
|
|
Recursive: true,
|
|
|
|
Filters: "IsPlayed"
|
|
|
|
};
|
2013-04-14 20:37:07 -07:00
|
|
|
|
2013-09-08 14:16:13 -07:00
|
|
|
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
|
2013-04-14 20:37:07 -07:00
|
|
|
|
2013-09-08 14:16:13 -07:00
|
|
|
if (result.Items.length) {
|
|
|
|
$('#recentlyPlayedSection', page).show();
|
|
|
|
} else {
|
|
|
|
$('#recentlyPlayedSection', page).hide();
|
|
|
|
}
|
2013-04-14 20:37:07 -07:00
|
|
|
|
2013-09-08 14:16:13 -07:00
|
|
|
$('#recentlyPlayedItems', page).html(LibraryBrowser.getPosterViewHtml({
|
|
|
|
items: result.Items,
|
2013-10-28 07:56:57 -07:00
|
|
|
useAverageAspectRatio: false,
|
2013-09-08 14:16:13 -07:00
|
|
|
transparent: true,
|
2013-10-04 17:44:43 -07:00
|
|
|
borderless: true
|
2013-09-08 14:16:13 -07:00
|
|
|
}));
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
2013-04-14 20:37:07 -07:00
|
|
|
|
|
|
|
})(jQuery, document);
|