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