mirror of
https://gitlab.com/RemixDev/deemix-js.git
synced 2024-12-29 10:56:18 +00:00
Code cleanup
This commit is contained in:
parent
aee2446d55
commit
1cce5db269
|
@ -701,17 +701,12 @@ class Downloader {
|
||||||
if (this.settings.executeCommand !== "") {
|
if (this.settings.executeCommand !== "") {
|
||||||
const child = exec(this.settings.executeCommand.replaceAll("%folder%", shellEscape(this.downloadObject.extrasPath)).replaceAll("%filename%", shellEscape(track.filename)),
|
const child = exec(this.settings.executeCommand.replaceAll("%folder%", shellEscape(this.downloadObject.extrasPath)).replaceAll("%filename%", shellEscape(track.filename)),
|
||||||
(error, stdout, stderr) => {
|
(error, stdout, stderr) => {
|
||||||
if (error) {
|
if (error) this.afterDownloadErrorReport("ExecuteCommand", error)
|
||||||
this.afterDownloadErrorReport("ExecuteCommand", error)
|
const itemData = { stderr, stdout }
|
||||||
|
if (stderr) this.log(itemData, "stderr")
|
||||||
|
if (stdout) this.log(itemData, "stdout")
|
||||||
}
|
}
|
||||||
const itemData = { stderr, stdout };
|
)
|
||||||
if (stderr) {
|
|
||||||
this.log(itemData, "stderr")
|
|
||||||
}
|
|
||||||
if (stdout) {
|
|
||||||
this.log(itemData, "stdout")
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
await new Promise((resolve) => {
|
await new Promise((resolve) => {
|
||||||
child.on('close', resolve)
|
child.on('close', resolve)
|
||||||
|
@ -807,17 +802,12 @@ class Downloader {
|
||||||
if (this.settings.executeCommand !== "") {
|
if (this.settings.executeCommand !== "") {
|
||||||
const child = exec(this.settings.executeCommand.replaceAll("%folder%", shellEscape(this.downloadObject.extrasPath)).replaceAll("%filename%", ''),
|
const child = exec(this.settings.executeCommand.replaceAll("%folder%", shellEscape(this.downloadObject.extrasPath)).replaceAll("%filename%", ''),
|
||||||
(error, stdout, stderr) => {
|
(error, stdout, stderr) => {
|
||||||
if (error) {
|
if (error) this.afterDownloadErrorReport("ExecuteCommand", error)
|
||||||
this.afterDownloadErrorReport("ExecuteCommand", error)
|
const itemData = { stderr, stdout }
|
||||||
|
if (stderr) this.log(itemData, "stderr")
|
||||||
|
if (stdout) this.log(itemData, "stdout")
|
||||||
}
|
}
|
||||||
const itemData = { stderr, stdout };
|
)
|
||||||
if (stderr) {
|
|
||||||
this.log(itemData, "stderr")
|
|
||||||
}
|
|
||||||
if (stdout) {
|
|
||||||
this.log(itemData, "stdout")
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
await new Promise((resolve) => {
|
await new Promise((resolve) => {
|
||||||
child.on('close', resolve)
|
child.on('close', resolve)
|
||||||
|
|
Loading…
Reference in a new issue