mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
filled genre/studio pages
This commit is contained in:
parent
b90eabc00a
commit
62ee9f124c
8 changed files with 144 additions and 9 deletions
|
@ -1 +1,60 @@
|
|||
|
||||
(function ($, document) {
|
||||
|
||||
// The base query options
|
||||
var query = {
|
||||
|
||||
SortBy: "SortName",
|
||||
SortOrder: "Ascending",
|
||||
IncludeItemTypes: "Series",
|
||||
Recursive: true,
|
||||
Fields: "PrimaryImageAspectRatio,ItemCounts,DateCreated,UserData",
|
||||
Limit: LibraryBrowser.getDetaultPageSize(),
|
||||
StartIndex: 0
|
||||
};
|
||||
|
||||
function reloadItems(page) {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
ApiClient.getStudios(Dashboard.getCurrentUserId(), query).done(function (result) {
|
||||
|
||||
var html = '';
|
||||
|
||||
var showPaging = result.TotalRecordCount > query.Limit;
|
||||
|
||||
if (showPaging) {
|
||||
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true);
|
||||
}
|
||||
|
||||
html += LibraryBrowser.getPosterDetailViewHtml({
|
||||
items: result.Items,
|
||||
useAverageAspectRatio: true,
|
||||
countNameSingular: "Show",
|
||||
countNamePlural: "Shows"
|
||||
});
|
||||
|
||||
if (showPaging) {
|
||||
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
|
||||
}
|
||||
|
||||
var elem = $('#items', page).html(html).trigger('create');
|
||||
|
||||
$('select', elem).on('change', function () {
|
||||
query.StartIndex = (parseInt(this.value) - 1) * query.Limit;
|
||||
reloadItems(page);
|
||||
});
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
});
|
||||
}
|
||||
|
||||
$(document).on('pagebeforeshow', "#tvStudiosPage", function () {
|
||||
|
||||
reloadItems(this);
|
||||
|
||||
}).on('pageshow', "#tvStudiosPage", function () {
|
||||
|
||||
|
||||
});
|
||||
|
||||
})(jQuery, document);
|
Loading…
Add table
Add a link
Reference in a new issue