mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
added movie and tv genre pages
This commit is contained in:
parent
ceb6dffddb
commit
6f3b88353e
17 changed files with 294 additions and 90 deletions
|
@ -7,7 +7,7 @@
|
|||
SortOrder: "Ascending",
|
||||
IncludeItemTypes: "BoxSet",
|
||||
Recursive: true,
|
||||
Fields: "PrimaryImageAspectRatio,ItemCounts,ItemCounts,DateCreated",
|
||||
Fields: "PrimaryImageAspectRatio,ItemCounts,ItemCounts,DateCreated,UserData",
|
||||
Limit: LibraryBrowser.getDetaultPageSize(),
|
||||
StartIndex: 0
|
||||
};
|
||||
|
@ -36,12 +36,7 @@
|
|||
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
|
||||
}
|
||||
|
||||
var elem = $('#items', page);
|
||||
|
||||
// cleanup existing event handlers
|
||||
$('select', elem).off('change');
|
||||
|
||||
elem.html(html).trigger('create');
|
||||
var elem = $('#items', page).html(html).trigger('create');
|
||||
|
||||
$('select', elem).on('change', function () {
|
||||
query.StartIndex = (parseInt(this.value) - 1) * query.Limit;
|
||||
|
|
|
@ -103,13 +103,22 @@
|
|||
if (item.CommunityRating) {
|
||||
html += '<p>' + LibraryBrowser.getFiveStarRatingHtml(item) + '</p>';
|
||||
}
|
||||
|
||||
var childText;
|
||||
|
||||
if (item.Type == "BoxSet") {
|
||||
|
||||
var movies = item.ChildCount == 1 ? "1 Movie" : item.ChildCount + " Movies";
|
||||
childText = item.ChildCount == 1 ? "1 Movie" : item.ChildCount + " Movies";
|
||||
|
||||
html += '<p class="itemMiscInfo">' + movies + '</p>';
|
||||
} else {
|
||||
html += '<p class="itemMiscInfo">' + childText + '</p>';
|
||||
}
|
||||
else if (item.Type == "Genre" || item.Type == "Studio" || item.Type == "Person") {
|
||||
|
||||
childText = item.ChildCount == 1 ? "1 " + options.countNameSingular : item.ChildCount + " " + options.countNamePlural;
|
||||
|
||||
html += '<p class="itemMiscInfo">' + childText + '</p>';
|
||||
}
|
||||
else {
|
||||
html += '<p class="itemMiscInfo">' + LibraryBrowser.getMiscInfoHtml(item, false) + '</p>';
|
||||
}
|
||||
|
||||
|
|
60
dashboard-ui/scripts/moviegenres.js
Normal file
60
dashboard-ui/scripts/moviegenres.js
Normal file
|
@ -0,0 +1,60 @@
|
|||
(function ($, document) {
|
||||
|
||||
// The base query options
|
||||
var query = {
|
||||
|
||||
SortBy: "SortName",
|
||||
SortOrder: "Ascending",
|
||||
IncludeItemTypes: "Movie",
|
||||
Recursive: true,
|
||||
Fields: "PrimaryImageAspectRatio,ItemCounts,DateCreated,UserData",
|
||||
Limit: LibraryBrowser.getDetaultPageSize(),
|
||||
StartIndex: 0
|
||||
};
|
||||
|
||||
function reloadItems(page) {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
ApiClient.getGenres(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: "Movie",
|
||||
countNamePlural: "Movies"
|
||||
});
|
||||
|
||||
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', "#movieGenresPage", function () {
|
||||
|
||||
reloadItems(this);
|
||||
|
||||
}).on('pageshow', "#movieGenresPage", function () {
|
||||
|
||||
|
||||
});
|
||||
|
||||
})(jQuery, document);
|
|
@ -46,12 +46,7 @@
|
|||
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
|
||||
}
|
||||
|
||||
var elem = $('#items', page);
|
||||
|
||||
// cleanup existing event handlers
|
||||
$('select', elem).off('change');
|
||||
|
||||
elem.html(html).trigger('create');
|
||||
var elem = $('#items', page).html(html).trigger('create');
|
||||
|
||||
$('select', elem).on('change', function () {
|
||||
query.StartIndex = (parseInt(this.value) - 1) * query.Limit;
|
||||
|
|
60
dashboard-ui/scripts/tvgenres.js
Normal file
60
dashboard-ui/scripts/tvgenres.js
Normal file
|
@ -0,0 +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.getGenres(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', "#tvGenresPage", function () {
|
||||
|
||||
reloadItems(this);
|
||||
|
||||
}).on('pageshow', "#tvGenresPage", function () {
|
||||
|
||||
|
||||
});
|
||||
|
||||
})(jQuery, document);
|
|
@ -9,7 +9,7 @@
|
|||
SortOrder: "Ascending",
|
||||
IncludeItemTypes: "Series",
|
||||
Recursive: true,
|
||||
Fields: "PrimaryImageAspectRatio,SeriesInfo,ItemCounts,DateCreated",
|
||||
Fields: "PrimaryImageAspectRatio,SeriesInfo,ItemCounts,DateCreated,UserData",
|
||||
Limit: LibraryBrowser.getDetaultPageSize(),
|
||||
StartIndex: 0
|
||||
};
|
||||
|
@ -46,12 +46,7 @@
|
|||
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
|
||||
}
|
||||
|
||||
var elem = $('#items', page);
|
||||
|
||||
// cleanup existing event handlers
|
||||
$('select', elem).off('change');
|
||||
|
||||
elem.html(html).trigger('create');
|
||||
var elem = $('#items', page).html(html).trigger('create');
|
||||
|
||||
$('select', elem).on('change', function () {
|
||||
query.StartIndex = (parseInt(this.value) - 1) * query.Limit;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue