mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
fix local trailer and special feature images
This commit is contained in:
parent
ac31d33c0c
commit
fd226c8248
1 changed files with 52 additions and 49 deletions
|
@ -45,17 +45,17 @@
|
|||
|
||||
if (!item.Chapters || !item.Chapters.length) {
|
||||
$('#scenesCollapsible', page).remove();
|
||||
}else {
|
||||
} else {
|
||||
ItemDetailPage.renderScenes(item);
|
||||
}
|
||||
if (!item.LocalTrailerCount || item.LocalTrailerCount == 0) {
|
||||
$('#trailersCollapsible', page).remove();
|
||||
}else {
|
||||
} else {
|
||||
ItemDetailPage.renderTrailers(item);
|
||||
}
|
||||
if (!item.SpecialFeatureCount || item.SpecialFeatureCount == 0) {
|
||||
$('#specialsCollapsible', page).remove();
|
||||
}else {
|
||||
} else {
|
||||
ItemDetailPage.renderSpecials(item);
|
||||
}
|
||||
|
||||
|
@ -264,7 +264,7 @@
|
|||
return html;
|
||||
},
|
||||
|
||||
onScenesExpand: function() {
|
||||
onScenesExpand: function () {
|
||||
|
||||
if (ItemDetailPage.item) {
|
||||
|
||||
|
@ -283,10 +283,10 @@
|
|||
for (var i = 0, length = chapters.length; i < length; i++) {
|
||||
|
||||
var chapter = chapters[i];
|
||||
var chapter_name = chapter.Name || "Chapter "+i;
|
||||
var chapter_name = chapter.Name || "Chapter " + i;
|
||||
|
||||
html += '<div class="posterViewItem posterViewItemWithDualText">';
|
||||
html += '<a href="#play-Chapter-' + i + '" onclick="ItemDetailPage.play('+chapter.StartPositionTicks+');">';
|
||||
html += '<a href="#play-Chapter-' + i + '" onclick="ItemDetailPage.play(' + chapter.StartPositionTicks + ');">';
|
||||
|
||||
if (chapter.ImageTag) {
|
||||
|
||||
|
@ -326,7 +326,7 @@
|
|||
MediaPlayer.play([ItemDetailPage.item], startPosition);
|
||||
},
|
||||
|
||||
onGalleryExpand: function() {
|
||||
onGalleryExpand: function () {
|
||||
|
||||
if (ItemDetailPage.item) {
|
||||
|
||||
|
@ -380,22 +380,22 @@
|
|||
$('#galleryContent', page).html(html).trigger('create');
|
||||
},
|
||||
|
||||
createGalleryImage: function(itemId, type, tag, index) {
|
||||
createGalleryImage: function (itemId, type, tag, index) {
|
||||
|
||||
var downloadWidth = 400;
|
||||
var lightboxWidth = 800;
|
||||
var html = '';
|
||||
|
||||
if (typeof(index)=="undefined") index = 0;
|
||||
if (typeof (index) == "undefined") index = 0;
|
||||
|
||||
html += '<a href="#pop_'+index+'_'+tag+'" data-transition="fade" data-rel="popup" data-position-to="window">';
|
||||
html += '<a href="#pop_' + index + '_' + tag + '" data-transition="fade" data-rel="popup" data-position-to="window">';
|
||||
html += '<img class="galleryImage" src="' + ApiClient.getImageUrl(itemId, {
|
||||
type: type,
|
||||
width: downloadWidth,
|
||||
tag: tag,
|
||||
index: index
|
||||
}) + '" />';
|
||||
html += '<div class="galleryPopup" id="pop_'+index+'_'+tag+'" data-role="popup" data-theme="d" data-corners="false" data-overlay-theme="a">';
|
||||
html += '<div class="galleryPopup" id="pop_' + index + '_' + tag + '" data-role="popup" data-theme="d" data-corners="false" data-overlay-theme="a">';
|
||||
html += '<a href="#" data-rel="back" data-role="button" data-theme="a" data-icon="delete" data-iconpos="notext" class="ui-btn-right">Close</a>';
|
||||
html += '<img class="" src="' + ApiClient.getImageUrl(itemId, {
|
||||
type: type,
|
||||
|
@ -408,7 +408,7 @@
|
|||
return html;
|
||||
},
|
||||
|
||||
renderMediaInfo: function(item) {
|
||||
renderMediaInfo: function (item) {
|
||||
|
||||
var page = $.mobile.activePage;
|
||||
|
||||
|
@ -426,7 +426,7 @@
|
|||
});
|
||||
},
|
||||
|
||||
onTrailersExpand: function() {
|
||||
onTrailersExpand: function () {
|
||||
|
||||
if (ItemDetailPage.item) {
|
||||
|
||||
|
@ -445,39 +445,40 @@
|
|||
|
||||
for (var i = 0, length = trailers.length; i < length; i++) {
|
||||
|
||||
var trailer = trailers[i];
|
||||
var trailer = trailers[i];
|
||||
|
||||
html += '<div class="posterViewItem posterViewItemWithDualText">';
|
||||
html += '<a href="#play-Trailer-' + i + '" onclick="ItemDetailPage.playTrailer('+i+');">';
|
||||
html += '<div class="posterViewItem posterViewItemWithDualText">';
|
||||
html += '<a href="#play-Trailer-' + i + '" onclick="ItemDetailPage.playTrailer(' + i + ');">';
|
||||
|
||||
if (trailer.ImageTag) {
|
||||
var imageTags = trailer.ImageTags || {};
|
||||
|
||||
var imgUrl = ApiClient.getImageUrl(item.Id, {
|
||||
width: 500,
|
||||
tag: trailer.ImageTag,
|
||||
type: "Trailer",
|
||||
index: i
|
||||
});
|
||||
if (imageTags.Primary) {
|
||||
|
||||
html += '<img src="' + imgUrl + '" />';
|
||||
} else {
|
||||
html += '<img src="css/images/itemDetails/videoDefault.png"/>';
|
||||
}
|
||||
var imgUrl = ApiClient.getImageUrl(trailer.Id, {
|
||||
maxwidth: 500,
|
||||
tag: imageTags.Primary,
|
||||
type: "primary"
|
||||
});
|
||||
|
||||
html += '<div class="posterViewItemText posterViewItemPrimaryText">' + trailer.Name + '</div>';
|
||||
html += '<div class="posterViewItemText">';
|
||||
html += '<img src="' + imgUrl + '" />';
|
||||
} else {
|
||||
html += '<img src="css/images/items/detail/video.png"/>';
|
||||
}
|
||||
|
||||
if (trailer.RunTimeTicks != "") {
|
||||
html += '<div class="posterViewItemText posterViewItemPrimaryText">' + trailer.Name + '</div>';
|
||||
html += '<div class="posterViewItemText">';
|
||||
|
||||
if (trailer.RunTimeTicks != "") {
|
||||
html += ticks_to_human(trailer.RunTimeTicks);
|
||||
}
|
||||
else {
|
||||
}
|
||||
else {
|
||||
html += " ";
|
||||
}
|
||||
html += '</div>';
|
||||
}
|
||||
html += '</div>';
|
||||
|
||||
html += '</a>';
|
||||
html += '</a>';
|
||||
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
}
|
||||
|
||||
$('#trailersContent', page).html(html);
|
||||
|
@ -492,7 +493,7 @@
|
|||
});
|
||||
},
|
||||
|
||||
onSpecialsExpand: function() {
|
||||
onSpecialsExpand: function () {
|
||||
|
||||
if (ItemDetailPage.item) {
|
||||
|
||||
|
@ -514,22 +515,24 @@
|
|||
var special = specials[i];
|
||||
|
||||
html += '<div class="posterViewItem posterViewItemWithDualText">';
|
||||
html += '<a href="#play-Special-' + i + '" onclick="ItemDetailPage.playSpecial('+i+');">';
|
||||
html += '<a href="#play-Special-' + i + '" onclick="ItemDetailPage.playSpecial(' + i + ');">';
|
||||
|
||||
if (special.ImageTag) {
|
||||
var imageTags = special.ImageTags || {};
|
||||
|
||||
var imgUrl = ApiClient.getImageUrl(item.Id, {
|
||||
width: 500,
|
||||
tag: special.ImageTag,
|
||||
type: "Special",
|
||||
index: i
|
||||
if (imageTags.Primary) {
|
||||
|
||||
var imgUrl = ApiClient.getImageUrl(special.Id, {
|
||||
maxwidth: 500,
|
||||
tag: imageTags.Primary,
|
||||
type: "primary"
|
||||
});
|
||||
|
||||
html += '<img src="' + imgUrl + '" />';
|
||||
} else {
|
||||
html += '<img src="css/images/itemDetails/videoDefault.png"/>';
|
||||
html += '<img src="css/images/items/detail/video.png"/>';
|
||||
}
|
||||
|
||||
|
||||
html += '<div class="posterViewItemText posterViewItemPrimaryText">' + special.Name + '</div>';
|
||||
html += '<div class="posterViewItemText">';
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue