Fixed an error in checkBoxes function and uploadContainer "drop" listener regarding file path testing

This commit is contained in:
2025-11-12 18:52:28 +01:00
parent 0f54edb0aa
commit c8cbd4e92a
2 changed files with 4 additions and 6 deletions
+3 -5
View File
@@ -1,7 +1,5 @@
const dropzone = document.getElementById("uploadContainer"); uploadContainer.addEventListener("dragover", (e) =>{
dropzone.addEventListener("dragover", (e) =>{
try { try {
e.stopPropagation(); e.stopPropagation();
e.preventDefault(); e.preventDefault();
@@ -12,14 +10,14 @@ dropzone.addEventListener("dragover", (e) =>{
}); });
//listener for when a file get dropped on the drag&drop field //listener for when a file get dropped on the drag&drop field
dropzone.addEventListener("drop", (e) => { uploadContainer.addEventListener("drop", (e) => {
try { try {
e.stopPropagation() e.stopPropagation()
e.preventDefault() e.preventDefault()
const files = e.dataTransfer.files const files = e.dataTransfer.files
const filePath = window.explorer.onFileDrop(files[0]) const filePath = window.explorer.onFileDrop(files[0])
var holdy = filePath + ""; var holdy = filePath + "";
if(holdy.endsWith(".mp4", ".mov", ".avi", ".mkv")){ if(holdy.endsWith(".mp4") || holdy.endsWith(".mov") || holdy.endsWith(".avi") || holdy.endsWith( ".mkv")){
console.log(filePath) console.log(filePath)
const files1 = e.dataTransfer.files; const files1 = e.dataTransfer.files;
+1 -1
View File
@@ -24,7 +24,7 @@ function checkBoxes() {
if(isChecked){ if(isChecked){
//Code to submit the video //Code to submit the video
var pathTest = fileName.textContent + ""; var pathTest = fileName.textContent + "";
if(pathTest.endsWith(".mp4", ".mov", ".avi", ".mkv")){ if(pathTest.endsWith(".mp4") || holdy.endsWith(".mov") || holdy.endsWith(".avi") || holdy.endsWith( ".mkv")){
mapFunctions.get("extraction-video-to-audio").function({inputVideoPath: pathTest, outputType:"wav"}); mapFunctions.get("extraction-video-to-audio").function({inputVideoPath: pathTest, outputType:"wav"});
} }
} else { } else {