Skip to content

Commit

Permalink
Merge pull request #5635 from Shadowghost/enhance-trickplay
Browse files Browse the repository at this point in the history
  • Loading branch information
thornbill authored Sep 14, 2024
2 parents 48e45cf + 848d2db commit 5173862
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/components/libraryoptionseditor/libraryoptionseditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,14 @@ <h2>${Trickplay}</h2>
</label>
<div class="fieldDescription checkboxFieldDescription">${LabelExtractTrickplayDuringLibraryScanHelp}</div>
</div>

<div class="checkboxContainer checkboxContainer-withDescription fldSaveTrickplayLocally advanced">
<label>
<input type="checkbox" is="emby-checkbox" class="chkSaveTrickplayLocally" />
<span>${LabelSaveTrickplayLocally}</span>
</label>
<div class="fieldDescription checkboxFieldDescription">${LabelSaveTrickplayLocallyHelp}</div>
</div>
</div>

<div class="chapterSettingsSection hide">
Expand Down
10 changes: 9 additions & 1 deletion src/components/refreshdialog/refreshdialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ function getEditorHtml() {
html += '<span>' + globalize.translate('ReplaceExistingImages') + '</span>';
html += '</label>';

html += '<label class="checkboxContainer hide fldReplaceTrickplayImages">';
html += '<input type="checkbox" is="emby-checkbox" class="chkReplaceTrickplayImages" />';
html += '<span>' + globalize.translate('ReplaceTrickplayImages') + '</span>';
html += '</label>';

html += '<div class="fieldDescription">';
html += globalize.translate('RefreshDialogHelp');
html += '</div>';
Expand Down Expand Up @@ -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,
RegenerateTrickplay: replaceTrickplayImages,
ReplaceAllMetadata: replaceAllMetadata
});
});
Expand Down Expand Up @@ -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');
}
});

Expand Down
3 changes: 3 additions & 0 deletions src/strings/en-us.json
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,8 @@
"LabelRuntimeMinutes": "Runtime",
"LabelSaveLocalMetadata": "Save artwork into media folders",
"LabelSaveLocalMetadataHelp": "Saving artwork into media folders will put them in a place where they can be easily edited.",
"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.",
"LabelScheduledTaskLastRan": "Last ran {0}, taking {1}.",
"LabelScreensaver": "Screensaver",
"LabelSeasonNumber": "Season number",
Expand Down Expand Up @@ -1390,6 +1392,7 @@
"RepeatOne": "Repeat one",
"ReplaceAllMetadata": "Replace all metadata",
"ReplaceExistingImages": "Replace existing images",
"ReplaceTrickplayImages": "Replace existing trickplay images",
"Reset": "Reset",
"ResetPassword": "Reset Password",
"ResolutionMatchSource": "Match Source",
Expand Down

0 comments on commit 5173862

Please sign in to comment.