修复歌词解析问题

pull/930/merge
lyswhut 2022-03-14 10:24:30 +08:00
parent 545ba6521b
commit ea1d21a3ef
2 changed files with 4 additions and 6 deletions

View File

@ -195,8 +195,8 @@ export default {
} catch { } catch {
lrcInfo.lxlyric = '' lrcInfo.lxlyric = ''
} }
if (lrcInfo.lxlyric) lrcInfo.lyric = lrcInfo.lyric.replace(lrcTools.rxps.wordTimeAll, '') lrcInfo.lyric = lrcInfo.lyric.replace(lrcTools.rxps.wordTimeAll, '')
// console.log(lrcInfo.lxlyric) // console.log(lrcInfo)
return lrcInfo return lrcInfo
}) })
}) })

View File

@ -108,10 +108,7 @@ export const lrcTools = {
words = '' words = ''
} }
const wordTimes = words.match(this.rxps.wordTimeAll) const wordTimes = words.match(this.rxps.wordTimeAll)
if (!wordTimes) { if (!wordTimes) return
this.isOK = false
return
}
// console.log(wordTimes) // console.log(wordTimes)
for (const timeStr of wordTimes) { for (const timeStr of wordTimes) {
const result = this.rxps.wordTime.exec(timeStr) const result = this.rxps.wordTime.exec(timeStr)
@ -139,6 +136,7 @@ export const lrcTools = {
} }
}, },
parse(lrc) { parse(lrc) {
// console.log(lrc)
const lines = lrc.split(/\r\n|\r|\n/) const lines = lrc.split(/\r\n|\r|\n/)
const tools = Object.create(this) const tools = Object.create(this)
tools.isOK = true tools.isOK = true