Implemented first version of the json object that should be send back to the main. as well as fixed some bugs

This commit is contained in:
2025-11-18 12:59:08 +01:00
parent 5f14d633e3
commit abd72c9b54
3 changed files with 75 additions and 8 deletions
+6 -2
View File
@@ -16,10 +16,14 @@ uploadContainer.addEventListener("drop", (e) => {
e.preventDefault()
const files = e.dataTransfer.files
const filePath = window.explorer.onFileDrop(files[0])
var holdy = filePath + "";
if(holdy.endsWith(".mp4") || holdy.endsWith(".mov") || holdy.endsWith(".avi") || holdy.endsWith( ".mkv")){
const testEndings = [".mp4", ".mov", ".avi", ".mkv"];
var pathToLower = filePath.toLowerCase();
if(testEndings.some(e => pathToLower.endsWith(e))){
document.getElementById("progressbar").style.visibility = "visible";
const files1 = e.dataTransfer.files;
handleFiles(files1);
}else{
alert('The given file is not compatible. These are the available types: [".mp4", ".mov", ".avi", ".mkv"].');
}
} catch (error) {