From d2bcff3ffdc9c48829b625f0f8e4f7e094bc105b Mon Sep 17 00:00:00 2001 From: ElementalAlchemist Date: Fri, 18 Nov 2022 21:28:37 -0600 Subject: [PATCH] Avoid disabling the force reset row buttons on videos that are still transcoding --- thrimbletrimmer/scripts/edit.js | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/thrimbletrimmer/scripts/edit.js b/thrimbletrimmer/scripts/edit.js index a479401..be4f570 100644 --- a/thrimbletrimmer/scripts/edit.js +++ b/thrimbletrimmer/scripts/edit.js @@ -550,16 +550,24 @@ async function initializeVideoInfo() { } } else { for (const input of document.getElementsByTagName("input")) { - input.disabled = true; + if (!isNonVideoInput(input)) { + input.disabled = true; + } } for (const textArea of document.getElementsByTagName("textarea")) { - textArea.disabled = true; + if (!isNonVideoInput(textArea)) { + textArea.disabled = true; + } } for (const button of document.getElementsByTagName("button")) { - button.disabled = true; + if (!isNonVideoInput(button)) { + button.disabled = true; + } } for (const selectBox of document.getElementsByTagName("select")) { - selectBox.disabled = true; + if (!isNonVideoInput(selectBox)) { + selectBox.disabled = true; + } } } } @@ -1777,3 +1785,7 @@ function canEditVideo() { function canEditMetadata() { return canEditVideo() || videoInfo.state === "DONE" || videoInfo.state === "MODIFIED"; } + +function isNonVideoInput(element) { + return element.id.startsWith("data-correction-force-reset"); +}