Merge pull request 'Expose extrasPath to REST API' (#5) from kermit/deemix-js:extras-path into main

Reviewed-on: https://git.freezer.life/RemixDev/deemix-js/pulls/5
This commit is contained in:
RemixDev 2021-08-02 14:46:35 -04:00
commit 50b30c03a8
2 changed files with 16 additions and 4 deletions

View file

@ -355,7 +355,10 @@ class Downloader {
let writepath = `${filepath}/${filename}${extension}`
// Save extrasPath
if (extrasPath && !this.extrasPath) this.extrasPath = extrasPath
if (extrasPath && !this.extrasPath) {
this.extrasPath = extrasPath
this.downloadObject.extrasPath = extrasPath
}
// Generate covers URLs
let embeddedImageFormat = `jpg-${this.settings.jpegImageQuality}`
@ -595,7 +598,10 @@ class Downloader {
async afterDownloadSingle(track){
if (!track) return
if (!this.extrasPath) this.extrasPath = this.settings.downloadLocation
if (!this.extrasPath) {
this.extrasPath = this.settings.downloadLocation
this.downloadObject.extrasPath = this.extrasPath
}
// Save local album artwork
if (this.settings.saveArtwork && track.albumPath)
@ -626,7 +632,11 @@ class Downloader {
}
async afterDownloadCollection(tracks){
if (!this.extrasPath) this.extrasPath = this.settings.downloadLocation
if (!this.extrasPath) {
this.extrasPath = this.settings.downloadLocation
this.downloadObject.extrasPath = this.extrasPath
}
let playlist = []
let errors = ""
let searched = ""

View file

@ -34,6 +34,7 @@ class IDownloadObject{
failed: this.failed,
progress: this.progress,
errors: this.errors,
extrasPath: this.extrasPath,
files: this.files,
__type__: this.__type__
}
@ -70,7 +71,8 @@ class IDownloadObject{
artist: this.artist,
cover: this.cover,
explicit: this.explicit,
size: this.size
size: this.size,
extrasPath: this.extrasPath
}
}