mirror of
https://gitlab.com/RemixDev/deemix-js.git
synced 2024-12-28 18:36:26 +00:00
Fixed queue item not cancelling correctly
This commit is contained in:
parent
03618438af
commit
b57cecb09a
|
@ -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 = {}
|
||||
|
|
Loading…
Reference in a new issue