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

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
+10 -5
View File
@@ -53,6 +53,7 @@ import { formatPlayTime2, getRandom, checkPath, setTitle, clipboardWriteText, de
import { mapGetters, mapActions, mapMutations } from 'vuex'
import { requestMsg } from '../../utils/message'
import { isMac } from '../../../common/utils'
import path from 'path'
export default {
data() {
@@ -305,15 +306,16 @@ export default {
this.audioErrorTime = 0
if (this.listId == 'download') {
console.log(targetSong.filePath)
if (!checkPath(targetSong.filePath) || !targetSong.isComplate || /\.ape$/.test(targetSong.filePath)) {
const filePath = path.join(this.setting.download.savePath, targetSong.fileName)
// console.log(filePath)
if (!checkPath(filePath) || !targetSong.isComplate || /\.ape$/.test(filePath)) {
return this.list.length == 1 ? null : this.handleNext()
}
this.musicInfo.songmid = targetSong.musicInfo.songmid
this.musicInfo.singer = targetSong.musicInfo.singer
this.musicInfo.name = targetSong.musicInfo.name
this.audio.src = targetSong.filePath
// console.log(targetSong.filePath)
this.audio.src = filePath
// console.log(filePath)
this.setImg(targetSong.musicInfo)
this.setLrc(targetSong.musicInfo)
} else {
@@ -343,7 +345,10 @@ export default {
// if (this.list.listName === null) return
let list
if (this.listId == 'download') {
list = this.list.filter(s => !(!checkPath(s.filePath) || !s.isComplate || /\.ape$/.test(s.filePath)))
list = this.list.filter(s => {
const filePath = path.join(this.setting.download.savePath, s.fileName)
return !(!checkPath(filePath) || !s.isComplate || /\.ape$/.test(filePath))
})
} else if (this.isAPITemp) {
list = this.list.filter(s => s.source == 'kw')
} else {