mirror of
https://gitlab.rlp.net/proj-wise2526-video2document/video2document.git
synced 2026-06-16 02:11:52 +02:00
if Pruefung fuer Datei Endung gefixt
This commit is contained in:
@@ -16,15 +16,21 @@ uploadContainer.addEventListener("drop", (e) => {
|
|||||||
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 + "";
|
|
||||||
if(holdy.endsWith(".mp4") || holdy.endsWith(".mov") || holdy.endsWith(".avi") || holdy.endsWith( ".mkv")){
|
|
||||||
console.log(filePath)
|
|
||||||
|
|
||||||
|
var holdy = String(filePath);
|
||||||
|
const lower = holdy.toLowerCase();
|
||||||
|
const validExt = [".mp4", ".mov", ".avi", ".mkv"];
|
||||||
|
|
||||||
|
if(validExt.some(ext => lower.endsWith(ext))){
|
||||||
|
console.log(filePath);
|
||||||
const files1 = e.dataTransfer.files;
|
const files1 = e.dataTransfer.files;
|
||||||
handleFiles(files1);
|
handleFiles(files1);
|
||||||
|
}else{
|
||||||
|
console.log('Video format invalid!');
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log("Error in renderer.js with the listerner for the drop function");
|
console.log("Error in renderer.js with the listerner for the drop function");
|
||||||
|
console.log(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -24,9 +24,15 @@ function checkBoxes() {
|
|||||||
if (isChecked) {
|
if (isChecked) {
|
||||||
//Code to submit the video
|
//Code to submit the video
|
||||||
var pathTest = window.electronAPI.getFilePath(videoUpload.files[0]);
|
var pathTest = window.electronAPI.getFilePath(videoUpload.files[0]);
|
||||||
if(pathTest.endsWith(".mp4") || holdy.endsWith(".mov") || holdy.endsWith(".avi") || holdy.endsWith( ".mkv")){
|
|
||||||
window.extractor.extract({inputVideoPath: pathTest, outputType:"wav"})
|
const lower = pathTest.toLowerCase();
|
||||||
|
const validExt = [".mp4", ".mov", ".avi", ".mkv"];
|
||||||
|
|
||||||
|
if(validExt.some(ext => lower.endsWith(ext))){
|
||||||
|
window.extractor.extract({ inputVideoPath: pathTest, outputType: "wav" });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
//language only english at the moment
|
//language only english at the moment
|
||||||
alert('Please select at least one document type.');
|
alert('Please select at least one document type.');
|
||||||
|
|||||||
Reference in New Issue
Block a user