From d84b3b504f5554dcfc2ac01460f19442c8373bcc Mon Sep 17 00:00:00 2001 From: RemixDev Date: Fri, 30 Apr 2021 12:10:35 +0200 Subject: [PATCH] Version bump to 0.0.2 --- deemix/downloader.js | 8 +++++--- package.json | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/deemix/downloader.js b/deemix/downloader.js index 1f002a2..20f2efe 100644 --- a/deemix/downloader.js +++ b/deemix/downloader.js @@ -135,6 +135,7 @@ class Downloader { }) } else if (this.downloadObject.__type__ === "Collection") { let tracks = [] + let q = queue(async (data) => { let {track, pos} = data tracks[pos] = await this.downloadWrapper({ @@ -143,10 +144,11 @@ class Downloader { playlistAPI: this.downloadObject.collection.playlistAPI }) }, this.settings.queueConcurrency) - for (let pos = 0; pos < this.downloadObject.collection.tracks_gw.length; pos++){ - let track = this.downloadObject.collection.tracks_gw[pos] + + this.downloadObject.collection.tracks_gw.forEach((track, pos) => { q.push({track, pos}) - } + }) + await q.drain() } diff --git a/package.json b/package.json index dad4723..a6ec0a4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "deemix", - "version": "0.0.1", + "version": "0.0.2", "description": "a barebones deezer downloader library", "main": "deemix/index.js", "scripts": {