Changed the handleFiles function so it also contains the call for the generateThumbnail function

This commit is contained in:
2025-11-17 15:18:18 +01:00
parent f8fb71e146
commit 4f57ec25bf
2 changed files with 2 additions and 3 deletions
-3
View File
@@ -18,11 +18,8 @@ uploadContainer.addEventListener("drop", (e) => {
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)
const files1 = e.dataTransfer.files;
handleFiles(files1);
generateThumbnail(filePath);
}
} catch (error) {
+2
View File
@@ -61,8 +61,10 @@ function handleFiles(files) {
if (files.length > 0) {
const file = files[0];
if (file.type.startsWith('video/')) {
const filePath = window.explorer.onFileDrop(files[0])
videoUpload.files = files;
fileName.textContent = `Chosen video: ${file.name}`;
generateThumbnail(filePath);
}
}
} catch (error) {