Feat: Implement playlist download count tracking during downloads with UI updates

This commit is contained in:
MasterAcnolo
2026-04-12 18:24:19 +02:00
parent 89573d11f7
commit a2653eef57
6 changed files with 43 additions and 4 deletions

View File

@@ -74,7 +74,7 @@ function createPlaylistFolder(basePath, playlistTitle) {
}
}
function fetchDownload(options, listeners, speedListeners, stageListeners) {
function fetchDownload(options, listeners, speedListeners, stageListeners, playlistInfoListeners) {
return new Promise((resolve, reject) => {
logger.info(`CONFIG createPlaylistFolders: ${configFeatures.createPlaylistFolders}`);
@@ -152,6 +152,13 @@ function fetchDownload(options, listeners, speedListeners, stageListeners) {
}
}
// Playlist item tracking
const itemMatch = line.match(/Downloading\s+(?:item|video)?\s*(\d+)\s+of\s+(\d+)/i);
if (itemMatch) {
const itemInfo = `Item ${itemMatch[1]} of ${itemMatch[2]}`;
playlistInfoListeners.forEach(fn => fn(itemInfo));
}
// Stage messages
if (line.includes("[Merger]")) {
stageListeners.forEach(fn => fn("Merging formats..."));