修复kw源某些歌曲的歌词提取异常的问题

pull/733/head
lyswhut 2021-12-03 23:46:41 +08:00
parent 1ab5db8507
commit 2dfa93383f
2 changed files with 11 additions and 2 deletions

View File

@ -7,6 +7,10 @@
- 优化列表性能,软件整体性能 - 优化列表性能,软件整体性能
### 修复
- 修复kw源某些歌曲的歌词提取异常的问题
### 其他 ### 其他
- 升级vue到 3.x - 升级vue到 3.x

View File

@ -21,7 +21,12 @@ export default {
} }
} }
if (lrc.length) { if (lrc.length) {
lrc.unshift(lrcT.shift()) if ((lrcT.length - lrc.length) > (lrcT.length * 0.1)) { // 翻译比正文多则证明翻译可能有问题,直接将其丢弃
lrc = lrcT
lrcT = []
} else {
lrc.unshift(lrcT.shift())
}
} else { } else {
lrc = lrcT lrc = lrcT
lrcT = [] lrcT = []
@ -42,7 +47,7 @@ export default {
if (!body.data?.lrclist?.length) return Promise.reject(new Error('Get lyric failed')) if (!body.data?.lrclist?.length) return Promise.reject(new Error('Get lyric failed'))
const { lrc, lrcT } = this.sortLrcArr(body.data.lrclist) const { lrc, lrcT } = this.sortLrcArr(body.data.lrclist)
// console.log(body.data.lrclist) // console.log(body.data.lrclist)
// console.log(lrc, lrcT) console.log(lrc, lrcT)
// console.log({ // console.log({
// lyric: decodeName(this.transformLrc(body.data.songinfo, lrc)), // lyric: decodeName(this.transformLrc(body.data.songinfo, lrc)),
// tlyric: decodeName(this.transformLrc(body.data.songinfo, lrcT)), // tlyric: decodeName(this.transformLrc(body.data.songinfo, lrcT)),