From b217e39f269f54c48afc5d3542ebfa8cacdf5645 Mon Sep 17 00:00:00 2001 From: grafixeyehero Date: Tue, 14 Jun 2022 21:41:17 +0300 Subject: [PATCH] Remove unused Screenshot code --- .../imageDownloader.template.html | 1 - .../imageOptionsEditor/imageOptionsEditor.js | 9 ------- .../imageOptionsEditor.template.html | 11 --------- .../imageUploader/imageUploader.template.html | 1 - src/components/imageeditor/imageeditor.js | 24 +++---------------- .../imageeditor/imageeditor.template.html | 14 ----------- src/scripts/serverNotifications.js | 3 --- src/strings/en-us.json | 4 ---- 8 files changed, 3 insertions(+), 64 deletions(-) diff --git a/src/components/imageDownloader/imageDownloader.template.html b/src/components/imageDownloader/imageDownloader.template.html index ba760567d6..eb460d06d8 100644 --- a/src/components/imageDownloader/imageDownloader.template.html +++ b/src/components/imageDownloader/imageDownloader.template.html @@ -29,7 +29,6 @@ - diff --git a/src/components/imageOptionsEditor/imageOptionsEditor.js b/src/components/imageOptionsEditor/imageOptionsEditor.js index fb3a72b853..39d2e69df8 100644 --- a/src/components/imageOptionsEditor/imageOptionsEditor.js +++ b/src/components/imageOptionsEditor/imageOptionsEditor.js @@ -45,7 +45,6 @@ import template from './imageOptionsEditor.template.html'; function loadValues(context, itemType, options, availableOptions) { const supportedImageTypes = availableOptions.SupportedImageTypes || []; setVisibilityOfBackdrops(context.querySelector('.backdropFields'), supportedImageTypes.includes('Backdrop')); - setVisibilityOfBackdrops(context.querySelector('.screenshotFields'), supportedImageTypes.includes('Screenshot')); Array.prototype.forEach.call(context.querySelectorAll('.imageType'), i => { const imageType = i.getAttribute('data-imagetype'); const container = dom.parentWithTag(i, 'LABEL'); @@ -65,9 +64,6 @@ import template from './imageOptionsEditor.template.html'; const backdropConfig = getImageConfig(options, availableOptions, 'Backdrop', itemType); context.querySelector('#txtMaxBackdrops').value = backdropConfig.Limit; context.querySelector('#txtMinBackdropDownloadWidth').value = backdropConfig.MinWidth; - const screenshotConfig = getImageConfig(options, availableOptions, 'Screenshot', itemType); - context.querySelector('#txtMaxScreenshots').value = screenshotConfig.Limit; - context.querySelector('#txtMinScreenshotDownloadWidth').value = screenshotConfig.MinWidth; } function saveValues(context, options) { @@ -83,11 +79,6 @@ import template from './imageOptionsEditor.template.html'; Limit: context.querySelector('#txtMaxBackdrops').value, MinWidth: context.querySelector('#txtMinBackdropDownloadWidth').value }); - options.ImageOptions.push({ - Type: 'Screenshot', - Limit: context.querySelector('#txtMaxScreenshots').value, - MinWidth: context.querySelector('#txtMinScreenshotDownloadWidth').value - }); } function showEditor(itemType, options, availableOptions) { diff --git a/src/components/imageOptionsEditor/imageOptionsEditor.template.html b/src/components/imageOptionsEditor/imageOptionsEditor.template.html index d3b1957e48..79c8845161 100644 --- a/src/components/imageOptionsEditor/imageOptionsEditor.template.html +++ b/src/components/imageOptionsEditor/imageOptionsEditor.template.html @@ -62,17 +62,6 @@ - -
-
- -
- -
- -
-
- diff --git a/src/components/imageUploader/imageUploader.template.html b/src/components/imageUploader/imageUploader.template.html index 4ae178fe77..8903aa0106 100644 --- a/src/components/imageUploader/imageUploader.template.html +++ b/src/components/imageUploader/imageUploader.template.html @@ -38,7 +38,6 @@ - diff --git a/src/components/imageeditor/imageeditor.js b/src/components/imageeditor/imageeditor.js index 3a7fad5ed3..509fe02789 100644 --- a/src/components/imageeditor/imageeditor.js +++ b/src/components/imageeditor/imageeditor.js @@ -74,7 +74,6 @@ import template from './imageeditor.template.html'; apiClient.getItemImageInfos(currentItem.Id).then(function (imageInfos) { renderStandardImages(page, apiClient, item, imageInfos, providers); renderBackdrops(page, apiClient, item, imageInfos, providers); - renderScreenshots(page, apiClient, item, imageInfos, providers); loading.hide(); if (layoutManager.tv) { @@ -91,8 +90,6 @@ import template from './imageeditor.template.html'; if (type === 'Backdrop') { options.tag = item.BackdropImageTags[index]; - } else if (type === 'Screenshot') { - options.tag = item.ScreenshotImageTags[index]; } else if (type === 'Primary') { options.tag = item.PrimaryImageTag || item.ImageTags[type]; } else { @@ -161,7 +158,7 @@ import template from './imageeditor.template.html'; if (enableFooterButtons) { html += '
'; - if (image.ImageType === 'Backdrop' || image.ImageType === 'Screenshot') { + if (image.ImageType === 'Backdrop') { if (index > 0) { html += ''; } else { @@ -242,7 +239,7 @@ import template from './imageeditor.template.html'; function renderStandardImages(page, apiClient, item, imageInfos, imageProviders) { const images = imageInfos.filter(function (i) { - return i.ImageType !== 'Screenshot' && i.ImageType !== 'Backdrop' && i.ImageType !== 'Chapter'; + return i.ImageType !== 'Backdrop' && i.ImageType !== 'Chapter'; }); renderImages(page, item, apiClient, images, imageProviders, page.querySelector('#images')); @@ -263,21 +260,6 @@ import template from './imageeditor.template.html'; } } - function renderScreenshots(page, apiClient, item, imageInfos, imageProviders) { - const images = imageInfos.filter(function (i) { - return i.ImageType === 'Screenshot'; - }).sort(function (a, b) { - return a.ImageIndex - b.ImageIndex; - }); - - if (images.length) { - page.querySelector('#screenshotsContainer', page).classList.remove('hide'); - renderImages(page, item, apiClient, images, imageProviders, page.querySelector('#screenshots')); - } else { - page.querySelector('#screenshotsContainer', page).classList.add('hide'); - } - } - function showImageDownloader(page, imageType) { import('../imageDownloader/imageDownloader').then((ImageDownloader) => { ImageDownloader.show( @@ -311,7 +293,7 @@ import template from './imageeditor.template.html'; id: 'delete' }); - if (type === 'Backdrop' || type === 'Screenshot') { + if (type === 'Backdrop') { if (index > 0) { commands.push({ name: globalize.translate('MoveLeft'), diff --git a/src/components/imageeditor/imageeditor.template.html b/src/components/imageeditor/imageeditor.template.html index 32e42bbef0..f878bf9e7f 100644 --- a/src/components/imageeditor/imageeditor.template.html +++ b/src/components/imageeditor/imageeditor.template.html @@ -37,20 +37,6 @@

- -
-
-

${Screenshots}

- - -
-
-
-
diff --git a/src/scripts/serverNotifications.js b/src/scripts/serverNotifications.js index e4395c9c29..73a10bcbde 100644 --- a/src/scripts/serverNotifications.js +++ b/src/scripts/serverNotifications.js @@ -128,9 +128,6 @@ function processGeneralCommand(cmd, apiClient) { case 'ToggleContextMenu': // todo break; - case 'TakeScreenShot': - // todo - break; case 'SendKey': // todo break; diff --git a/src/strings/en-us.json b/src/strings/en-us.json index bf7b67b140..b7d58832d3 100644 --- a/src/strings/en-us.json +++ b/src/strings/en-us.json @@ -729,7 +729,6 @@ "LabelMaxParentalRating": "Maximum allowed parental rating:", "LabelMaxResumePercentage": "Maximum resume percentage:", "LabelMaxResumePercentageHelp": "Titles are assumed fully played if stopped after this time.", - "LabelMaxScreenshotsPerItem": "Maximum number of screenshots per item:", "LabelMaxStreamingBitrate": "Maximum streaming quality:", "LabelMaxStreamingBitrateHelp": "Specify a maximum bitrate when streaming.", "LabelMessageText": "Message text:", @@ -751,7 +750,6 @@ "LabelMinResumeDurationHelp": "The shortest video length in seconds that will save playback location and let you resume.", "LabelMinResumePercentage": "Minimum resume percentage:", "LabelMinResumePercentageHelp": "Titles are assumed unplayed if stopped before this time.", - "LabelMinScreenshotDownloadWidth": "Minimum screenshot download width:", "LabelModelDescription": "Model description:", "LabelModelName": "Model name:", "LabelModelNumber": "Model number:", @@ -1380,8 +1378,6 @@ "ScanForNewAndUpdatedFiles": "Scan for new and updated files", "ScanLibrary": "Scan library", "Schedule": "Schedule", - "Screenshot": "Screenshot", - "Screenshots": "Screenshots", "Search": "Search", "SearchForCollectionInternetMetadata": "Search the internet for artwork and metadata", "SearchForMissingMetadata": "Search for missing metadata",