修复歌词解析问题
parent
916975b0a9
commit
04858cc42c
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "lx-music-desktop",
|
"name": "lx-music-desktop",
|
||||||
"version": "1.19.0-beta4",
|
"version": "1.19.0-beta6",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "lx-music-desktop",
|
"name": "lx-music-desktop",
|
||||||
"version": "1.19.0-beta5",
|
"version": "1.19.0-beta6",
|
||||||
"description": "一个免费的音乐查找助手",
|
"description": "一个免费的音乐查找助手",
|
||||||
"main": "./dist/electron/main.js",
|
"main": "./dist/electron/main.js",
|
||||||
"productName": "lx-music-desktop",
|
"productName": "lx-music-desktop",
|
||||||
|
|
|
@ -40,9 +40,7 @@ module.exports = class LinePlayer {
|
||||||
}
|
}
|
||||||
|
|
||||||
_initTag() {
|
_initTag() {
|
||||||
this.tags = {
|
this.tags = {}
|
||||||
offset: 0,
|
|
||||||
}
|
|
||||||
for (let tag in tagRegMap) {
|
for (let tag in tagRegMap) {
|
||||||
const matches = this.lyric.match(new RegExp(`\\[${tagRegMap[tag]}:([^\\]]*)]`, 'i'))
|
const matches = this.lyric.match(new RegExp(`\\[${tagRegMap[tag]}:([^\\]]*)]`, 'i'))
|
||||||
this.tags[tag] = (matches && matches[1]) || ''
|
this.tags[tag] = (matches && matches[1]) || ''
|
||||||
|
@ -50,6 +48,8 @@ module.exports = class LinePlayer {
|
||||||
if (this.tags.offset) {
|
if (this.tags.offset) {
|
||||||
let offset = parseInt(this.tags.offset)
|
let offset = parseInt(this.tags.offset)
|
||||||
this.tags.offset = Number.isNaN(offset) ? 0 : offset
|
this.tags.offset = Number.isNaN(offset) ? 0 : offset
|
||||||
|
} else {
|
||||||
|
this.tags.offset = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue