下载列表的歌曲下载、播放将随设置中的保存路径改变而改变
This commit is contained in:
@@ -59,6 +59,7 @@ class Task extends EventEmitter {
|
||||
__init() {
|
||||
this.status = STATUS.init
|
||||
const { path, startByte, endByte } = this.chunkInfo
|
||||
this.progress.downloaded = 0
|
||||
if (startByte != null) this.requestOptions.headers.range = `bytes=${startByte}-${endByte}`
|
||||
return new Promise((resolve, reject) => {
|
||||
if (!path) return resolve()
|
||||
@@ -323,6 +324,10 @@ class Task extends EventEmitter {
|
||||
refreshUrl(url) {
|
||||
this.downloadUrl = url
|
||||
}
|
||||
|
||||
updateSaveInfo(filePath, fileName) {
|
||||
this.chunkInfo.path = path.join(filePath, fileName)
|
||||
}
|
||||
}
|
||||
|
||||
export default Task
|
||||
|
||||
Reference in New Issue
Block a user