Browse Source

Added missing await for retriveFilesizes

pull/4/head
RemixDev 3 months ago
parent
commit
6279bc6c5d
3 changed files with 5 additions and 4 deletions
  1. +2
    -1
      .gitignore
  2. +2
    -2
      deemix/downloader.js
  3. +1
    -1
      deemix/types/Track.js

+ 2
- 1
.gitignore View File

@ -1,2 +1,3 @@
node_modules
test.js
/test.js
/config

+ 2
- 2
deemix/downloader.js View File

@ -478,7 +478,7 @@ class Downloader {
this.warn(itemData, e.errid, 'fallback')
let newTrack = await this.dz.gw.get_track_with_fallback(track.fallbackID)
track.parseEssentialData(newTrack)
track.retriveFilesizes(this.dz)
await track.retriveFilesizes(this.dz)
return await this.downloadWrapper(extraData, track)
}
if (!track.searched && this.settings.fallbackSearch){
@ -487,7 +487,7 @@ class Downloader {
if (searchedID != "0"){
let newTrack = await this.dz.gw.get_track_with_fallback(searchedID)
track.parseEssentialData(newTrack)
track.retriveFilesizes(this.dz)
await track.retriveFilesizes(this.dz)
track.searched = true
if (this.listener) this.listener.send('queueUpdate', {
uuid: this.downloadObject.uuid,


+ 1
- 1
deemix/types/Track.js View File

@ -88,7 +88,7 @@ class Track {
}).json()
}catch (e){
await new Promise(r => setTimeout(r, 2000)) // sleep(2000ms)
this.retriveFilesizes(dz)
return this.retriveFilesizes(dz)
}
if (result_json.error.length){ throw new TrackError(result_json.error) }
const response = result_json.results


Loading…
Cancel
Save