From 591ee288bf8369db2ac22abcec9cc5749ab8051d Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sun, 2 May 2021 16:14:00 -0400 Subject: [PATCH] Merge pull request #2645 from joshuaboniface/remove-image-proxy (cherry picked from commit 9e845fb91793f12ba6ee8eaa717916f0a2e298da) Signed-off-by: Joshua M. Boniface --- .../imageDownloader/imageDownloader.js | 12 ++++-------- .../itemidentifier/itemidentifier.js | 18 ++---------------- src/index.html | 1 + 3 files changed, 7 insertions(+), 24 deletions(-) diff --git a/src/components/imageDownloader/imageDownloader.js b/src/components/imageDownloader/imageDownloader.js index e501a808c9..2a288cad9f 100644 --- a/src/components/imageDownloader/imageDownloader.js +++ b/src/components/imageDownloader/imageDownloader.js @@ -79,7 +79,7 @@ import template from './imageDownloader.template.html'; let html = ''; for (let i = 0, length = imagesResult.Images.length; i < length; i++) { - html += getRemoteImageHtml(imagesResult.Images[i], imageType, apiClient); + html += getRemoteImageHtml(imagesResult.Images[i], imageType); } const availableImagesList = page.querySelector('.availableImagesList'); @@ -150,11 +150,7 @@ import template from './imageDownloader.template.html'; }); } - function getDisplayUrl(url, apiClient) { - return apiClient.getUrl('Images/Remote', { imageUrl: url }); - } - - function getRemoteImageHtml(image, imageType, apiClient) { + function getRemoteImageHtml(image, imageType) { const tagName = layoutManager.tv ? 'button' : 'div'; const enableFooterButtons = !layoutManager.tv; @@ -209,9 +205,9 @@ import template from './imageDownloader.template.html'; html += '
'; if (layoutManager.tv || !appHost.supports('externallinks')) { - html += '
'; + html += '
'; } else { - html += ''; + html += ''; } html += '
'; diff --git a/src/components/itemidentifier/itemidentifier.js b/src/components/itemidentifier/itemidentifier.js index 227813b117..db1ef3c7e4 100644 --- a/src/components/itemidentifier/itemidentifier.js +++ b/src/components/itemidentifier/itemidentifier.js @@ -171,9 +171,7 @@ import template from './itemidentifier.template.html'; let resultHtml = lines.join('
'); if (identifyResult.ImageUrl) { - const displayUrl = getSearchImageDisplayUrl(identifyResult.ImageUrl, identifyResult.SearchProviderName); - - resultHtml = `
${resultHtml}
`; + resultHtml = `
${resultHtml}
`; } page.querySelector('.selectedSearchResult').innerHTML = resultHtml; @@ -218,9 +216,7 @@ import template from './itemidentifier.template.html'; html += '
'; if (result.ImageUrl) { - const displayUrl = getSearchImageDisplayUrl(result.ImageUrl, result.SearchProviderName); - - html += `
`; + html += `
`; } else { html += `
${result.Name}
`; } @@ -258,16 +254,6 @@ import template from './itemidentifier.template.html'; return html; } - function getSearchImageDisplayUrl(url, provider) { - const apiClient = getApiClient(); - - return apiClient.getUrl('Items/RemoteSearch/Image', { - imageUrl: url, - ProviderName: provider, - api_key: apiClient.accessToken() - }); - } - function submitIdentficationResult(page) { loading.show(); diff --git a/src/index.html b/src/index.html index 175f320368..362b954e5e 100644 --- a/src/index.html +++ b/src/index.html @@ -11,6 +11,7 @@ +