From 25fc0226aa89272655cc3bdec6750a7aa9aa4fdf Mon Sep 17 00:00:00 2001 From: lyswhut Date: Sun, 24 May 2020 15:12:35 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E5=A4=9A=E4=BD=99=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/utils/music/kw/lyric.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/renderer/utils/music/kw/lyric.js b/src/renderer/utils/music/kw/lyric.js index 191253e2..29f6a1d7 100644 --- a/src/renderer/utils/music/kw/lyric.js +++ b/src/renderer/utils/music/kw/lyric.js @@ -5,7 +5,6 @@ export default { lrcInfoRxp: /(.+?)<\/lyric>[\s\S]+(.+?)<\/lyric_zz>/, parseLyricInfo(str) { let result = str.match(this.lrcInfoRxp) - if (!result) return null return result ? { lyric: result[1], lyric_zz: result[2] } : null }, getLyric(songId, isGetLyricx = false) { @@ -17,8 +16,8 @@ export default { Object.assign(requestObj, httpFetch(`http://newlyric.kuwo.cn/newlyric.lrc?${isGetLyricx ? info.lyric_zz : info.lyric}`)) return requestObj.promise.then(({ statusCode, body, raw }) => { if (statusCode != 200) return Promise.reject(new Error(JSON.stringify(body))) - return decodeLyric({ lrcBase64: raw.toString('base64'), isGetLyricx }).then(base64 => { - return Buffer.from(base64, 'base64').toString() + return decodeLyric({ lrcBase64: raw.toString('base64'), isGetLyricx }).then(base64Data => { + return Buffer.from(base64Data, 'base64').toString() }) }) })