From 9a1f0b9fc6b840d9d893927e0e6ffa2077852272 Mon Sep 17 00:00:00 2001 From: Valentin Lacour Date: Wed, 25 Jan 2023 01:28:24 +0100 Subject: [PATCH] Fix multiple download error --- app/src/Client.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/src/Client.js b/app/src/Client.js index e09664b..77baf47 100644 --- a/app/src/Client.js +++ b/app/src/Client.js @@ -118,16 +118,15 @@ class Client { downloadFile (link, filename, originalLink) { const data = {} this.eventEmitter.emit('download', filename, link, data) + this.linkQueue.remove(originalLink) progress(request(link)) .on('progress', progress => { this.eventEmitter.emit('downloading', progress, filename, link, data) }) .on('end', () => { - this.linkQueue.remove(originalLink) this.eventEmitter.emit('downloaded', filename, link, data) }) .on('error', () => { - this.linkQueue.remove(originalLink) this.eventEmitter.emit('download_error', filename, link, data) }) .pipe(fs.createWriteStream(this.downloadPath + '/' + filename))