mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge remote-tracking branch 'upstream/master' into ribbons
This commit is contained in:
commit
196a9b11c2
77 changed files with 1575 additions and 1480 deletions
|
@ -71,219 +71,6 @@
|
|||
return "" + d.getFullYear() + formatDigit(d.getMonth() + 1) + formatDigit(d.getDate()) + formatDigit(d.getHours()) + formatDigit(d.getMinutes()) + formatDigit(d.getSeconds());
|
||||
},
|
||||
|
||||
getPosterDetailViewHtml: function (options) {
|
||||
|
||||
var items = options.items;
|
||||
var currentIndexValue;
|
||||
|
||||
if (!options.shape) {
|
||||
options.shape = options.preferBackdrop ? "backdrop" : "poster";
|
||||
}
|
||||
|
||||
var html = '';
|
||||
|
||||
for (var i = 0, length = items.length; i < length; i++) {
|
||||
|
||||
var item = items[i];
|
||||
|
||||
if (options.timeline) {
|
||||
var year = item.ProductionYear || "Unknown Year";
|
||||
|
||||
if (year != currentIndexValue) {
|
||||
|
||||
html += '<h2 class="timelineHeader detailSectionHeader">' + year + '</h2>';
|
||||
currentIndexValue = year;
|
||||
}
|
||||
}
|
||||
|
||||
var imgUrl = null;
|
||||
var isDefault = false;
|
||||
var height = null;
|
||||
|
||||
var cssClass = "tileItem";
|
||||
|
||||
if (options.shape) {
|
||||
cssClass += " " + options.shape + "TileItem";
|
||||
}
|
||||
|
||||
html += '<a class="' + cssClass + '" href="' + LibraryBrowser.getHref(item, options.context) + '">';
|
||||
|
||||
if (options.preferBackdrop && item.BackdropImageTags && item.BackdropImageTags.length) {
|
||||
|
||||
imgUrl = LibraryBrowser.getImageUrl(item, 'Backdrop', 0, {
|
||||
height: 198,
|
||||
width: 352
|
||||
});
|
||||
|
||||
}
|
||||
else if (options.preferBackdrop && item.ImageTags && item.ImageTags.Thumb) {
|
||||
|
||||
imgUrl = ApiClient.getImageUrl(item.Id, {
|
||||
type: "Thumb",
|
||||
height: 198,
|
||||
width: 352,
|
||||
tag: item.ImageTags.Thumb
|
||||
});
|
||||
}
|
||||
else if (item.ImageTags && item.ImageTags.Primary) {
|
||||
|
||||
height = 300;
|
||||
|
||||
imgUrl = LibraryBrowser.getImageUrl(item, 'Primary', 0, {
|
||||
maxheight: height
|
||||
});
|
||||
|
||||
}
|
||||
else if (item.AlbumId && item.AlbumPrimaryImageTag) {
|
||||
|
||||
height = 300;
|
||||
|
||||
imgUrl = ApiClient.getImageUrl(item.AlbumId, {
|
||||
type: "Primary",
|
||||
height: 100,
|
||||
tag: item.AlbumPrimaryImageTag
|
||||
});
|
||||
|
||||
}
|
||||
else if (item.BackdropImageTags && item.BackdropImageTags.length) {
|
||||
|
||||
imgUrl = LibraryBrowser.getImageUrl(item, 'Backdrop', 0, {
|
||||
height: 198,
|
||||
width: 352
|
||||
});
|
||||
}
|
||||
else if (item.MediaType == "Audio" || item.Type == "MusicAlbum" || item.Type == "MusicArtist") {
|
||||
|
||||
imgUrl = "css/images/items/list/audio.png";
|
||||
isDefault = true;
|
||||
}
|
||||
else if (item.MediaType == "Video" || item.Type == "Season" || item.Type == "Series") {
|
||||
|
||||
imgUrl = "css/images/items/list/video.png";
|
||||
isDefault = true;
|
||||
}
|
||||
else if (item.Type == "Person") {
|
||||
|
||||
imgUrl = "css/images/items/list/person.png";
|
||||
isDefault = true;
|
||||
}
|
||||
else if (item.Type == "MusicArtist") {
|
||||
|
||||
imgUrl = "css/images/items/list/audiocollection.png";
|
||||
isDefault = true;
|
||||
}
|
||||
else if (item.MediaType == "Game") {
|
||||
|
||||
imgUrl = "css/images/items/list/game.png";
|
||||
isDefault = true;
|
||||
}
|
||||
else if (item.Type == "Studio" || item.Type == "Genre" || item.Type == "MusicGenre" || item.Type == "GameGenre") {
|
||||
|
||||
if (options.context == "games") {
|
||||
|
||||
imgUrl = "css/images/items/list/game.png";
|
||||
}
|
||||
else if (options.context == "music") {
|
||||
|
||||
imgUrl = "css/images/items/list/audio.png";
|
||||
}
|
||||
else if (options.context == "movies") {
|
||||
|
||||
imgUrl = "css/images/items/list/chapter.png";
|
||||
}
|
||||
else {
|
||||
imgUrl = "css/images/items/list/collection.png";
|
||||
}
|
||||
isDefault = true;
|
||||
}
|
||||
else {
|
||||
|
||||
imgUrl = "css/images/items/list/collection.png";
|
||||
isDefault = true;
|
||||
}
|
||||
|
||||
cssClass = isDefault ? "tileImage defaultTileImage" : "tileImage";
|
||||
|
||||
html += '<div class="' + cssClass + '" style="background-image: url(\'' + imgUrl + '\');"></div>';
|
||||
|
||||
html += '<div class="tileContent">';
|
||||
|
||||
if (options.showParentName !== false) {
|
||||
if (item.SeriesName || item.Album || item.AlbumArtist) {
|
||||
var seriesName = item.SeriesName || item.Album || item.AlbumArtist;
|
||||
html += '<div class="tileName">' + seriesName + '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
var name = LibraryBrowser.getPosterViewDisplayName(item, options.displayAsSpecial);
|
||||
|
||||
html += '<div class="tileName">' + name + '</div>';
|
||||
|
||||
if (item.CommunityRating || item.CriticRating) {
|
||||
html += '<p>' + LibraryBrowser.getRatingHtml(item) + '</p>';
|
||||
}
|
||||
|
||||
var childText = null;
|
||||
|
||||
if (item.Type == "BoxSet") {
|
||||
|
||||
childText = item.ChildCount == 1 ? "1 Movie" : item.ChildCount + " Movies";
|
||||
|
||||
html += '<p class="itemMiscInfo">' + childText + '</p>';
|
||||
}
|
||||
else if (item.Type == "GameSystem") {
|
||||
|
||||
childText = item.ChildCount == 1 ? "1 Game" : item.ChildCount + " Games";
|
||||
|
||||
html += '<p class="itemMiscInfo">' + childText + '</p>';
|
||||
}
|
||||
else if (item.Type == "MusicAlbum") {
|
||||
|
||||
//childText = item.ChildCount == 1 ? "1 Song" : item.ChildCount + " Songs";
|
||||
|
||||
//html += '<p class="itemMiscInfo">' + childText + '</p>';
|
||||
}
|
||||
else if (item.Type == "Genre" || item.Type == "Studio" || item.Type == "Person" || item.Type == "MusicArtist" || item.Type == "MusicGenre" || item.Type == "GameGenre") {
|
||||
|
||||
var itemCountHtml = LibraryBrowser.getItemCountsHtml(options, item);
|
||||
|
||||
if (itemCountHtml) {
|
||||
html += '<p class="itemMiscInfo">' + itemCountHtml + '</p>';
|
||||
}
|
||||
}
|
||||
else if (item.Type == "Game") {
|
||||
|
||||
html += '<p class="itemMiscInfo">' + (item.GameSystem) + '</p>';
|
||||
}
|
||||
else if (item.Type == "Episode") {
|
||||
|
||||
// Skip it. Just clutter
|
||||
}
|
||||
else {
|
||||
html += '<p class="itemMiscInfo">' + LibraryBrowser.getMiscInfoHtml(item) + '</p>';
|
||||
}
|
||||
|
||||
if (item.Type == "MusicAlbum") {
|
||||
|
||||
html += '<p class="itemMiscInfo">' + LibraryBrowser.getMiscInfoHtml(item) + '</p>';
|
||||
}
|
||||
|
||||
html += '<p class="userDataIcons">' + LibraryBrowser.getUserDataIconsHtml(item) + '</p>';
|
||||
|
||||
html += '</div>';
|
||||
|
||||
if (item.LocationType == "Offline" || item.LocationType == "Virtual") {
|
||||
html += LibraryBrowser.getOfflineIndicatorHtml(item);
|
||||
} else {
|
||||
html += LibraryBrowser.getPlayedIndicatorHtml(item);
|
||||
}
|
||||
|
||||
html += "</a>";
|
||||
}
|
||||
|
||||
return html;
|
||||
},
|
||||
|
||||
getItemCountsHtml: function (options, item) {
|
||||
|
||||
var counts = [];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue