mirror of
https://github.com/MasterAcnolo/Freedom-Loader.git
synced 2026-07-29 18:25:47 +02:00
Feat: Implement playlist download count tracking during downloads with UI updates
This commit is contained in:
@@ -4,8 +4,10 @@ const progressBarText = document.getElementById("downloadProgressText")
|
||||
|
||||
const speedElement = document.getElementById("downloadSpeedText");
|
||||
const stageElement = document.getElementById("downloadStage");
|
||||
const playlistInfoElement = document.getElementById("playlistInfoText");
|
||||
const speedEvt = new EventSource("/download/speed");
|
||||
const stageEvt = new EventSource("/download/stage");
|
||||
const playlistInfoEvt = new EventSource("/download/playlist-info");
|
||||
|
||||
function startProgress() {
|
||||
progressBar.style.width = "0%";
|
||||
@@ -45,6 +47,9 @@ function resetProgress() {
|
||||
stageElement.textContent = "";
|
||||
stageElement.style.display = "none";
|
||||
|
||||
playlistInfoElement.textContent = "";
|
||||
playlistInfoElement.style.display = "none";
|
||||
|
||||
// Hide stop button
|
||||
const stopBtn = document.getElementById("stopBtn");
|
||||
if (stopBtn) stopBtn.style.display = "none";
|
||||
@@ -85,4 +90,9 @@ speedEvt.onmessage = e => {
|
||||
stageEvt.onmessage = e => {
|
||||
stageElement.style.display = "block";
|
||||
stageElement.textContent = e.data; // ex: "📥 Downloading..."
|
||||
};
|
||||
|
||||
playlistInfoEvt.onmessage = e => {
|
||||
playlistInfoElement.style.display = "block";
|
||||
playlistInfoElement.textContent = e.data; // ex: "Item 1 of 15"
|
||||
};
|
||||
Reference in New Issue
Block a user