mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
box sets page
This commit is contained in:
parent
317f06f607
commit
b9acc1c558
3 changed files with 225 additions and 8 deletions
|
@ -142,6 +142,73 @@
|
|||
return html;
|
||||
},
|
||||
|
||||
getBoxsetPosterViewHtml: function (options) {
|
||||
|
||||
var items = options.items;
|
||||
|
||||
var primaryImageAspectRatio = options.useAverageAspectRatio ? LibraryBrowser.getAveragePrimaryImageAspectRatio(items) : null;
|
||||
|
||||
var html = "";
|
||||
|
||||
for (var i = 0, length = items.length; i < length; i++) {
|
||||
var item = items[i];
|
||||
|
||||
var hasPrimaryImage = item.ImageTags && item.ImageTags.Primary;
|
||||
|
||||
var href = item.url || (item.IsFolder ? (item.Id ? "itemList.html?parentId=" + item.Id : "#") : "itemdetails.html?id=" + item.Id);
|
||||
|
||||
var showText = options.showTitle || !hasPrimaryImage || (item.Type !== 'Movie' && item.Type !== 'Series' && item.Type !== 'Season' && item.Type !== 'Trailer');
|
||||
|
||||
var cssClass = showText ? "posterViewItem posterViewItemWithDualText" : "posterViewItem posterViewItemWithNoText";
|
||||
|
||||
html += "<div class='" + cssClass + "'><a href='" + href + "'>";
|
||||
|
||||
if (options.preferBackdrop && item.BackdropImageTags && item.BackdropImageTags.length) {
|
||||
html += "<img src='" + ApiClient.getImageUrl(item.Id, {
|
||||
type: "Backdrop",
|
||||
height: 198,
|
||||
width: 352,
|
||||
tag: item.BackdropImageTags[0]
|
||||
}) + "' />";
|
||||
} else if (hasPrimaryImage) {
|
||||
|
||||
var height = 300;
|
||||
var width = primaryImageAspectRatio ? parseInt(height * primaryImageAspectRatio) : null;
|
||||
|
||||
html += "<img src='" + ApiClient.getImageUrl(item.Id, {
|
||||
type: "Primary",
|
||||
height: height,
|
||||
width: width,
|
||||
tag: item.ImageTags.Primary
|
||||
}) + "' />";
|
||||
|
||||
} else if (item.BackdropImageTags && item.BackdropImageTags.length) {
|
||||
html += "<img src='" + ApiClient.getImageUrl(item.Id, {
|
||||
type: "Backdrop",
|
||||
height: 198,
|
||||
width: 352,
|
||||
tag: item.BackdropImageTags[0]
|
||||
}) + "' />";
|
||||
} else {
|
||||
html += "<img style='background:" + LibraryBrowser.getMetroColor(item.Id) + ";' src='css/images/items/list/collection.png' />";
|
||||
}
|
||||
|
||||
if (showText) {
|
||||
html += "<div class='posterViewItemText posterViewItemPrimaryText'>";
|
||||
html += item.Name;
|
||||
html += "</div>";
|
||||
html += "<div class='posterViewItemText'>";
|
||||
html += item.ChildCount+" Movie";
|
||||
if (item.ChildCount > 1) html += "s";
|
||||
html += "</div>";
|
||||
}
|
||||
|
||||
html += "</a></div>";
|
||||
}
|
||||
|
||||
return html;
|
||||
},
|
||||
|
||||
getAveragePrimaryImageAspectRatio: function (items) {
|
||||
|
||||
var values = [];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue