Fixed queue item not cancelling correctly

This commit is contained in:
RemixDev 2021-06-08 11:11:10 +02:00
parent 03618438af
commit b57cecb09a

View file

@ -167,14 +167,7 @@ class Downloader {
}
async start(){
if (this.downloadObject.isCanceled){
if (this.listener){
this.listener.send('currentItemCancelled', this.downloadObject.uuid)
this.listener.send("removedFromQueue", this.downloadObject.uuid)
}
return
}
if (!this.downloadObject.isCanceled){
if (this.downloadObject.__type__ === "Single"){
let track = await this.downloadWrapper({
trackAPI_gw: this.downloadObject.single.trackAPI_gw,
@ -201,11 +194,17 @@ class Downloader {
await q.drain()
await this.afterDownloadCollection(tracks)
}
}
if (this.listener){
if (this.downloadObject.isCanceled){
this.listener.send('currentItemCancelled', this.downloadObject.uuid)
this.listener.send("removedFromQueue", this.downloadObject.uuid)
} else {
this.listener.send("finishDownload", this.downloadObject.uuid)
}
}
}
async download(extraData, track){
let returnData = {}