This repository has been archived on 2023-08-30. You can view files and clone it, but cannot push or open issues/pull-requests.
appcat
/
sonist
Archived
1
0
Fork 0

修复歌词获取和解析的异常

2.x
宇天 2019-01-07 01:40:10 +08:00
parent bae28fac35
commit 4b39ce1990
2 changed files with 13 additions and 0 deletions

View File

@ -115,6 +115,8 @@ export default Anot({
fs.echo(json.lyrics, it.lyrics) fs.echo(json.lyrics, it.lyrics)
fs.echo(JSON.stringify(LS.getAll(), '', 2), MUSIC_DB_PATH) fs.echo(JSON.stringify(LS.getAll(), '', 2), MUSIC_DB_PATH)
LYRICS.__init__(it.lyrics)
}) })
} }
}) })

View File

@ -21,6 +21,7 @@ class Lyrics {
} }
if (!lrcFile || !fs.exists(lrcFile)) { if (!lrcFile || !fs.exists(lrcFile)) {
log('no lrc file', lrcFile)
return false return false
} }
@ -67,6 +68,16 @@ class Lyrics {
} }
update(time) { update(time) {
if (!this.lib.length) {
this.lrc = {
l: { bg: '#fff', txt: '暂无歌词...' },
r: { bg: '', txt: '' }
}
this.emit('ctrl-lrc', this.lrc.l.txt)
this.emit('ktv-lrc', this.lrc)
return
}
if (!this.curr.length && this.tmpLib.length) { if (!this.curr.length && this.tmpLib.length) {
this.curr = this.tmpLib.splice(0, 2) this.curr = this.tmpLib.splice(0, 2)
} }