1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

proxy remote images through the server when previewing

This commit is contained in:
Luke Pulverenti 2013-11-04 16:50:37 -05:00
parent 92753817e3
commit a5c7e0cb19

View file

@ -131,6 +131,10 @@
}); });
} }
function getDisplayUrl(url) {
return ApiClient.getUrl("Images/Remote", { url: url });
}
function getRemoteImageHtml(image, imageType) { function getRemoteImageHtml(image, imageType) {
var html = ''; var html = '';
@ -152,9 +156,9 @@
cssClass += currentItem.Type == "Episode" ? " remoteBackdropImage" : " remotePosterImage"; cssClass += currentItem.Type == "Episode" ? " remoteBackdropImage" : " remotePosterImage";
} }
var displayUrl = image.ThumbnailUrl || image.Url; var displayUrl = getDisplayUrl(image.ThumbnailUrl || image.Url);
html += '<a target="_blank" href="' + image.Url + '" class="' + cssClass + '" style="background-image:url(\'' + displayUrl + '\');">'; html += '<a target="_blank" href="' + getDisplayUrl(image.Url) + '" class="' + cssClass + '" style="background-image:url(\'' + displayUrl + '\');">';
html += '</a>'; html += '</a>';
html += '<div class="remoteImageDetails">'; html += '<div class="remoteImageDetails">';
@ -537,6 +541,9 @@
$.mobile.urlHistory.ignoreNextHashChange = true; $.mobile.urlHistory.ignoreNextHashChange = true;
window.location.hash = 'editItemImagesPage?id=' + data.id; window.location.hash = 'editItemImagesPage?id=' + data.id;
browsableImageStartIndex = 0;
browsableImageType = 'Primary';
reload(page); reload(page);
} }
}); });
@ -567,6 +574,9 @@
reload(page); reload(page);
browsableImageStartIndex = 0;
browsableImageType = 'Primary';
$('#uploadImage', page).on("change", function () { $('#uploadImage', page).on("change", function () {
setFiles(page, this.files); setFiles(page, this.files);
}); });