Skip to content

Commit

Permalink
Merge pull request #15 from vlacour97/develop
Browse files Browse the repository at this point in the history
1.1.1
  • Loading branch information
vlacour97 authored Jan 25, 2023
2 parents 505df36 + 0ab7a75 commit 397beb6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions app/src/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 397beb6

Please sign in to comment.