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

Remove unused Screenshot code

This commit is contained in:
grafixeyehero 2022-06-14 21:41:17 +03:00
parent 827dd90a6f
commit b217e39f26
8 changed files with 3 additions and 64 deletions

View file

@ -29,7 +29,6 @@
<option value="Disc">${Disc}</option> <option value="Disc">${Disc}</option>
<option value="Logo">${Logo}</option> <option value="Logo">${Logo}</option>
<option value="Menu">${Menu}</option> <option value="Menu">${Menu}</option>
<option value="Screenshot">${Screenshot}</option>
<option value="Thumb">${Thumb}</option> <option value="Thumb">${Thumb}</option>
</select> </select>
</div> </div>

View file

@ -45,7 +45,6 @@ import template from './imageOptionsEditor.template.html';
function loadValues(context, itemType, options, availableOptions) { function loadValues(context, itemType, options, availableOptions) {
const supportedImageTypes = availableOptions.SupportedImageTypes || []; const supportedImageTypes = availableOptions.SupportedImageTypes || [];
setVisibilityOfBackdrops(context.querySelector('.backdropFields'), supportedImageTypes.includes('Backdrop')); setVisibilityOfBackdrops(context.querySelector('.backdropFields'), supportedImageTypes.includes('Backdrop'));
setVisibilityOfBackdrops(context.querySelector('.screenshotFields'), supportedImageTypes.includes('Screenshot'));
Array.prototype.forEach.call(context.querySelectorAll('.imageType'), i => { Array.prototype.forEach.call(context.querySelectorAll('.imageType'), i => {
const imageType = i.getAttribute('data-imagetype'); const imageType = i.getAttribute('data-imagetype');
const container = dom.parentWithTag(i, 'LABEL'); const container = dom.parentWithTag(i, 'LABEL');
@ -65,9 +64,6 @@ import template from './imageOptionsEditor.template.html';
const backdropConfig = getImageConfig(options, availableOptions, 'Backdrop', itemType); const backdropConfig = getImageConfig(options, availableOptions, 'Backdrop', itemType);
context.querySelector('#txtMaxBackdrops').value = backdropConfig.Limit; context.querySelector('#txtMaxBackdrops').value = backdropConfig.Limit;
context.querySelector('#txtMinBackdropDownloadWidth').value = backdropConfig.MinWidth; 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) { function saveValues(context, options) {
@ -83,11 +79,6 @@ import template from './imageOptionsEditor.template.html';
Limit: context.querySelector('#txtMaxBackdrops').value, Limit: context.querySelector('#txtMaxBackdrops').value,
MinWidth: context.querySelector('#txtMinBackdropDownloadWidth').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) { function showEditor(itemType, options, availableOptions) {

View file

@ -62,17 +62,6 @@
<input is="emby-input" type="number" id="txtMinBackdropDownloadWidth" pattern="[0-9]*" required="required" min="0" label="${LabelMinBackdropDownloadWidth}" /> <input is="emby-input" type="number" id="txtMinBackdropDownloadWidth" pattern="[0-9]*" required="required" min="0" label="${LabelMinBackdropDownloadWidth}" />
</div> </div>
</div> </div>
<div class="screenshotFields">
<div class="inputContainer">
<input is="emby-input" type="number" id="txtMaxScreenshots" pattern="[0-9]*" required="required" min="0" label="${LabelMaxScreenshotsPerItem}" />
</div>
<div class="inputContainer">
<input is="emby-input" type="number" id="txtMinScreenshotDownloadWidth" pattern="[0-9]*" required="required" min="0" label="${LabelMinScreenshotDownloadWidth}" />
</div>
</div>
</form> </form>
</div> </div>
</div> </div>

View file

@ -38,7 +38,6 @@
<option value="Disc">${Disc}</option> <option value="Disc">${Disc}</option>
<option value="Logo">${Logo}</option> <option value="Logo">${Logo}</option>
<option value="Menu">${Menu}</option> <option value="Menu">${Menu}</option>
<option value="Screenshot">${Screenshot}</option>
<option value="Thumb">${Thumb}</option> <option value="Thumb">${Thumb}</option>
</select> </select>
</div> </div>

View file

@ -74,7 +74,6 @@ import template from './imageeditor.template.html';
apiClient.getItemImageInfos(currentItem.Id).then(function (imageInfos) { apiClient.getItemImageInfos(currentItem.Id).then(function (imageInfos) {
renderStandardImages(page, apiClient, item, imageInfos, providers); renderStandardImages(page, apiClient, item, imageInfos, providers);
renderBackdrops(page, apiClient, item, imageInfos, providers); renderBackdrops(page, apiClient, item, imageInfos, providers);
renderScreenshots(page, apiClient, item, imageInfos, providers);
loading.hide(); loading.hide();
if (layoutManager.tv) { if (layoutManager.tv) {
@ -91,8 +90,6 @@ import template from './imageeditor.template.html';
if (type === 'Backdrop') { if (type === 'Backdrop') {
options.tag = item.BackdropImageTags[index]; options.tag = item.BackdropImageTags[index];
} else if (type === 'Screenshot') {
options.tag = item.ScreenshotImageTags[index];
} else if (type === 'Primary') { } else if (type === 'Primary') {
options.tag = item.PrimaryImageTag || item.ImageTags[type]; options.tag = item.PrimaryImageTag || item.ImageTags[type];
} else { } else {
@ -161,7 +158,7 @@ import template from './imageeditor.template.html';
if (enableFooterButtons) { if (enableFooterButtons) {
html += '<div class="cardText cardTextCentered">'; html += '<div class="cardText cardTextCentered">';
if (image.ImageType === 'Backdrop' || image.ImageType === 'Screenshot') { if (image.ImageType === 'Backdrop') {
if (index > 0) { if (index > 0) {
html += '<button type="button" is="paper-icon-button-light" class="btnMoveImage autoSize" data-imagetype="' + image.ImageType + '" data-index="' + image.ImageIndex + '" data-newindex="' + (image.ImageIndex - 1) + '" title="' + globalize.translate('MoveLeft') + '"><span class="material-icons chevron_left"></span></button>'; html += '<button type="button" is="paper-icon-button-light" class="btnMoveImage autoSize" data-imagetype="' + image.ImageType + '" data-index="' + image.ImageIndex + '" data-newindex="' + (image.ImageIndex - 1) + '" title="' + globalize.translate('MoveLeft') + '"><span class="material-icons chevron_left"></span></button>';
} else { } else {
@ -242,7 +239,7 @@ import template from './imageeditor.template.html';
function renderStandardImages(page, apiClient, item, imageInfos, imageProviders) { function renderStandardImages(page, apiClient, item, imageInfos, imageProviders) {
const images = imageInfos.filter(function (i) { 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')); 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) { function showImageDownloader(page, imageType) {
import('../imageDownloader/imageDownloader').then((ImageDownloader) => { import('../imageDownloader/imageDownloader').then((ImageDownloader) => {
ImageDownloader.show( ImageDownloader.show(
@ -311,7 +293,7 @@ import template from './imageeditor.template.html';
id: 'delete' id: 'delete'
}); });
if (type === 'Backdrop' || type === 'Screenshot') { if (type === 'Backdrop') {
if (index > 0) { if (index > 0) {
commands.push({ commands.push({
name: globalize.translate('MoveLeft'), name: globalize.translate('MoveLeft'),

View file

@ -37,20 +37,6 @@
</div> </div>
<br /> <br />
</div> </div>
<div id="screenshotsContainer" class="hide">
<div class="imageEditor-buttons">
<h2 style="margin: 0;">${Screenshots}</h2>
<button type="button" is="emby-button" class="btnBrowseAllImages fab mini autoSize" style="margin-left: 1em;" data-imagetype="Screenshot">
<span class="material-icons search" aria-hidden="true"></span>
</button>
<button type="button" is="emby-button" class="btnOpenUploadMenu fab mini hide" style="margin-left: .5em;" data-imagetype="Screenshot">
<span class="material-icons add" aria-hidden="true"></span>
</button>
</div>
<div id="screenshots" class="itemsContainer vertical-wrap">
</div>
</div>
</div> </div>
</div> </div>

View file

@ -128,9 +128,6 @@ function processGeneralCommand(cmd, apiClient) {
case 'ToggleContextMenu': case 'ToggleContextMenu':
// todo // todo
break; break;
case 'TakeScreenShot':
// todo
break;
case 'SendKey': case 'SendKey':
// todo // todo
break; break;

View file

@ -729,7 +729,6 @@
"LabelMaxParentalRating": "Maximum allowed parental rating:", "LabelMaxParentalRating": "Maximum allowed parental rating:",
"LabelMaxResumePercentage": "Maximum resume percentage:", "LabelMaxResumePercentage": "Maximum resume percentage:",
"LabelMaxResumePercentageHelp": "Titles are assumed fully played if stopped after this time.", "LabelMaxResumePercentageHelp": "Titles are assumed fully played if stopped after this time.",
"LabelMaxScreenshotsPerItem": "Maximum number of screenshots per item:",
"LabelMaxStreamingBitrate": "Maximum streaming quality:", "LabelMaxStreamingBitrate": "Maximum streaming quality:",
"LabelMaxStreamingBitrateHelp": "Specify a maximum bitrate when streaming.", "LabelMaxStreamingBitrateHelp": "Specify a maximum bitrate when streaming.",
"LabelMessageText": "Message text:", "LabelMessageText": "Message text:",
@ -751,7 +750,6 @@
"LabelMinResumeDurationHelp": "The shortest video length in seconds that will save playback location and let you resume.", "LabelMinResumeDurationHelp": "The shortest video length in seconds that will save playback location and let you resume.",
"LabelMinResumePercentage": "Minimum resume percentage:", "LabelMinResumePercentage": "Minimum resume percentage:",
"LabelMinResumePercentageHelp": "Titles are assumed unplayed if stopped before this time.", "LabelMinResumePercentageHelp": "Titles are assumed unplayed if stopped before this time.",
"LabelMinScreenshotDownloadWidth": "Minimum screenshot download width:",
"LabelModelDescription": "Model description:", "LabelModelDescription": "Model description:",
"LabelModelName": "Model name:", "LabelModelName": "Model name:",
"LabelModelNumber": "Model number:", "LabelModelNumber": "Model number:",
@ -1380,8 +1378,6 @@
"ScanForNewAndUpdatedFiles": "Scan for new and updated files", "ScanForNewAndUpdatedFiles": "Scan for new and updated files",
"ScanLibrary": "Scan library", "ScanLibrary": "Scan library",
"Schedule": "Schedule", "Schedule": "Schedule",
"Screenshot": "Screenshot",
"Screenshots": "Screenshots",
"Search": "Search", "Search": "Search",
"SearchForCollectionInternetMetadata": "Search the internet for artwork and metadata", "SearchForCollectionInternetMetadata": "Search the internet for artwork and metadata",
"SearchForMissingMetadata": "Search for missing metadata", "SearchForMissingMetadata": "Search for missing metadata",