下载列表的歌曲下载、播放将随设置中的保存路径改变而改变

This commit is contained in:
lyswhut
2020-04-12 12:32:44 +08:00
parent cf42e1846e
commit c318856534
5 changed files with 46 additions and 13 deletions
@@ -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