Minor changes and bug fixes

pull/9/head
aandrew-me 3 years ago
parent 5075284b94
commit fc9e9d4b7a

@ -1,6 +1,7 @@
//! Todo
//! Filename needs to be filtered
//! Total progress
//! File size needs to be modified
//! Scrollbar needs to be customized
const express = require("express");
const app = express();
@ -161,7 +162,9 @@ app.post("/download", async (req, res) => {
"audioProgress",
audioProgress
);
resolve("audio downloaded");
if (audioProgress == 100) {
resolve("audio downloaded");
}
})
.pipe(fs.createWriteStream(tempDir + audioName));
}),
@ -176,7 +179,7 @@ app.post("/download", async (req, res) => {
(error, stdout, stderr) => {
if (error) {
console.log(error);
} else if (stderr){
} else if (stderr) {
console.log("video saved");
// Clear temp dir
fs.readdirSync(tempDir).forEach((f) =>
@ -184,8 +187,8 @@ app.post("/download", async (req, res) => {
);
io.to(socketId).emit("saved", `${downloadDir}`);
}
if (stdout){
console.log("stdout this time")
if (stdout) {
console.log("stdout this time");
}
}
);

@ -104,7 +104,7 @@
socket.on("videoProgress", (progress) => {
document.getElementById("progressBox").style.display = "inline-block"
document.getElementById("preparingBox").style.display = "none"
document.getElementById("videoProgress").value = progress
if (progress != 100) {
document.querySelector(".submitBtn").style.display = "none"
@ -127,6 +127,7 @@
icon: 'icon.png'
});
document.getElementById("savedMsg").innerHTML = `Video saved to <a href='file://${savedLocation}'>${savedLocation}</a>`
document.getElementById("progressBox").style.display = "none"
})
</script>
</body>

@ -8,7 +8,7 @@
"ytdl-core": "^4.11.0"
},
"name": "ytdownloader",
"version": "1.3.2",
"version": "1.3.3",
"main": "main.js",
"scripts": {
"start": "electron .",

Loading…
Cancel
Save