mirror of
https://gitlab.rlp.net/proj-wise2526-video2document/video2document.git
synced 2026-06-15 18:01:52 +02:00
Fixed an error in checkBoxes function and uploadContainer "drop" listener regarding file path testing
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
|
||||
const dropzone = document.getElementById("uploadContainer");
|
||||
|
||||
dropzone.addEventListener("dragover", (e) =>{
|
||||
uploadContainer.addEventListener("dragover", (e) =>{
|
||||
try {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
@@ -12,14 +10,14 @@ dropzone.addEventListener("dragover", (e) =>{
|
||||
});
|
||||
|
||||
//listener for when a file get dropped on the drag&drop field
|
||||
dropzone.addEventListener("drop", (e) => {
|
||||
uploadContainer.addEventListener("drop", (e) => {
|
||||
try {
|
||||
e.stopPropagation()
|
||||
e.preventDefault()
|
||||
const files = e.dataTransfer.files
|
||||
const filePath = window.explorer.onFileDrop(files[0])
|
||||
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)
|
||||
|
||||
const files1 = e.dataTransfer.files;
|
||||
|
||||
@@ -24,7 +24,7 @@ function checkBoxes() {
|
||||
if(isChecked){
|
||||
//Code to submit the video
|
||||
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"});
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user