diff --git a/js/modules/local.js b/js/modules/local.js index 7adb38d..bcce2cc 100644 --- a/js/modules/local.js +++ b/js/modules/local.js @@ -115,6 +115,8 @@ export default Anot({ fs.echo(json.lyrics, it.lyrics) fs.echo(JSON.stringify(LS.getAll(), '', 2), MUSIC_DB_PATH) + + LYRICS.__init__(it.lyrics) }) } }) diff --git a/lib/lyrics/index.js b/lib/lyrics/index.js index 4c8966b..c6ba83a 100644 --- a/lib/lyrics/index.js +++ b/lib/lyrics/index.js @@ -21,6 +21,7 @@ class Lyrics { } if (!lrcFile || !fs.exists(lrcFile)) { + log('no lrc file', lrcFile) return false } @@ -67,6 +68,16 @@ class Lyrics { } 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) { this.curr = this.tmpLib.splice(0, 2) }