From 54f1f6c135f933031479cffd49037952bcbadd70 Mon Sep 17 00:00:00 2001 From: "eric.minning" Date: Wed, 12 Nov 2025 18:16:27 +0100 Subject: [PATCH] Added the check if a path is selected and the call to the transcript functio. --- electron/main/script.js | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/electron/main/script.js b/electron/main/script.js index a325e9f..a0c816b 100644 --- a/electron/main/script.js +++ b/electron/main/script.js @@ -25,21 +25,30 @@ manualBtn.addEventListener('click', () => { //function to check if one checkbox is at least klicked function checkBoxes() { - const checkboxes = document.querySelectorAll('input[name="docFormat"]'); - let isChecked = false; + try { + const checkboxes = document.querySelectorAll('input[name="docFormat"]'); + let isChecked = false; - checkboxes.forEach(function(checkbox){ - if(checkbox.checked){ - isChecked = true; + checkboxes.forEach(function(checkbox){ + if(checkbox.checked){ + isChecked = true; + } + }); + + if(isChecked){ + //Code to submit the video + var pathTest = fileName.textContent + ""; + if(pathTest.endsWith(".mp4", ".mov", ".avi", ".mkv")){ + mapFunctions.get("extraction-video-to-audio").function({inputVideoPath: pathTest, outputType:"wav"}); + } + } else { + //language only english at the moment + alert('Please select at least one document type.'); } - }); - - if(isChecked){ - //Code to submit the video - } else { - //language only english at the moment - alert('Please select at least one document type.'); + } catch (error) { + console.log("Error in scrpt.js checkBoxes function"); } + // mapFunctions.get("extraction-video-to-audio").function({inputVideoPath:"./a.mp4", outputType:"wav"}) }