修复tx源翻译歌词解析不全的问题

This commit is contained in:
helloplhm-qwq 2023-06-19 20:47:43 +08:00
parent c6fb2232d0
commit e9b5e21f19
No known key found for this signature in database
GPG Key ID: 6BE1B64B905567C7

View File

@ -148,12 +148,12 @@ const parseTools = {
const words = line.replace(timeTagRxp, '') const words = line.replace(timeTagRxp, '')
if (!words.trim()) return if (!words.trim()) return
const tag = result[0].replace(/\d]/, '').replace(this.rxps.timeLabelFixRxp, '') const tag = result[0].replace(/\d]/, '').replace(this.rxps.timeLabelFixRxp, '')
let mstag = result[0].replace(/\d]/, '').split('.')[1]
while (lrcLines.length) { while (lrcLines.length) {
const lrcLine = lrcLines.shift() const lrcLine = lrcLines.shift()
const lrcLineResult = timeTagRxp.exec(lrcLine) const lrcLineResult = timeTagRxp.exec(lrcLine)
if (!lrcLineResult) continue if (!lrcLineResult) continue
if (lrcLineResult[0].includes(tag)) { if (lrcLineResult[0].includes(tag) || Math.abs(lrcLineResult[0].replace(/\d]/, '').split('.')[1] - mstag) < 100) {
newLrc.push(line.replace(timeTagRxp, lrcLineResult[0])) newLrc.push(line.replace(timeTagRxp, lrcLineResult[0]))
break break
} }