fixed queue

This commit is contained in:
2025-10-22 11:49:25 +02:00
parent 27a4043095
commit 48bbec8830

View File

@@ -246,8 +246,8 @@ class DownloadQueue {
private async processDownload(url: string, folder: string, filename: string): Promise<void> {
await downloadSong(url, folder, filename);
songCount++; // Increment the song count after successful download
console.log(`${songCount} songs downloaded successfully \n${this.queue.length} remaining`);
songCount++; // Increment the song count after completion
}
}
@@ -304,7 +304,6 @@ function downloadSong(downloadLink: string, folder: string, filename: string): P
https.get(downloadLink, (response) => {
response.pipe(fs.createWriteStream(`${folder}/${filename}.mp3`))
.on('finish', () => {
songCount++
resolve();
})
.on('error', (error: Error) => {