diff --git a/src/renderer/store/modules/list.js b/src/renderer/store/modules/list.js index 3d5bea7f..392c367b 100644 --- a/src/renderer/store/modules/list.js +++ b/src/renderer/store/modules/list.js @@ -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 } } }, diff --git a/src/renderer/utils/music/wy/lyric.js b/src/renderer/utils/music/wy/lyric.js index 6ae95d34..301a2bb4 100644 --- a/src/renderer/utils/music/wy/lyric.js +++ b/src/renderer/utils/music/wy/lyric.js @@ -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