From 55fac2448c63d0d35e9db83dc5e6489428379a8a Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sun, 2 May 2021 01:09:50 -0400 Subject: [PATCH] Remove image proxying through API Removes the web interface image proxying through the `/Images/Remote` and `/Items/RemoteSearch/Image` API endpoints. This appears to be those endpoints' only usage in the web client. --- .../imageDownloader/imageDownloader.js | 8 ++------ src/components/itemidentifier/itemidentifier.js | 17 ++--------------- src/index.html | 1 + 3 files changed, 5 insertions(+), 21 deletions(-) diff --git a/src/components/imageDownloader/imageDownloader.js b/src/components/imageDownloader/imageDownloader.js index dff1c89152..7f730aa0fb 100644 --- a/src/components/imageDownloader/imageDownloader.js +++ b/src/components/imageDownloader/imageDownloader.js @@ -150,10 +150,6 @@ import template from './imageDownloader.template.html'; }); } - function getDisplayUrl(url, apiClient) { - return apiClient.getUrl('Images/Remote', { imageUrl: url }); - } - function getRemoteImageHtml(image, imageType, apiClient) { 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 dee99f6326..6d9d34faa2 100644 --- a/src/components/itemidentifier/itemidentifier.js +++ b/src/components/itemidentifier/itemidentifier.js @@ -171,9 +171,8 @@ 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 +217,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 +255,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 @@ +