diff --git a/main.ts b/main.ts index eaad75a..3b58a31 100644 --- a/main.ts +++ b/main.ts @@ -246,8 +246,8 @@ class DownloadQueue { private async processDownload(url: string, folder: string, filename: string): Promise { 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) => {