From d0ec90130cad805850d678ca37fb457b0f9f5076 Mon Sep 17 00:00:00 2001 From: lyswhut Date: Mon, 28 Sep 2020 22:52:50 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=AD=8C=E6=9B=B2?= =?UTF-8?q?=E5=B0=81=E9=9D=A2=E6=97=A0=E6=B3=95=E5=B5=8C=E5=85=A5=E7=9A=84?= =?UTF-8?q?Bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/store/modules/download.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/store/modules/download.js b/src/renderer/store/modules/download.js index e62bbeac..6a5f2a09 100644 --- a/src/renderer/store/modules/download.js +++ b/src/renderer/store/modules/download.js @@ -184,7 +184,7 @@ const saveMeta = (downloadInfo, filePath, isEmbedPic, isEmbedLyric) => { }) : Promise.resolve(), ] - Promise.all(tasks).then(([imgUrl, lyrics]) => { + Promise.all(tasks).then(([imgUrl, lyrics = {}]) => { setMeta(filePath, { title: downloadInfo.musicInfo.name, artist: downloadInfo.musicInfo.singer, From 6fe794fdf5c4b2fcd0587ec6ce063e64a53c093a Mon Sep 17 00:00:00 2001 From: lyswhut Date: Mon, 28 Sep 2020 22:53:20 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=85=B7=E7=8B=97?= =?UTF-8?q?=E6=AD=8C=E8=AF=8D=E6=A0=BC=E5=BC=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/store/modules/download.js | 9 ++++++++- src/renderer/utils/music/kg/lyric.js | 4 +--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/renderer/store/modules/download.js b/src/renderer/store/modules/download.js index 6a5f2a09..db8c13cb 100644 --- a/src/renderer/store/modules/download.js +++ b/src/renderer/store/modules/download.js @@ -158,6 +158,9 @@ const getUrl = (downloadInfo, isRefresh) => { return url && !isRefresh ? Promise.resolve({ url }) : music[downloadInfo.musicInfo.source].getMusicUrl(downloadInfo.musicInfo, downloadInfo.type).promise } +// 修复 1.1.x版本 酷狗源歌词格式 +const fixKgLyric = lrc => lrc.startsWith('\ufeff[id:$00000000]') ? lrc.replace(/(?:\[00:(\d\d:\d\d.\d+\]))/gm, '[$1') : lrc + /** * 设置歌曲meta信息 * @param {*} downloadInfo @@ -185,6 +188,7 @@ const saveMeta = (downloadInfo, filePath, isEmbedPic, isEmbedLyric) => { : Promise.resolve(), ] Promise.all(tasks).then(([imgUrl, lyrics = {}]) => { + if (lyrics.lyric) lyrics.lyric = fixKgLyric(lyrics.lyric) setMeta(filePath, { title: downloadInfo.musicInfo.name, artist: downloadInfo.musicInfo.singer, @@ -205,7 +209,10 @@ const downloadLyric = (downloadInfo, filePath) => { ? Promise.resolve({ lyric: downloadInfo.musicInfo.lrc, tlyric: downloadInfo.musicInfo.tlrc || '' }) : music[downloadInfo.musicInfo.source].getLyric(downloadInfo.musicInfo).promise promise.then(lrcs => { - if (lrcs.lyric) saveLrc(filePath.replace(/(mp3|flac|ape|wav)$/, 'lrc'), lrcs.lyric) + if (lrcs.lyric) { + lrcs.lyric = fixKgLyric(lrcs.lyric) + saveLrc(filePath.replace(/(mp3|flac|ape|wav)$/, 'lrc'), lrcs.lyric) + } }) } diff --git a/src/renderer/utils/music/kg/lyric.js b/src/renderer/utils/music/kg/lyric.js index 52b66612..e5398e24 100644 --- a/src/renderer/utils/music/kg/lyric.js +++ b/src/renderer/utils/music/kg/lyric.js @@ -21,12 +21,10 @@ const parseLyric = str => { let time = parseInt(result[2]) let ms = time % 1000 time /= 1000 - let h = parseInt(time / 3600).toString().padStart(2, '0') - time %= 3600 let m = parseInt(time / 60).toString().padStart(2, '0') time %= 60 let s = parseInt(time).toString().padStart(2, '0') - time = `${h}:${m}:${s}.${ms}` + time = `${m}:${s}.${ms}` if (tlyric) tlyric[i] = `[${time}]${tlyric[i++][0]}` return str.replace(result[1], time) }) From 07c58e2ce718dd1ef66e412157960a3c6d76216f Mon Sep 17 00:00:00 2001 From: lyswhut Date: Mon, 28 Sep 2020 23:00:53 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=85=B3=E9=97=AD?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E5=8A=A8=E7=94=BB=E6=97=B6=E4=BB=8E=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E5=80=99=E9=80=89=E5=88=97=E8=A1=A8=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E6=97=A0=E6=95=88=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- publish/changeLog.md | 5 +++-- src/renderer/components/material/SearchInput.vue | 7 +++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/publish/changeLog.md b/publish/changeLog.md index a214d4bc..85b09797 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -2,9 +2,10 @@ - 优化我的列表滚动条位置的保存逻辑 - ### 修复 - 修复初始化搜索历史列表功能 - 修复重启软件后试听列表与收藏列表无法恢复上次的滚动位置的问题 - +- 修复歌曲封面无法嵌入的Bug +- 修复酷狗歌词格式问题 +- 修复关闭切换动画时从搜索候选列表点击内容无效的问题 diff --git a/src/renderer/components/material/SearchInput.vue b/src/renderer/components/material/SearchInput.vue index 1f829139..142d5a00 100644 --- a/src/renderer/components/material/SearchInput.vue +++ b/src/renderer/components/material/SearchInput.vue @@ -94,6 +94,7 @@ export default { this.$refs.dom_input.focus() }, handleTemplistClick(index) { + console.log(index) this.sendEvent('listClick', index) }, handleFocus() { @@ -101,8 +102,10 @@ export default { this.sendEvent('focus') }, handleBlur() { - this.focus = false - this.sendEvent('blur') + setTimeout(() => { + this.focus = false + this.sendEvent('blur') + }, 80) }, handleSearch() { this.hideList() From 686d55a6721a8d919e2603d524efa4d80dda3f0a Mon Sep 17 00:00:00 2001 From: lyswhut Date: Tue, 29 Sep 2020 00:34:39 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=89=B9=E5=BE=81?= =?UTF-8?q?=E5=8C=B9=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/store/modules/download.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/store/modules/download.js b/src/renderer/store/modules/download.js index db8c13cb..13e30e00 100644 --- a/src/renderer/store/modules/download.js +++ b/src/renderer/store/modules/download.js @@ -159,7 +159,7 @@ const getUrl = (downloadInfo, isRefresh) => { } // 修复 1.1.x版本 酷狗源歌词格式 -const fixKgLyric = lrc => lrc.startsWith('\ufeff[id:$00000000]') ? lrc.replace(/(?:\[00:(\d\d:\d\d.\d+\]))/gm, '[$1') : lrc +const fixKgLyric = lrc => /\[00:\d\d:\d\d.\d+\]/.test(lrc) ? lrc.replace(/(?:\[00:(\d\d:\d\d.\d+\]))/gm, '[$1') : lrc /** * 设置歌曲meta信息