2013-04-25 16:28:01 -07:00
|
|
|
|
(function ($, document) {
|
|
|
|
|
|
|
|
|
|
$(document).on('pagebeforeshow', "#musicRecommendedPage", function () {
|
|
|
|
|
|
|
|
|
|
var page = this;
|
|
|
|
|
|
|
|
|
|
var options = {
|
|
|
|
|
|
|
|
|
|
SortBy: "DateCreated",
|
|
|
|
|
SortOrder: "Descending",
|
|
|
|
|
IncludeItemTypes: "MusicAlbum",
|
|
|
|
|
Limit: 5,
|
|
|
|
|
Recursive: true,
|
|
|
|
|
Fields: "PrimaryImageAspectRatio"
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
|
|
|
|
|
|
|
|
|
|
$('#recentlyAddedAlbums', page).html(LibraryBrowser.getPosterViewHtml({
|
|
|
|
|
items: result.Items,
|
|
|
|
|
useAverageAspectRatio: true,
|
2013-12-27 14:20:27 -07:00
|
|
|
|
showUnplayedIndicator: false,
|
2013-04-25 17:52:55 -07:00
|
|
|
|
shape: "square"
|
2013-04-25 16:28:01 -07:00
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
options = {
|
|
|
|
|
|
|
|
|
|
SortBy: "DateCreated",
|
|
|
|
|
SortOrder: "Descending",
|
|
|
|
|
IncludeItemTypes: "Audio",
|
|
|
|
|
Limit: 5,
|
|
|
|
|
Recursive: true,
|
2013-04-25 17:52:55 -07:00
|
|
|
|
Fields: "PrimaryImageAspectRatio,AudioInfo"
|
2013-04-25 16:28:01 -07:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
|
|
|
|
|
|
|
|
|
|
$('#recentlyAddedSongs', page).html(LibraryBrowser.getPosterViewHtml({
|
|
|
|
|
items: result.Items,
|
|
|
|
|
useAverageAspectRatio: true,
|
2013-12-27 14:20:27 -07:00
|
|
|
|
showUnplayedIndicator: false,
|
2013-04-25 17:52:55 -07:00
|
|
|
|
shape: "square",
|
|
|
|
|
showTitle: true,
|
|
|
|
|
showParentTitle: true
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
options = {
|
|
|
|
|
|
|
|
|
|
SortBy: "DatePlayed",
|
|
|
|
|
SortOrder: "Descending",
|
|
|
|
|
IncludeItemTypes: "Audio",
|
|
|
|
|
Limit: 5,
|
|
|
|
|
Recursive: true,
|
|
|
|
|
Fields: "PrimaryImageAspectRatio,AudioInfo",
|
|
|
|
|
Filters: "IsPlayed"
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
|
|
|
|
|
|
|
|
|
|
if (result.Items.length) {
|
|
|
|
|
$('#recentlyPlayed', page).show();
|
|
|
|
|
} else {
|
|
|
|
|
$('#recentlyPlayed', page).hide();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$('#recentlyPlayedSongs', page).html(LibraryBrowser.getPosterViewHtml({
|
|
|
|
|
items: result.Items,
|
|
|
|
|
useAverageAspectRatio: true,
|
2013-12-27 14:20:27 -07:00
|
|
|
|
showUnplayedIndicator: false,
|
2013-04-25 17:52:55 -07:00
|
|
|
|
shape: "square",
|
|
|
|
|
showTitle: true,
|
|
|
|
|
showParentTitle: true
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
options = {
|
|
|
|
|
|
|
|
|
|
SortBy: "PlayCount",
|
|
|
|
|
SortOrder: "Descending",
|
|
|
|
|
IncludeItemTypes: "Audio",
|
|
|
|
|
Limit: 5,
|
|
|
|
|
Recursive: true,
|
|
|
|
|
Fields: "PrimaryImageAspectRatio,AudioInfo",
|
|
|
|
|
Filters: "IsPlayed"
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
|
|
|
|
|
|
|
|
|
|
if (result.Items.length) {
|
|
|
|
|
$('#topPlayed', page).show();
|
|
|
|
|
} else {
|
|
|
|
|
$('#topPlayed', page).hide();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$('#topPlayedSongs', page).html(LibraryBrowser.getPosterViewHtml({
|
|
|
|
|
items: result.Items,
|
|
|
|
|
useAverageAspectRatio: true,
|
2013-12-27 14:20:27 -07:00
|
|
|
|
showUnplayedIndicator: false,
|
2013-04-25 17:52:55 -07:00
|
|
|
|
shape: "square",
|
|
|
|
|
showTitle: true,
|
|
|
|
|
showParentTitle: true
|
2013-04-25 16:28:01 -07:00
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})(jQuery, document);
|