清理列表缓存将同时清理歌词

pull/495/head
lyswhut 2021-03-20 19:52:02 +08:00
parent 57fe510138
commit dcf6ab0792
2 changed files with 37 additions and 1 deletions

View File

@ -207,7 +207,9 @@ const mutations = {
if (item.typeUrl['320k']) delete item.typeUrl['320k']
if (item.typeUrl.flac) delete item.typeUrl.flac
if (item.typeUrl.wav) delete item.typeUrl.wav
// if (item.lxlrc == '') item.lxlrc = null
if (item.lxlrc) item.lxlrc = null
if (item.lrc) item.lrc = null
if (item.tlrc) item.tlrc = null
}
}
},

View File

@ -1,5 +1,38 @@
import { httpFetch } from '../../request'
import { linuxapi } from './utils/crypto'
// import { decodeName } from '../..'
// const parseLyric = (str, lrc) => {
// if (!str) return ''
// str = str.replace(/\r/g, '')
// let lxlyric = str.replace(/\[((\d+),\d+)\].*/g, str => {
// let result = str.match(/\[((\d+),\d+)\].*/)
// let time = parseInt(result[2])
// let ms = time % 1000
// time /= 1000
// let m = parseInt(time / 60).toString().padStart(2, '0')
// time %= 60
// let s = parseInt(time).toString().padStart(2, '0')
// time = `${m}:${s}.${ms}`
// str = str.replace(result[1], time)
// let startTime = 0
// str = str.replace(/\(0,1\) /g, ' ').replace(/\(\d+,\d+\)/g, time => {
// const [start, end] = time.replace(/^\((\d+,\d+)\)$/, '$1').split(',')
// time = `<${parseInt(startTime + parseInt(start))},${end}>`
// startTime = parseInt(startTime + parseInt(end))
// return time
// })
// return str
// })
// lxlyric = decodeName(lxlyric)
// return lxlyric.trim()
// }
export default songmid => {
const requestObj = httpFetch('https://music.163.com/api/linux/forward', {
@ -21,6 +54,7 @@ export default songmid => {
return {
lyric: body.lrc.lyric,
tlyric: body.tlyric.lyric,
// lxlyric: parseLyric(body.klyric.lyric),
}
})
return requestObj