From 83f9307a2cee356152bae2ed330a3b885856d16f Mon Sep 17 00:00:00 2001 From: Shadowghost Date: Thu, 30 May 2024 20:40:12 +0200 Subject: [PATCH] Enhance trickplay --- .../libraryoptionseditor/libraryoptionseditor.js | 2 ++ .../libraryoptionseditor.template.html | 8 ++++++++ src/components/refreshdialog/refreshdialog.js | 10 +++++++++- src/strings/en-us.json | 5 ++++- 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/components/libraryoptionseditor/libraryoptionseditor.js b/src/components/libraryoptionseditor/libraryoptionseditor.js index fd726d4150..b282697cb4 100644 --- a/src/components/libraryoptionseditor/libraryoptionseditor.js +++ b/src/components/libraryoptionseditor/libraryoptionseditor.js @@ -530,6 +530,7 @@ export function getLibraryOptions(parent) { EnableRealtimeMonitor: parent.querySelector('.chkEnableRealtimeMonitor').checked, EnableLUFSScan: parent.querySelector('.chkEnableLUFSScan').checked, ExtractTrickplayImagesDuringLibraryScan: parent.querySelector('.chkExtractTrickplayDuringLibraryScan').checked, + SaveTrickplayWithMedia: parent.querySelector('.chkSaveTrickplayLocally').checked, EnableTrickplayImageExtraction: parent.querySelector('.chkExtractTrickplayImages').checked, ExtractChapterImagesDuringLibraryScan: parent.querySelector('.chkExtractChaptersDuringLibraryScan').checked, EnableChapterImageExtraction: parent.querySelector('.chkExtractChapterImages').checked, @@ -597,6 +598,7 @@ export function setLibraryOptions(parent, options) { parent.querySelector('.chkEnableLUFSScan').checked = options.EnableLUFSScan; parent.querySelector('.chkExtractTrickplayDuringLibraryScan').checked = options.ExtractTrickplayImagesDuringLibraryScan; parent.querySelector('.chkExtractTrickplayImages').checked = options.EnableTrickplayImageExtraction; + parent.querySelector('.chkSaveTrickplayLocally').checked = options.SaveTrickplayWithMedia; parent.querySelector('.chkExtractChaptersDuringLibraryScan').checked = options.ExtractChapterImagesDuringLibraryScan; parent.querySelector('.chkExtractChapterImages').checked = options.EnableChapterImageExtraction; parent.querySelector('#chkSaveLocal').checked = options.SaveLocalMetadata; diff --git a/src/components/libraryoptionseditor/libraryoptionseditor.template.html b/src/components/libraryoptionseditor/libraryoptionseditor.template.html index b1d358cc02..6f6cbb918c 100644 --- a/src/components/libraryoptionseditor/libraryoptionseditor.template.html +++ b/src/components/libraryoptionseditor/libraryoptionseditor.template.html @@ -129,6 +129,14 @@
${LabelExtractTrickplayDuringLibraryScanHelp}
+ +
+ +
${LabelSaveTrickplayLocallyHelp}
+
diff --git a/src/components/refreshdialog/refreshdialog.js b/src/components/refreshdialog/refreshdialog.js index 3a17208d7a..5900f6b504 100644 --- a/src/components/refreshdialog/refreshdialog.js +++ b/src/components/refreshdialog/refreshdialog.js @@ -33,6 +33,11 @@ function getEditorHtml() { html += '' + globalize.translate('ReplaceExistingImages') + ''; html += ''; + html += ''; + html += '
'; html += globalize.translate('RefreshDialogHelp'); html += '
'; @@ -71,14 +76,15 @@ function onSubmit(e) { const mode = dlg.querySelector('#selectMetadataRefreshMode').value === 'scan' ? 'Default' : 'FullRefresh'; const replaceAllImages = mode === 'FullRefresh' && dlg.querySelector('.chkReplaceImages').checked; + const replaceTrickplayImages = mode === 'FullRefresh' && dlg.querySelector('.chkReplaceTrickplayImages').checked; options.itemIds.forEach(function (itemId) { apiClient.refreshItem(itemId, { - Recursive: true, ImageRefreshMode: mode, MetadataRefreshMode: mode, ReplaceAllImages: replaceAllImages, + replaceTrickplayImages: replaceTrickplayImages, ReplaceAllMetadata: replaceAllMetadata }); }); @@ -134,8 +140,10 @@ class RefreshDialog { dlg.querySelector('#selectMetadataRefreshMode').addEventListener('change', function () { if (this.value === 'scan') { dlg.querySelector('.fldReplaceExistingImages').classList.add('hide'); + dlg.querySelector('.fldReplaceTrickplayImages').classList.add('hide'); } else { dlg.querySelector('.fldReplaceExistingImages').classList.remove('hide'); + dlg.querySelector('.fldReplaceTrickplayImages').classList.remove('hide'); } }); diff --git a/src/strings/en-us.json b/src/strings/en-us.json index 642d082cc7..61ed296175 100644 --- a/src/strings/en-us.json +++ b/src/strings/en-us.json @@ -1752,5 +1752,8 @@ "OptionExtractTrickplayImage": "Enable trickplay image extraction", "ExtractTrickplayImagesHelp": "Trickplay images are similar to chapter images, except they span the entire length of the content and are used to show a preview when scrubbing through videos.", "LabelExtractTrickplayDuringLibraryScan": "Extract trickplay images during the library scan", - "LabelExtractTrickplayDuringLibraryScanHelp": "Generate trickplay images when videos are imported during the library scan. Otherwise, they will be extracted during the trickplay images scheduled task. If generation is set to non-blocking this will not affect the time a library scan takes to complete." + "LabelExtractTrickplayDuringLibraryScanHelp": "Generate trickplay images when videos are imported during the library scan. Otherwise, they will be extracted during the trickplay images scheduled task. If generation is set to non-blocking this will not affect the time a library scan takes to complete.", + "LabelSaveTrickplayLocally": "Save trickplay images next to media", + "LabelSaveTrickplayLocallyHelp": "Saving trickplay images into media folders will put them next to your media for easy migration and access.", + "ReplaceTrickplayImages": "Replace existing trickplay images" }