From 5c96c83f9890d40cb548f1702f11506f56c95518 Mon Sep 17 00:00:00 2001 From: lyswhut Date: Mon, 2 Nov 2020 15:13:09 +0800 Subject: [PATCH 01/14] =?UTF-8?q?=E7=A7=BB=E9=99=A4kg=E6=BA=90=E7=9A=84?= =?UTF-8?q?=E6=AD=8C=E8=AF=8D=E6=96=87=E4=BB=B6=E5=BC=80=E5=A4=B4=E7=9A=84?= =?UTF-8?q?=E7=A9=BA=E7=99=BD=E5=AD=97=E7=AC=A6=E4=B8=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- publish/changeLog.md | 10 +--------- src/renderer/components/core/Player.vue | 26 +++++++++---------------- src/renderer/store/modules/player.js | 9 +++++++++ src/renderer/utils/music/kg/lyric.js | 1 + 4 files changed, 20 insertions(+), 26 deletions(-) diff --git a/publish/changeLog.md b/publish/changeLog.md index b183e271bf..a24f93b056 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -1,11 +1,3 @@ -### 新增 - -- 播放详情页新增歌曲评论加载显示(某些平台暂不支持显示子评论) - ### 优化 -- 修改播放详情页的歌曲图片的显示效果 - -### 修复 - -- 修复小芸源音乐搜索结果最多只有20条搜索结果的问题 +- 移除kg源的歌词文件开头的空白字符串 diff --git a/src/renderer/components/core/Player.vue b/src/renderer/components/core/Player.vue index 9f6d90534a..f7d2442bf9 100644 --- a/src/renderer/components/core/Player.vue +++ b/src/renderer/components/core/Player.vue @@ -667,23 +667,15 @@ export default { } }, setLrc(targetSong) { - this.musicInfo.lrc = targetSong.lrc - this.musicInfo.tlrc = targetSong.tlrc - - let lrcP = this.musicInfo.lrc && this.musicInfo.tlrc != null - ? Promise.resolve() - : this.getLrc(targetSong).then(() => { - this.musicInfo.lrc = targetSong.lrc - this.musicInfo.tlrc = targetSong.tlrc - }) - - lrcP - .catch(() => { - this.status = this.statusText = this.$t('core.player.lyric_error') - }).finally(() => { - this.handleUpdateWinLyricInfo('lyric', { lrc: this.musicInfo.lrc, tlrc: this.musicInfo.tlrc }) - this.setLyric() - }) + this.getLrc(targetSong).then(() => { + this.musicInfo.lrc = targetSong.lrc + this.musicInfo.tlrc = targetSong.tlrc + }).catch(() => { + this.status = this.statusText = this.$t('core.player.lyric_error') + }).finally(() => { + this.handleUpdateWinLyricInfo('lyric', { lrc: this.musicInfo.lrc, tlrc: this.musicInfo.tlrc }) + this.setLyric() + }) }, handleRemoveMusic() { this.stopPlay() diff --git a/src/renderer/store/modules/player.js b/src/renderer/store/modules/player.js index 16fbc8a04c..80a38b5b8e 100644 --- a/src/renderer/store/modules/player.js +++ b/src/renderer/store/modules/player.js @@ -59,6 +59,15 @@ const actions = { }, getLrc({ commit, state }, musicInfo) { if (lrcRequest && lrcRequest.cancelHttp) lrcRequest.cancelHttp() + if (musicInfo.lrc && musicInfo.tlrc != null) { + if (musicInfo.lrc.startsWith('\ufeff[id:$00000000]')) { + let str = musicInfo.lrc.replace('\ufeff[id:$00000000]\n', '') + commit('setLrc', { musicInfo, lyric: str, tlyric: musicInfo.tlrc }) + } + return Promise.resolve() + } + + lrcRequest = music[musicInfo.source].getLyric(musicInfo) return lrcRequest.promise.then(({ lyric, tlyric }) => { lrcRequest = null diff --git a/src/renderer/utils/music/kg/lyric.js b/src/renderer/utils/music/kg/lyric.js index e5398e2430..d0f4f903a2 100644 --- a/src/renderer/utils/music/kg/lyric.js +++ b/src/renderer/utils/music/kg/lyric.js @@ -3,6 +3,7 @@ import { decodeLyric } from './util' const parseLyric = str => { str = str.replace(/(?:<\d+,\d+,\d+>|\r)/g, '') + if (str.startsWith('\ufeff[id:$00000000]')) str = str.replace('\ufeff[id:$00000000]\n', '') let trans = str.match(/\[language:([\w=\\/+]+)\]/) let tlyric if (trans) { From 66ffe03224be9ab4cd6062b5cbb1804d9606b2dd Mon Sep 17 00:00:00 2001 From: lyswhut Date: Wed, 4 Nov 2020 09:08:18 +0800 Subject: [PATCH 02/14] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=84=E8=AE=BA?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/lang/en-us/core/player.json | 2 +- src/renderer/lang/zh-cn/core/player.json | 2 +- src/renderer/lang/zh-tw/core/player.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/renderer/lang/en-us/core/player.json b/src/renderer/lang/en-us/core/player.json index 2de3604c12..e0f604779f 100644 --- a/src/renderer/lang/en-us/core/player.json +++ b/src/renderer/lang/en-us/core/player.json @@ -29,7 +29,7 @@ "play_toggle_mode_single_loop": "Single Loop", "play_toggle_mode_off": "Disable", - "comment_show": "Show song comments", + "comment_show": "Song comments", "comment_hot_loading": "Hot comments are loading", "comment_new_loading": "Latest comments are loading", "comment_hot_load_error": "Hot comments failed to load, click to try to reload", diff --git a/src/renderer/lang/zh-cn/core/player.json b/src/renderer/lang/zh-cn/core/player.json index bcdf2b7ecb..47ba6c132d 100644 --- a/src/renderer/lang/zh-cn/core/player.json +++ b/src/renderer/lang/zh-cn/core/player.json @@ -29,7 +29,7 @@ "play_toggle_mode_single_loop": "单曲循环", "play_toggle_mode_off": "禁用", - "comment_show": "显示歌曲评论", + "comment_show": "歌曲评论", "comment_hot_loading": "热门评论加载中", "comment_new_loading": "最新评论加载中", "comment_hot_load_error": "热门评论加载失败,点击尝试重新加载", diff --git a/src/renderer/lang/zh-tw/core/player.json b/src/renderer/lang/zh-tw/core/player.json index 05eaa62c4a..b4ea895c1c 100644 --- a/src/renderer/lang/zh-tw/core/player.json +++ b/src/renderer/lang/zh-tw/core/player.json @@ -29,7 +29,7 @@ "play_toggle_mode_single_loop": "單曲循環", "play_toggle_mode_off": "禁用", - "comment_show": "顯示歌曲評論", + "comment_show": "歌曲評論", "comment_hot_loading": "熱門評論加載中", "comment_new_loading": "最新評論加載中", "comment_hot_load_error": "熱門評論加載失敗,點擊嘗試重新加載", From 43f8d9d72b8294d92966ed9760c42ab995afdc7a Mon Sep 17 00:00:00 2001 From: lyswhut Date: Fri, 6 Nov 2020 21:33:27 +0800 Subject: [PATCH 03/14] =?UTF-8?q?=E6=9B=B4=E6=96=B0FAQ=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FAQ.md | 92 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/FAQ.md b/FAQ.md index 67adbfcc19..484ad0f5bc 100644 --- a/FAQ.md +++ b/FAQ.md @@ -2,7 +2,7 @@ 在阅读本常见问题后,仍然无法解决你的问题,请提交issue或者加企鹅群`830125506`反馈(无事勿加,入群先看群公告),反馈时请**注明**已阅读常见问题! -## 软件为什么没有桌面歌词与自定义列表功能 +## ~~软件为什么没有桌面歌词与自定义列表功能~~ 洛雪音乐的最初定位不是作为播放器开发的,它主要用于**查找歌曲**,软件的播放功能仅用于试听,不建议用作为常用播放器使用。 @@ -37,6 +37,50 @@ 播放在线列表内的歌曲需要将它们都添加到我的列表才能播放,你可以全选列表内的歌曲然后添加到现有列表或者新创建的列表,然后去播放该列表内的歌曲。 +## Windows 7 下界面异常(界面显示不完整) + +由于软件默认使用了透明窗口,根据Electron官方文档的[说明](https://electronjs.org/docs/api/frameless-window#%E5%B1%80%E9%99%90%E6%80%A7): +> 在 windows 操作系统上, 当 DWM 被禁用时, 透明窗口将无法工作。 + +因此,当 win7 没有使用**AERO**主题时界面将会显示异常,开启AERO的方法请自行百度:`win7开启aero效果`(开启后可看到任务栏变透明)。
+从`0.14.0`版本起不再强制要求开启透明效果,若你实在不想开启(若非电脑配置太低,墙裂建议开启!),可通过添加运行参数`-nt`来运行程序即可,例如:`.\lx-music-desktop.exe -nt`,添加方法可自行百度“给快捷方式加参数”,该参数的作用是用来控制程序是否使用非透明窗口运行。 + +对于一些完全无法正常显示界面、开启了AERO后问题仍未解决的情况,请阅读下面的 **软件启动后,界面无法显示** 解决 + +## 软件启动后,界面无法显示 + +对于软件启动后,可以在任务栏看到软件,但软件界面在桌面上无任何显示,或者整个界面偶尔闪烁的情况。
+原始问题看:
+解决办法:下载`.NET Framework 4.7.1`或**更高**版本安装即可(建议安装最新版,若安装过程中遇到问题可尝试自行百度解决)。
+微软官方下载地址:
+下载`Runtime(运行时)`版即可,安装完成后可能需要重启才生效。 + +若还是不行可尝试以下操作: + +- 更新显卡驱动 +- 尝试将绿色版的软件放在**桌面**或**我的文档**运行 + +## 安装版安装失败,提示安装程序并未成功地运行完成 + +对于部分电脑出现安装失败的问题,可以做出以下尝试: + +- 若你之前可以安装成功,但现在安装失败,就去**控制面板-程序和功能**或用第三方卸载工具看下有没有之前的版本残留,若同时在不同路径下安装了多个版本就可能会出现该问题,这种情况卸载掉所有版本重新安装即可 +- 清理安装路径下的残留文件 +- 清理注册表(建议用清理工具清理) + +## 无法打开外部歌单 + +不支持垮源打开歌单,请**确认**你需要打开的歌单平台是否与软件标签所写的**歌单源**对应(不一样的话请通过右上角切换歌单源);
+对于分享出来的歌单,若打开失败,可尝试先在浏览器中打开后,再从浏览器地址栏复制URL地址到软件打开;
+或者如果你知道歌单 id 也可以直接输入歌单 id 打开。
+ +## 软件无法联网 + +软件的排行榜、歌单、搜索列表**都**无法加载: + +- 检查是否在设置界面开启了代理(当代理乱设置时软件将无法联网) +- 检查软件是否被第三方软件/防火墙阻止联网 + ## 桌面歌词显示异常 ### Windows 7 系统桌面歌词显示异常 @@ -79,37 +123,6 @@ Windows 7 未开启 Aero 效果时桌面歌词会有问题,详情看下面的 注意:**绿色版**的软件自动更新功能**不可用**,建议使用安装版!!
注意:**Mac版**、**Linux deb**版不支持自动更新! -## Windows 7 下界面异常(界面显示不完整) - -由于软件默认使用了透明窗口,根据Electron官方文档的[说明](https://electronjs.org/docs/api/frameless-window#%E5%B1%80%E9%99%90%E6%80%A7): -> 在 windows 操作系统上, 当 DWM 被禁用时, 透明窗口将无法工作。 - -因此,当 win7 没有使用**AERO**主题时界面将会显示异常,开启AERO的方法请自行百度:`win7开启aero效果`(开启后可看到任务栏变透明)。
-从`0.14.0`版本起不再强制要求开启透明效果,若你实在不想开启(若非电脑配置太低,墙裂建议开启!),可通过添加运行参数`-nt`来运行程序即可,例如:`.\lx-music-desktop.exe -nt`,添加方法可自行百度“给快捷方式加参数”,该参数的作用是用来控制程序是否使用非透明窗口运行。 - -对于一些完全无法正常显示界面、开启了AERO后问题仍未解决的情况,请阅读下面的 **软件启动后,界面无法显示** 解决 - -## 软件启动后,界面无法显示 - -对于软件启动后,可以在任务栏看到软件,但软件界面在桌面上无任何显示,或者整个界面偶尔闪烁的情况。
-原始问题看:
-解决办法:下载`.NET Framework 4.7.1`或**更高**版本安装即可(建议安装最新版,若安装过程中遇到问题可尝试自行百度解决)。
-微软官方下载地址:
-下载`Runtime(运行时)`版即可,安装完成后可能需要重启才生效。 - -若还是不行可尝试以下操作: - -- 更新显卡驱动 -- 尝试将绿色版的软件放在**桌面**或**我的文档**运行 - -## 安装版安装失败,提示安装程序并未成功地运行完成 - -对于部分电脑出现安装失败的问题,可以做出以下尝试: - -- 若你之前可以安装成功,但现在安装失败,就去**控制面板-程序和功能**或用第三方卸载工具看下有没有之前的版本残留,若同时在不同路径下安装了多个版本就可能会出现该问题,这种情况卸载掉所有版本重新安装即可 -- 清理安装路径下的残留文件 -- 清理注册表(建议用清理工具清理) - ## 缺少`xxx.dll` 这个是电脑缺少某些dll导致的,正常的系统是没有这个问题的,可以尝试如下几个解决办法: @@ -123,19 +136,6 @@ Windows 7 未开启 Aero 效果时桌面歌词会有问题,详情看下面的 尽管如此,但这不意味着软件是100%安全的,由于软件使用了第三方依赖,当这些依赖存在恶意行为时([供应链攻击](https://docs.microsoft.com/zh-cn/windows/security/threat-protection/intelligence/supply-chain-malware)),软件也将会受到牵连,所以我只能尽量选择使用较多人用、信任度较高的依赖。
当然,以上说明建立的前提是在你所用的安装包是从**本项目主页上写的链接**下载的,或者有相关能力者还可以下载源代码自己构建安装包。 -从`0.17.0`起,由于加入了音频输出设备切换功能,该功能调用了 [MediaDevices.enumerateDevices()](https://developer.mozilla.org/zh-CN/docs/Web/API/MediaDevices/enumerateDevices),可能导致安全软件提示洛雪要访问摄像头(目前发现卡巴斯基会提示),但实际上没有用到摄像头,并且摄像头的提示灯也不会亮,你可以选择阻止访问。 +从`v0.17.0`起,由于加入了音频输出设备切换功能,该功能调用了 [MediaDevices.enumerateDevices()](https://developer.mozilla.org/zh-CN/docs/Web/API/MediaDevices/enumerateDevices),可能导致安全软件提示洛雪要访问摄像头(目前发现卡巴斯基会提示),但实际上没有用到摄像头,并且摄像头的提示灯也不会亮,你可以选择阻止访问。 最后,若出现杀毒软件报毒、存在恶意行为,请自行判断选择是否继续使用本软件! - -## 软件无法联网 - -软件的排行榜、歌单、搜索列表**都**无法加载: - -- 检查是否在设置界面开启了代理(当代理乱设置时软件将无法联网) -- 检查软件是否被第三方软件/防火墙阻止联网 - -## 无法打开外部歌单 - -不支持垮源打开歌单,请确认你需要打开的歌单平台是否与软件标签所写的歌单源对应;
-对于分享出来的歌单,若打开失败,可尝试先在浏览器中打开后,再从浏览器地址栏复制URL地址到软件打开;
-或者如果你知道歌单 id 也可以直接输入歌单 id 打开。
From 1cee2febf4eb3ae42f6b76636bded6a68c440908 Mon Sep 17 00:00:00 2001 From: lyswhut Date: Tue, 10 Nov 2020 08:31:47 +0800 Subject: [PATCH 04/14] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=93=E8=BE=91?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E6=97=A0=E6=B3=95=E5=B5=8C=E5=85=A5=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 22 ++++++++++++++++------ package.json | 2 +- publish/changeLog.md | 4 ++++ src/main/utils/mp3Meta.js | 3 +++ 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6ee4056281..8530b77166 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11945,11 +11945,21 @@ "dev": true }, "node-id3": { - "version": "0.2.1", - "resolved": "https://registry.npm.taobao.org/node-id3/download/node-id3-0.2.1.tgz", - "integrity": "sha1-QYNSONdoe4dbCMzguxYMXOoLurw=", + "version": "0.1.21", + "resolved": "https://registry.npm.taobao.org/node-id3/download/node-id3-0.1.21.tgz", + "integrity": "sha1-bp+8x68J9lEUkJoR90otcLVFu/M=", "requires": { - "iconv-lite": "0.6.2" + "iconv-lite": "0.5.1" + }, + "dependencies": { + "iconv-lite": { + "version": "0.5.1", + "resolved": "https://registry.npm.taobao.org/iconv-lite/download/iconv-lite-0.5.1.tgz?cache=0&sync_timestamp=1594184250387&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ficonv-lite%2Fdownload%2Ficonv-lite-0.5.1.tgz", + "integrity": "sha1-skJdPHsY9yGfLKZj0QO925FxjWQ=", + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + } } }, "node-libs-browser": { @@ -15544,7 +15554,7 @@ "dependencies": { "ajv": { "version": "6.12.6", - "resolved": "https://registry.npm.taobao.org/ajv/download/ajv-6.12.6.tgz?cache=0&sync_timestamp=1603561547443&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fajv%2Fdownload%2Fajv-6.12.6.tgz", + "resolved": "https://registry.npm.taobao.org/ajv/download/ajv-6.12.6.tgz?cache=0&sync_timestamp=1602353715225&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fajv%2Fdownload%2Fajv-6.12.6.tgz", "integrity": "sha1-uvWmLoArB9l3A0WG+MO69a3ybfQ=", "dev": true, "requires": { @@ -15556,7 +15566,7 @@ }, "ajv-keywords": { "version": "3.5.2", - "resolved": "https://registry.npm.taobao.org/ajv-keywords/download/ajv-keywords-3.5.2.tgz?cache=0&sync_timestamp=1603566069729&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fajv-keywords%2Fdownload%2Fajv-keywords-3.5.2.tgz", + "resolved": "https://registry.npm.taobao.org/ajv-keywords/download/ajv-keywords-3.5.2.tgz?cache=0&sync_timestamp=1595908717940&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fajv-keywords%2Fdownload%2Fajv-keywords-3.5.2.tgz", "integrity": "sha1-MfKdpatuANHC0yms97WSlhTVAU0=", "dev": true }, diff --git a/package.json b/package.json index 10800582b2..7bb6f68b66 100644 --- a/package.json +++ b/package.json @@ -228,7 +228,7 @@ "js-htmlencode": "^0.3.0", "lrc-file-parser": "^1.0.5", "needle": "^2.5.2", - "node-id3": "^0.2.1", + "node-id3": "^0.1.21", "request": "^2.88.2", "vue": "^2.6.12", "vue-i18n": "^8.22.1", diff --git a/publish/changeLog.md b/publish/changeLog.md index a24f93b056..705791871a 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -1,3 +1,7 @@ ### 优化 - 移除kg源的歌词文件开头的空白字符串 + +### 修复 + +- 修复专辑图片无法嵌入的问题 diff --git a/src/main/utils/mp3Meta.js b/src/main/utils/mp3Meta.js index 71f9857914..80b16b7148 100644 --- a/src/main/utils/mp3Meta.js +++ b/src/main/utils/mp3Meta.js @@ -47,6 +47,9 @@ module.exports = (filePath, meta) => { if (err) console.log(err.message) delete meta.APIC handleWriteMeta(meta, filePath) + fs.unlink(picPath, err => { + if (err) console.log(err.message) + }) }) }) .on('error', err => { From b820adf0bfe93b6dcf9097c56427ad9e2953c9dd Mon Sep 17 00:00:00 2001 From: lyswhut Date: Tue, 10 Nov 2020 08:33:07 +0800 Subject: [PATCH 05/14] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=88=87=E6=AD=8C?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/components/core/Player.vue | 34 +++++++++++++++---------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/src/renderer/components/core/Player.vue b/src/renderer/components/core/Player.vue index f7d2442bf9..3017c3874f 100644 --- a/src/renderer/components/core/Player.vue +++ b/src/renderer/components/core/Player.vue @@ -517,14 +517,17 @@ export default { if (this.setting.player.togglePlayMethod == 'random' && this.playedList.length) { let index = this.playedList.indexOf(this.targetSong) index -= 1 - if (index > -1) { - let listIndex = this.list.indexOf(this.playedList[index]) - if (listIndex < 0) { - this.removePlayedList(index) - return this.handlePrev() + while (true) { + if (index > -1) { + let listIndex = this.list.indexOf(this.playedList[index]) + if (listIndex < 0) { + this.removePlayedList(index) + continue + } + this.setPlayIndex(listIndex) + return } - this.setPlayIndex(listIndex) - return + break } } let list = await this.filterList() @@ -552,14 +555,17 @@ export default { if (this.setting.player.togglePlayMethod == 'random' && this.playedList.length) { let index = this.playedList.indexOf(this.targetSong) index += 1 - if (index < this.playedList.length) { - let listIndex = this.list.indexOf(this.playedList[index]) - if (listIndex < 0) { - this.removePlayedList(index) - return this.handleNext() + while (true) { + if (index < this.playedList.length) { + let listIndex = this.list.indexOf(this.playedList[index]) + if (listIndex < 0) { + this.removePlayedList(index) + continue + } + this.setPlayIndex(listIndex) + return } - this.setPlayIndex(listIndex) - return + break } } let list = await this.filterList() From 4cdd2110a6f307c18f5f7613813b304a5cb024fa Mon Sep 17 00:00:00 2001 From: lyswhut Date: Tue, 10 Nov 2020 10:59:45 +0800 Subject: [PATCH 06/14] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 72 ++++++++++++++------------ package.json | 16 +++--- src/main/index.js | 2 +- src/main/modules/hotKey/utils.js | 8 +-- src/main/modules/winLyric/index.js | 3 +- src/renderer/store/modules/download.js | 12 +++-- src/renderer/store/modules/songList.js | 10 ++-- src/renderer/utils/index.js | 2 +- src/renderer/views/Search.vue | 3 +- 9 files changed, 71 insertions(+), 57 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8530b77166..66355a5a09 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4703,9 +4703,9 @@ "dev": true }, "boolean": { - "version": "3.0.1", - "resolved": "https://registry.npm.taobao.org/boolean/download/boolean-3.0.1.tgz", - "integrity": "sha1-NezytKLuGRsLRJhvFOtfBSpcu08=", + "version": "3.0.2", + "resolved": "https://registry.npm.taobao.org/boolean/download/boolean-3.0.2.tgz", + "integrity": "sha1-3xuqGLaisOcIQEdeHZPsj+dbJXA=", "dev": true, "optional": true }, @@ -5950,9 +5950,9 @@ "dev": true }, "copy-webpack-plugin": { - "version": "6.2.1", - "resolved": "https://registry.npm.taobao.org/copy-webpack-plugin/download/copy-webpack-plugin-6.2.1.tgz", - "integrity": "sha1-gBXk1cXmN6t7Ocdtqp4Dx6S/GuU=", + "version": "6.3.0", + "resolved": "https://registry.npm.taobao.org/copy-webpack-plugin/download/copy-webpack-plugin-6.3.0.tgz?cache=0&sync_timestamp=1604418450281&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcopy-webpack-plugin%2Fdownload%2Fcopy-webpack-plugin-6.3.0.tgz", + "integrity": "sha1-kYILY7vefXNgmsy4bat+c4aGP28=", "dev": true, "requires": { "cacache": "^15.0.5", @@ -6117,9 +6117,9 @@ } }, "core-js": { - "version": "3.6.5", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.6.5.tgz", - "integrity": "sha512-vZVEEwZoIsI+vPEuoF9Iqf5H7/M3eeQqWlQnYa8FSKKePuYTf5MWnxb5SDAzCa60b3JBRS5g9b+Dq7b1y/RCrA==", + "version": "3.7.0", + "resolved": "https://registry.npm.taobao.org/core-js/download/core-js-3.7.0.tgz?cache=0&sync_timestamp=1604675498528&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcore-js%2Fdownload%2Fcore-js-3.7.0.tgz", + "integrity": "sha1-sKdhoCSIV3r7+XF55Ggb9JVoUg8=", "dev": true }, "core-js-compat": { @@ -7081,9 +7081,9 @@ } }, "electron": { - "version": "9.3.3", - "resolved": "https://registry.npm.taobao.org/electron/download/electron-9.3.3.tgz", - "integrity": "sha1-maZhnV32j5dpel0dgu86imP83zY=", + "version": "9.3.4", + "resolved": "https://registry.npm.taobao.org/electron/download/electron-9.3.4.tgz?cache=0&sync_timestamp=1604968518869&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Felectron%2Fdownload%2Felectron-9.3.4.tgz", + "integrity": "sha1-1i3Z+KvJPACYeHFN6eYNsDA2GgU=", "dev": true, "requires": { "@electron/get": "^1.0.1", @@ -7092,9 +7092,9 @@ }, "dependencies": { "@types/node": { - "version": "12.19.2", - "resolved": "https://registry.npm.taobao.org/@types/node/download/@types/node-12.19.2.tgz", - "integrity": "sha1-lWXtXHK6lgOPw63WQ+3V54IFmOc=", + "version": "12.19.4", + "resolved": "https://registry.npm.taobao.org/@types/node/download/@types/node-12.19.4.tgz?cache=0&sync_timestamp=1604951079891&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fnode%2Fdownload%2F%40types%2Fnode-12.19.4.tgz", + "integrity": "sha1-zfu2LibHQ17ZqrnJQTk8w1mOm0Y=", "dev": true } } @@ -7205,9 +7205,9 @@ } }, "electron-log": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/electron-log/-/electron-log-4.2.4.tgz", - "integrity": "sha512-CXbDU+Iwi+TjKzugKZmTRIORIPe3uQRqgChUl19fkW/reFUn5WP7dt+cNGT3bkLV8xfPilpkPFv33HgtmLLewQ==" + "version": "4.3.0", + "resolved": "https://registry.npm.taobao.org/electron-log/download/electron-log-4.3.0.tgz?cache=0&sync_timestamp=1604284727663&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Felectron-log%2Fdownload%2Felectron-log-4.3.0.tgz", + "integrity": "sha1-boQaXJrzTtPKg+WopBVv3Dm+1GQ=" }, "electron-publish": { "version": "22.9.1", @@ -7521,9 +7521,9 @@ "dev": true }, "eslint": { - "version": "7.12.1", - "resolved": "https://registry.npm.taobao.org/eslint/download/eslint-7.12.1.tgz?cache=0&sync_timestamp=1603768145986&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Feslint%2Fdownload%2Feslint-7.12.1.tgz", - "integrity": "sha1-vZqB+memz9UWVs24iBLOSczsWAE=", + "version": "7.13.0", + "resolved": "https://registry.npm.taobao.org/eslint/download/eslint-7.13.0.tgz", + "integrity": "sha1-fxgBJsDc3vMnv7VLIR14At7MCNo=", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", @@ -7632,8 +7632,8 @@ }, "eslint-config-standard": { "version": "14.1.1", - "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-14.1.1.tgz", - "integrity": "sha512-Z9B+VR+JIXRxz21udPTL9HpFMyoMUEeX1G251EQ6e05WD9aPVtVBn09XUmZ259wCMlCDmYDSZG62Hhm+ZTJcUg==", + "resolved": "https://registry.npm.taobao.org/eslint-config-standard/download/eslint-config-standard-14.1.1.tgz?cache=0&sync_timestamp=1604090914442&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Feslint-config-standard%2Fdownload%2Feslint-config-standard-14.1.1.tgz", + "integrity": "sha1-gwqOROeu995nRkl5rQa0BgJsVuo=", "dev": true }, "eslint-formatter-friendly": { @@ -11428,18 +11428,24 @@ } }, "markdown-it": { - "version": "11.0.1", - "resolved": "https://registry.npm.taobao.org/markdown-it/download/markdown-it-11.0.1.tgz?cache=0&sync_timestamp=1600069708850&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmarkdown-it%2Fdownload%2Fmarkdown-it-11.0.1.tgz", - "integrity": "sha1-tU8V7Cohk++mbdoetBc7rqCJk9Y=", + "version": "12.0.2", + "resolved": "https://registry.npm.taobao.org/markdown-it/download/markdown-it-12.0.2.tgz?cache=0&sync_timestamp=1603472606302&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmarkdown-it%2Fdownload%2Fmarkdown-it-12.0.2.tgz", + "integrity": "sha1-RAG+ro34qiIh/GVlpxiOYKBu8O0=", "dev": true, "requires": { - "argparse": "^1.0.7", + "argparse": "^2.0.1", "entities": "~2.0.0", "linkify-it": "^3.0.1", "mdurl": "^1.0.1", "uc.micro": "^1.0.5" }, "dependencies": { + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/argparse/download/argparse-2.0.1.tgz", + "integrity": "sha1-JG9Q88p4oyQPbJl+ipvR6sSeSzg=", + "dev": true + }, "entities": { "version": "2.0.3", "resolved": "https://registry.npm.taobao.org/entities/download/entities-2.0.3.tgz", @@ -16726,9 +16732,9 @@ "integrity": "sha1-ud0Jihfh9a25G9+WEfA4UxDafLE=" }, "vue-loader": { - "version": "15.9.4", - "resolved": "https://registry.npm.taobao.org/vue-loader/download/vue-loader-15.9.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvue-loader%2Fdownload%2Fvue-loader-15.9.4.tgz", - "integrity": "sha1-wuzvihoIAqx2xtaGZBtd3lIq4mc=", + "version": "15.9.5", + "resolved": "https://registry.npm.taobao.org/vue-loader/download/vue-loader-15.9.5.tgz?cache=0&sync_timestamp=1604764636407&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvue-loader%2Fdownload%2Fvue-loader-15.9.5.tgz", + "integrity": "sha1-epYNxCCjQ53qrN2gOP3Nv3xDJwY=", "dev": true, "requires": { "@vue/component-compiler-utils": "^3.1.0", @@ -16739,9 +16745,9 @@ } }, "vue-router": { - "version": "3.4.8", - "resolved": "https://registry.npm.taobao.org/vue-router/download/vue-router-3.4.8.tgz?cache=0&sync_timestamp=1603710629657&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvue-router%2Fdownload%2Fvue-router-3.4.8.tgz", - "integrity": "sha1-LAYmHTXYB1iTRwNS1C1wtih7gZQ=" + "version": "3.4.9", + "resolved": "https://registry.npm.taobao.org/vue-router/download/vue-router-3.4.9.tgz?cache=0&sync_timestamp=1604611494091&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvue-router%2Fdownload%2Fvue-router-3.4.9.tgz", + "integrity": "sha1-wBb0IDCuKTLxTkdIs5odmg4lDmY=" }, "vue-style-loader": { "version": "4.1.2", diff --git a/package.json b/package.json index 7bb6f68b66..757f32f55d 100644 --- a/package.json +++ b/package.json @@ -171,16 +171,16 @@ "cfonts": "^2.8.6", "chalk": "^4.1.0", "changelog-parser": "^2.8.0", - "copy-webpack-plugin": "^6.2.1", - "core-js": "^3.6.5", + "copy-webpack-plugin": "^6.3.0", + "core-js": "^3.7.0", "cross-env": "^7.0.2", "css-loader": "^4.3.0", "del": "^6.0.0", - "electron": "^9.3.3", + "electron": "^9.3.4", "electron-builder": "^22.9.1", "electron-debug": "^3.1.0", "electron-devtools-installer": "^3.1.1", - "eslint": "^7.12.1", + "eslint": "^7.13.0", "eslint-config-standard": "^14.1.1", "eslint-formatter-friendly": "^7.0.0", "eslint-loader": "^4.0.2", @@ -194,7 +194,7 @@ "html-webpack-plugin": "^4.5.0", "less": "^3.12.2", "less-loader": "^7.0.2", - "markdown-it": "^11.0.1", + "markdown-it": "^12.0.2", "mini-css-extract-plugin": "^0.12.0", "optimize-css-assets-webpack-plugin": "^5.0.4", "postcss-loader": "^4.0.4", @@ -209,7 +209,7 @@ "stylus-loader": "^4.2.0", "terser-webpack-plugin": "^4.2.3", "url-loader": "^4.1.1", - "vue-loader": "^15.9.4", + "vue-loader": "^15.9.5", "vue-template-compiler": "^2.6.12", "webpack": "^4.44.2", "webpack-cli": "^3.3.12", @@ -220,7 +220,7 @@ "dependencies": { "crypto-js": "^4.0.0", "dnscache": "^1.0.2", - "electron-log": "^4.2.4", + "electron-log": "^4.3.0", "electron-store": "^6.0.1", "electron-updater": "^4.3.5", "iconv-lite": "^0.6.2", @@ -232,7 +232,7 @@ "request": "^2.88.2", "vue": "^2.6.12", "vue-i18n": "^8.22.1", - "vue-router": "^3.4.8", + "vue-router": "^3.4.9", "vuex": "^3.5.1", "vuex-router-sync": "^5.0.0" } diff --git a/src/main/index.js b/src/main/index.js index e00ec1334c..ee66cf2cdb 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -82,7 +82,7 @@ if (isDev) { winURL = 'http://localhost:9080' } else { global.__static = path.join(__dirname, '/static') - winURL = `file://${__dirname}/index.html` + winURL = `file://${path.join(__dirname, 'index.html')}` } function createWindow() { diff --git a/src/main/modules/hotKey/utils.js b/src/main/modules/hotKey/utils.js index 74a24f4f0a..aae8d479a3 100644 --- a/src/main/modules/hotKey/utils.js +++ b/src/main/modules/hotKey/utils.js @@ -23,9 +23,11 @@ exports.registerHotkey = ({ key, info }) => { } } global.appHotKey.state[key].info = info - let status = global.appHotKey.state[key].status = globalShortcut.isRegistered(transKey) ? false : globalShortcut.register(transKey, () => { - handleKeyDown(key) - }) + let status = global.appHotKey.state[key].status = globalShortcut.isRegistered(transKey) + ? false + : globalShortcut.register(transKey, () => { + handleKeyDown(key) + }) return status } diff --git a/src/main/modules/winLyric/index.js b/src/main/modules/winLyric/index.js index 49cf2cb5c9..498c24c803 100644 --- a/src/main/modules/winLyric/index.js +++ b/src/main/modules/winLyric/index.js @@ -1,3 +1,4 @@ +const path = require('path') const { BrowserWindow } = require('electron') const { winLyric: WIN_LYRIC_EVENT_NAME } = require('../../events/_name') const { debounce } = require('../../../common/utils') @@ -13,7 +14,7 @@ global.lx_event.winLyric.on(WIN_LYRIC_EVENT_NAME.close, () => { closeWindow() }) -let winURL = global.isDev ? 'http://localhost:9081/lyric.html' : `file://${__dirname}/lyric.html` +let winURL = global.isDev ? 'http://localhost:9081/lyric.html' : `file://${path.join(__dirname, 'lyric.html')}` const setLyricsConfig = debounce(config => { // if (x != null) bounds.x = x diff --git a/src/renderer/store/modules/download.js b/src/renderer/store/modules/download.js index 13e30e00e3..5e438108c2 100644 --- a/src/renderer/store/modules/download.js +++ b/src/renderer/store/modules/download.js @@ -377,11 +377,13 @@ const actions = { }, } commit('setStatusText', { downloadInfo, text: '获取URL中...' }) - let p = options.url ? Promise.resolve() : getUrl(downloadInfo).then(result => { - commit('updateUrl', { downloadInfo, url: result.url }) - if (!result.url) return Promise.reject(new Error('获取URL失败')) - options.url = result.url - }) + let p = options.url + ? Promise.resolve() + : getUrl(downloadInfo).then(result => { + commit('updateUrl', { downloadInfo, url: result.url }) + if (!result.url) return Promise.reject(new Error('获取URL失败')) + options.url = result.url + }) p.then(() => { tryNum[downloadInfo.key] = 0 dls[downloadInfo.key] = download(options) diff --git a/src/renderer/store/modules/songList.js b/src/renderer/store/modules/songList.js index 731b04e181..da1b3959ff 100644 --- a/src/renderer/store/modules/songList.js +++ b/src/renderer/store/modules/songList.js @@ -85,10 +85,12 @@ const actions = { let source = rootState.setting.songList.source const loadData = (id, page) => { let key = `sdetail__${source}__${id}__${page}` - return cache.has(key) ? Promise.resolve(cache.get(key)) : music[source].songList.getListDetail(id, page).then(result => { - cache.set(key, result) - return result - }) + return cache.has(key) + ? Promise.resolve(cache.get(key)) + : music[source].songList.getListDetail(id, page).then(result => { + cache.set(key, result) + return result + }) } return loadData(id, 1).then(result => { if (result.total <= result.limit) return result.list diff --git a/src/renderer/utils/index.js b/src/renderer/utils/index.js index 2c73e0fd0a..093247747a 100644 --- a/src/renderer/utils/index.js +++ b/src/renderer/utils/index.js @@ -132,7 +132,7 @@ const handleScroll = (element, to, duration = 300, fn = () => {}) => { * @param {*} fn 滚动完成后的回调 * @param {*} delay 延迟执行时间 */ -export const scrollTo = (element, to, duration = 300, fn = () => {}, delay) => { +export const scrollTo = (element, to, duration = 300, fn = () => {}, delay = 0) => { let cancelFn let timeout if (delay) { diff --git a/src/renderer/views/Search.vue b/src/renderer/views/Search.vue index ccfcb344a0..f7ed67a4a3 100644 --- a/src/renderer/views/Search.vue +++ b/src/renderer/views/Search.vue @@ -382,7 +382,8 @@ export default { return this.searchSourceId == 'all' ? list.filter(s => this.assertApiSupport(s.source)) : this.assertApiSupport(this.searchSourceId) - ? [...list] : [] + ? [...list] + : [] }, handleListAddModalClose() { this.isShowListAdd = false From 16876502d184fc13532236355db9ee80c675f124 Mon Sep 17 00:00:00 2001 From: lyswhut Date: Fri, 13 Nov 2020 14:57:45 +0800 Subject: [PATCH 07/14] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=92=AD=E6=94=BE?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=A0=8F=E5=88=87=E6=8D=A2=E2=80=9C=E4=B8=8A?= =?UTF-8?q?=E4=B8=80=E9=A6=96=E2=80=9D=E6=AD=8C=E6=9B=B2=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E9=94=99=E8=AF=AF=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 | 1 + src/renderer/components/core/Player.vue | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/publish/changeLog.md b/publish/changeLog.md index 705791871a..8f20c3c492 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -5,3 +5,4 @@ ### 修复 - 修复专辑图片无法嵌入的问题 +- 修复播放状态栏切换“上一首”歌曲按钮提示错误的问题 diff --git a/src/renderer/components/core/Player.vue b/src/renderer/components/core/Player.vue index 3017c3874f..8a4b5fbc1d 100644 --- a/src/renderer/components/core/Player.vue +++ b/src/renderer/components/core/Player.vue @@ -49,7 +49,7 @@ div(:class="$style.player") span(style="margin: 0 5px;") / span {{maxPlayTimeStr}} div(:class="$style.right") - div(:class="$style.playBtn" @click='handlePrev' :tips="$t('core.player.next')" style="transform: rotate(180deg);") + div(:class="$style.playBtn" @click='handlePrev' :tips="$t('core.player.prev')" style="transform: rotate(180deg);") svg(version='1.1' xmlns='http://www.w3.org/2000/svg' xlink='http://www.w3.org/1999/xlink' height='100%' viewBox='0 0 220.847 220.847' space='preserve') use(xlink:href='#icon-nextMusic') div(:class="$style.playBtn" :tips="isPlay ? $t('core.player.pause') : $t('core.player.play')" @click='togglePlay') From ac162103a79de4f6cebf102a70e62180eb0bdddb Mon Sep 17 00:00:00 2001 From: lyswhut Date: Sat, 14 Nov 2020 10:22:47 +0800 Subject: [PATCH 08/14] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- package-lock.json | 122 ++++++++++++++++++++++++++-------------------- package.json | 16 +++--- 3 files changed, 78 insertions(+), 62 deletions(-) diff --git a/README.md b/README.md index a9d6fd8e6c..36d8ecd87f 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ 所用技术栈: -- Electron 10 +- Electron 9 - Vue 2 已支持的平台: diff --git a/package-lock.json b/package-lock.json index 66355a5a09..b91d4f7dd2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3966,22 +3966,38 @@ } }, "babel-loader": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-8.1.0.tgz", - "integrity": "sha512-7q7nC1tYOrqvUrN3LQK4GwSk/TQorZSOlO9C+RZDZpODgyN4ZlCqE5q9cDsyWOliN+aU9B4JX01xK9eJXowJLw==", + "version": "8.2.1", + "resolved": "https://registry.npm.taobao.org/babel-loader/download/babel-loader-8.2.1.tgz?cache=0&sync_timestamp=1605043148864&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fbabel-loader%2Fdownload%2Fbabel-loader-8.2.1.tgz", + "integrity": "sha1-5TMTJUZ36G8nU29QcdgH4B0k7AA=", "dev": true, "requires": { "find-cache-dir": "^2.1.0", "loader-utils": "^1.4.0", - "mkdirp": "^0.5.3", + "make-dir": "^2.1.0", "pify": "^4.0.1", "schema-utils": "^2.6.5" }, "dependencies": { + "make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npm.taobao.org/make-dir/download/make-dir-2.1.0.tgz", + "integrity": "sha1-XwMQ4YuL6JjMBwCSlaMK5B6R5vU=", + "dev": true, + "requires": { + "pify": "^4.0.1", + "semver": "^5.6.0" + } + }, "pify": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "resolved": "https://registry.npm.taobao.org/pify/download/pify-4.0.1.tgz", + "integrity": "sha1-SyzSXFDVmHNcUCkiJP2MbfQeMjE=", + "dev": true + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npm.taobao.org/semver/download/semver-5.7.1.tgz", + "integrity": "sha1-qVT5Ma66UI0we78Gnv8MAclhFvc=", "dev": true } } @@ -5950,9 +5966,9 @@ "dev": true }, "copy-webpack-plugin": { - "version": "6.3.0", - "resolved": "https://registry.npm.taobao.org/copy-webpack-plugin/download/copy-webpack-plugin-6.3.0.tgz?cache=0&sync_timestamp=1604418450281&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcopy-webpack-plugin%2Fdownload%2Fcopy-webpack-plugin-6.3.0.tgz", - "integrity": "sha1-kYILY7vefXNgmsy4bat+c4aGP28=", + "version": "6.3.1", + "resolved": "https://registry.npm.taobao.org/copy-webpack-plugin/download/copy-webpack-plugin-6.3.1.tgz", + "integrity": "sha1-zrbpw+SRDmOndP1KJ0URVndfbio=", "dev": true, "requires": { "cacache": "^15.0.5", @@ -5970,7 +5986,7 @@ "dependencies": { "ajv": { "version": "6.12.6", - "resolved": "https://registry.npm.taobao.org/ajv/download/ajv-6.12.6.tgz?cache=0&sync_timestamp=1602353715225&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fajv%2Fdownload%2Fajv-6.12.6.tgz", + "resolved": "https://registry.npm.taobao.org/ajv/download/ajv-6.12.6.tgz?cache=0&sync_timestamp=1604996837320&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fajv%2Fdownload%2Fajv-6.12.6.tgz", "integrity": "sha1-uvWmLoArB9l3A0WG+MO69a3ybfQ=", "dev": true, "requires": { @@ -5982,7 +5998,7 @@ }, "ajv-keywords": { "version": "3.5.2", - "resolved": "https://registry.npm.taobao.org/ajv-keywords/download/ajv-keywords-3.5.2.tgz?cache=0&sync_timestamp=1595908717940&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fajv-keywords%2Fdownload%2Fajv-keywords-3.5.2.tgz", + "resolved": "https://registry.npm.taobao.org/ajv-keywords/download/ajv-keywords-3.5.2.tgz?cache=0&sync_timestamp=1604565113393&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fajv-keywords%2Fdownload%2Fajv-keywords-3.5.2.tgz", "integrity": "sha1-MfKdpatuANHC0yms97WSlhTVAU0=", "dev": true }, @@ -6087,7 +6103,7 @@ }, "pkg-dir": { "version": "4.2.0", - "resolved": "https://registry.npm.taobao.org/pkg-dir/download/pkg-dir-4.2.0.tgz", + "resolved": "https://registry.npm.taobao.org/pkg-dir/download/pkg-dir-4.2.0.tgz?cache=0&sync_timestamp=1602859045787&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fpkg-dir%2Fdownload%2Fpkg-dir-4.2.0.tgz", "integrity": "sha1-8JkTPfft5CLoHR2ESCcO6z5CYfM=", "dev": true, "requires": { @@ -7900,18 +7916,18 @@ } }, "eslint-plugin-html": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-html/-/eslint-plugin-html-6.1.0.tgz", - "integrity": "sha512-xcqithhnjUxoEDRL0hYci4RSS8EZ1NGr3/H8x3BxJvxgbu4R3YaEUea9i93j95NuAgoAbOUfNmybta8fqi4UbA==", + "version": "6.1.1", + "resolved": "https://registry.npm.taobao.org/eslint-plugin-html/download/eslint-plugin-html-6.1.1.tgz?cache=0&sync_timestamp=1605104716026&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Feslint-plugin-html%2Fdownload%2Feslint-plugin-html-6.1.1.tgz", + "integrity": "sha1-la7hUZALm7LaX6AXtFzGRFagp04=", "dev": true, "requires": { - "htmlparser2": "^4.1.0" + "htmlparser2": "^5.0.1" }, "dependencies": { "dom-serializer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.0.1.tgz", - "integrity": "sha512-1Aj1Qy3YLbdslkI75QEOfdp9TkQ3o8LRISAzxOibjBs/xWwr1WxZFOQphFkZuepHFGo+kB8e5FVJSS0faAJ4Rw==", + "version": "1.1.0", + "resolved": "https://registry.npm.taobao.org/dom-serializer/download/dom-serializer-1.1.0.tgz", + "integrity": "sha1-X3yCjxv8RIh9wqMVq1xFaR1US1g=", "dev": true, "requires": { "domelementtype": "^2.0.1", @@ -7920,46 +7936,46 @@ } }, "domelementtype": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.0.1.tgz", - "integrity": "sha512-5HOHUDsYZWV8FGWN0Njbr/Rn7f/eWSQi1v7+HsUVwXgn8nWWlL64zKDkS0n8ZmQ3mlWOMuXOnR+7Nx/5tMO5AQ==", + "version": "2.0.2", + "resolved": "https://registry.npm.taobao.org/domelementtype/download/domelementtype-2.0.2.tgz?cache=0&sync_timestamp=1600028495728&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdomelementtype%2Fdownload%2Fdomelementtype-2.0.2.tgz", + "integrity": "sha1-87blSSAeRvWItZRj3XcYcTH+aXE=", "dev": true }, "domhandler": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-3.0.0.tgz", - "integrity": "sha512-eKLdI5v9m67kbXQbJSNn1zjh0SDzvzWVWtX+qEI3eMjZw8daH9k8rlj1FZY9memPwjiskQFbe7vHVVJIAqoEhw==", + "version": "3.3.0", + "resolved": "https://registry.npm.taobao.org/domhandler/download/domhandler-3.3.0.tgz", + "integrity": "sha1-bbfqRuRhfrFc+HXfaLK4UkzgA3o=", "dev": true, "requires": { "domelementtype": "^2.0.1" } }, "domutils": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.2.0.tgz", - "integrity": "sha512-0haAxVr1PR0SqYwCH7mxMpHZUwjih9oPPedqpR/KufsnxPyZ9dyVw1R5093qnJF3WXSbjBkdzRWLw/knJV/fAg==", + "version": "2.4.2", + "resolved": "https://registry.npm.taobao.org/domutils/download/domutils-2.4.2.tgz", + "integrity": "sha1-fuW+JhlE4a1IfZqgYWcgAQEjkis=", "dev": true, "requires": { "dom-serializer": "^1.0.1", "domelementtype": "^2.0.1", - "domhandler": "^3.0.0" + "domhandler": "^3.3.0" } }, "entities": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/entities/-/entities-2.0.3.tgz", - "integrity": "sha512-MyoZ0jgnLvB2X3Lg5HqpFmn1kybDiIfEQmKzTb5apr51Rb+T3KdmMiqa70T+bhGnyv7bQ6WMj2QMHpGMmlrUYQ==", + "version": "2.1.0", + "resolved": "https://registry.npm.taobao.org/entities/download/entities-2.1.0.tgz?cache=0&sync_timestamp=1602897029273&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fentities%2Fdownload%2Fentities-2.1.0.tgz", + "integrity": "sha1-mS0xKc999ocLlsV4WMJJoSD4uLU=", "dev": true }, "htmlparser2": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-4.1.0.tgz", - "integrity": "sha512-4zDq1a1zhE4gQso/c5LP1OtrhYTncXNSpvJYtWJBtXAETPlMfi3IFNjGuQbYLuVY4ZR0QMqRVvo4Pdy9KLyP8Q==", + "version": "5.0.1", + "resolved": "https://registry.npm.taobao.org/htmlparser2/download/htmlparser2-5.0.1.tgz?cache=0&sync_timestamp=1603668161350&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fhtmlparser2%2Fdownload%2Fhtmlparser2-5.0.1.tgz", + "integrity": "sha1-fapvw+NdYQeslaT8CHgfCRZk9uc=", "dev": true, "requires": { "domelementtype": "^2.0.1", - "domhandler": "^3.0.0", - "domutils": "^2.0.0", + "domhandler": "^3.3.0", + "domutils": "^2.4.2", "entities": "^2.0.0" } } @@ -8060,9 +8076,9 @@ "dev": true }, "eslint-plugin-standard": { - "version": "4.0.2", - "resolved": "https://registry.npm.taobao.org/eslint-plugin-standard/download/eslint-plugin-standard-4.0.2.tgz?cache=0&sync_timestamp=1603323739415&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Feslint-plugin-standard%2Fdownload%2Feslint-plugin-standard-4.0.2.tgz", - "integrity": "sha1-AhIRqfB35jpoR+e7mrQkcyesjgw=", + "version": "4.1.0", + "resolved": "https://registry.npm.taobao.org/eslint-plugin-standard/download/eslint-plugin-standard-4.1.0.tgz?cache=0&sync_timestamp=1604979354814&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Feslint-plugin-standard%2Fdownload%2Feslint-plugin-standard-4.1.0.tgz", + "integrity": "sha1-DDvzpn6FP4u7xYD7SUX78W9Bt8U=", "dev": true }, "eslint-scope": { @@ -11170,9 +11186,9 @@ } }, "less-loader": { - "version": "7.0.2", - "resolved": "https://registry.npm.taobao.org/less-loader/download/less-loader-7.0.2.tgz?cache=0&sync_timestamp=1602250118610&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fless-loader%2Fdownload%2Fless-loader-7.0.2.tgz", - "integrity": "sha1-DXOknsMqnT/xJhRZjm4rR/sqNcQ=", + "version": "7.1.0", + "resolved": "https://registry.npm.taobao.org/less-loader/download/less-loader-7.1.0.tgz", + "integrity": "sha1-lY1B6G194Ly0kHEe4PI1qp3Flqo=", "dev": true, "requires": { "klona": "^2.0.4", @@ -11182,7 +11198,7 @@ "dependencies": { "ajv": { "version": "6.12.6", - "resolved": "https://registry.npm.taobao.org/ajv/download/ajv-6.12.6.tgz?cache=0&sync_timestamp=1602353715225&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fajv%2Fdownload%2Fajv-6.12.6.tgz", + "resolved": "https://registry.npm.taobao.org/ajv/download/ajv-6.12.6.tgz?cache=0&sync_timestamp=1604996837320&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fajv%2Fdownload%2Fajv-6.12.6.tgz", "integrity": "sha1-uvWmLoArB9l3A0WG+MO69a3ybfQ=", "dev": true, "requires": { @@ -11194,7 +11210,7 @@ }, "ajv-keywords": { "version": "3.5.2", - "resolved": "https://registry.npm.taobao.org/ajv-keywords/download/ajv-keywords-3.5.2.tgz?cache=0&sync_timestamp=1595908717940&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fajv-keywords%2Fdownload%2Fajv-keywords-3.5.2.tgz", + "resolved": "https://registry.npm.taobao.org/ajv-keywords/download/ajv-keywords-3.5.2.tgz?cache=0&sync_timestamp=1604565113393&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fajv-keywords%2Fdownload%2Fajv-keywords-3.5.2.tgz", "integrity": "sha1-MfKdpatuANHC0yms97WSlhTVAU0=", "dev": true }, @@ -15546,9 +15562,9 @@ } }, "stylus-loader": { - "version": "4.2.0", - "resolved": "https://registry.npm.taobao.org/stylus-loader/download/stylus-loader-4.2.0.tgz?cache=0&sync_timestamp=1603977404318&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fstylus-loader%2Fdownload%2Fstylus-loader-4.2.0.tgz", - "integrity": "sha1-7EzzQIpS0H5tPBX/4aDlwkhLrMc=", + "version": "4.3.0", + "resolved": "https://registry.npm.taobao.org/stylus-loader/download/stylus-loader-4.3.0.tgz", + "integrity": "sha1-1Lq1pNlX9LH1Z74QgYX/I74hatQ=", "dev": true, "requires": { "fast-glob": "^3.2.4", @@ -15560,7 +15576,7 @@ "dependencies": { "ajv": { "version": "6.12.6", - "resolved": "https://registry.npm.taobao.org/ajv/download/ajv-6.12.6.tgz?cache=0&sync_timestamp=1602353715225&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fajv%2Fdownload%2Fajv-6.12.6.tgz", + "resolved": "https://registry.npm.taobao.org/ajv/download/ajv-6.12.6.tgz?cache=0&sync_timestamp=1604996837320&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fajv%2Fdownload%2Fajv-6.12.6.tgz", "integrity": "sha1-uvWmLoArB9l3A0WG+MO69a3ybfQ=", "dev": true, "requires": { @@ -15572,7 +15588,7 @@ }, "ajv-keywords": { "version": "3.5.2", - "resolved": "https://registry.npm.taobao.org/ajv-keywords/download/ajv-keywords-3.5.2.tgz?cache=0&sync_timestamp=1595908717940&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fajv-keywords%2Fdownload%2Fajv-keywords-3.5.2.tgz", + "resolved": "https://registry.npm.taobao.org/ajv-keywords/download/ajv-keywords-3.5.2.tgz?cache=0&sync_timestamp=1604565113393&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fajv-keywords%2Fdownload%2Fajv-keywords-3.5.2.tgz", "integrity": "sha1-MfKdpatuANHC0yms97WSlhTVAU0=", "dev": true }, @@ -17596,9 +17612,9 @@ } }, "webpack-merge": { - "version": "5.3.0", - "resolved": "https://registry.npm.taobao.org/webpack-merge/download/webpack-merge-5.3.0.tgz", - "integrity": "sha1-qA30TTX6us5oC/QwoZ/ansSe2Os=", + "version": "5.4.0", + "resolved": "https://registry.npm.taobao.org/webpack-merge/download/webpack-merge-5.4.0.tgz?cache=0&sync_timestamp=1605175039097&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fwebpack-merge%2Fdownload%2Fwebpack-merge-5.4.0.tgz", + "integrity": "sha1-gb7wp9I/webCSwati/It3rUzo6M=", "dev": true, "requires": { "clone-deep": "^4.0.1", diff --git a/package.json b/package.json index 757f32f55d..fa141392b3 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "lint:fix": "eslint --ext .js,.vue -f ./node_modules/eslint-formatter-friendly --fix src" }, "browserslist": [ - "Electron 10.1.3" + "Electron 9.3.4" ], "engines": { "node": ">= 12" @@ -165,13 +165,13 @@ "@babel/polyfill": "^7.12.1", "@babel/preset-env": "^7.12.1", "babel-eslint": "^10.1.0", - "babel-loader": "^8.1.0", + "babel-loader": "^8.2.1", "babel-minify-webpack-plugin": "^0.3.1", "babel-preset-minify": "^0.5.1", "cfonts": "^2.8.6", "chalk": "^4.1.0", "changelog-parser": "^2.8.0", - "copy-webpack-plugin": "^6.3.0", + "copy-webpack-plugin": "^6.3.1", "core-js": "^3.7.0", "cross-env": "^7.0.2", "css-loader": "^4.3.0", @@ -184,16 +184,16 @@ "eslint-config-standard": "^14.1.1", "eslint-formatter-friendly": "^7.0.0", "eslint-loader": "^4.0.2", - "eslint-plugin-html": "^6.1.0", + "eslint-plugin-html": "^6.1.1", "eslint-plugin-import": "^2.22.1", "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^4.2.1", - "eslint-plugin-standard": "^4.0.2", + "eslint-plugin-standard": "^4.1.0", "file-loader": "^6.2.0", "friendly-errors-webpack-plugin": "^1.7.0", "html-webpack-plugin": "^4.5.0", "less": "^3.12.2", - "less-loader": "^7.0.2", + "less-loader": "^7.1.0", "markdown-it": "^12.0.2", "mini-css-extract-plugin": "^0.12.0", "optimize-css-assets-webpack-plugin": "^5.0.4", @@ -206,7 +206,7 @@ "rimraf": "^3.0.2", "spinnies": "^0.5.1", "stylus": "^0.54.8", - "stylus-loader": "^4.2.0", + "stylus-loader": "^4.3.0", "terser-webpack-plugin": "^4.2.3", "url-loader": "^4.1.1", "vue-loader": "^15.9.5", @@ -215,7 +215,7 @@ "webpack-cli": "^3.3.12", "webpack-dev-server": "^3.11.0", "webpack-hot-middleware": "^2.25.0", - "webpack-merge": "^5.3.0" + "webpack-merge": "^5.4.0" }, "dependencies": { "crypto-js": "^4.0.0", From b00de4d976e287b6c1627083838ae853d552b2fd Mon Sep 17 00:00:00 2001 From: lyswhut Date: Sat, 14 Nov 2020 22:29:27 +0800 Subject: [PATCH 09/14] =?UTF-8?q?=E6=89=98=E7=9B=98=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=98=BE=E7=A4=BA=E3=80=81=E9=9A=90=E8=97=8F?= =?UTF-8?q?=E4=B8=BB=E7=95=8C=E9=9D=A2=E9=80=89=E9=A1=B9=EF=BC=8C=E4=B8=BA?= =?UTF-8?q?Linux=E3=80=81MAC=E7=89=88=E6=B7=BB=E5=8A=A0=E6=89=98=E7=9B=98?= =?UTF-8?q?=E8=8F=9C=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- publish/changeLog.md | 4 ++++ src/main/events/MainWindow.js | 12 ++++++++++++ src/main/events/_name.js | 3 +++ src/main/modules/tray.js | 30 +++++++++++++++++++++++++++-- src/main/rendererEvents/winEvent.js | 8 ++++++++ 5 files changed, 55 insertions(+), 2 deletions(-) diff --git a/publish/changeLog.md b/publish/changeLog.md index 8f20c3c492..cf015e857b 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -1,3 +1,7 @@ +### 新增 + +- 托盘菜单新增显示、隐藏主界面选项,为Linux、MAC版添加托盘菜单 + ### 优化 - 移除kg源的歌词文件开头的空白字符串 diff --git a/src/main/events/MainWindow.js b/src/main/events/MainWindow.js index ec6855ba61..59b228a037 100644 --- a/src/main/events/MainWindow.js +++ b/src/main/events/MainWindow.js @@ -17,6 +17,18 @@ class MainWindow extends EventEmitter { toggleHide() { this.emit(MAIN_WINDOW_EVENT_NAME.toggle_hide) } + + readyToShow() { + this.emit(MAIN_WINDOW_EVENT_NAME.ready_to_show) + } + + show() { + this.emit(MAIN_WINDOW_EVENT_NAME.show) + } + + hide() { + this.emit(MAIN_WINDOW_EVENT_NAME.hide) + } } module.exports = MainWindow diff --git a/src/main/events/_name.js b/src/main/events/_name.js index 4eb8650f87..251ba7bb7a 100644 --- a/src/main/events/_name.js +++ b/src/main/events/_name.js @@ -10,6 +10,9 @@ exports.mainWindow = { quit: 'quit', toggle_minimize: 'toggle_minimize', toggle_hide: 'toggle_hide', + ready_to_show: 'ready_to_show', + show: 'show', + hide: 'hide', } exports.tray = { diff --git a/src/main/modules/tray.js b/src/main/modules/tray.js index 88cc70e62a..5857999022 100644 --- a/src/main/modules/tray.js +++ b/src/main/modules/tray.js @@ -1,6 +1,6 @@ const { app, Tray, Menu } = require('electron') const { isWin } = require('../../common/utils') -const { tray: TRAY_EVENT_NAME, common: COMMON_EVENT_NAME } = require('../events/_name') +const { tray: TRAY_EVENT_NAME, common: COMMON_EVENT_NAME, mainWindow: MAIN_WINDOW_NAME } = require('../events/_name') const path = require('path') let isEnableTray = null let themeId = null @@ -29,6 +29,16 @@ global.lx_event.common.on(COMMON_EVENT_NAME.config, sourceName => { createMenu(global.modules.tray) }) +global.lx_event.mainWindow.on(MAIN_WINDOW_NAME.ready_to_show, () => { + createMenu(global.modules.tray) +}) +global.lx_event.mainWindow.on(MAIN_WINDOW_NAME.show, () => { + createMenu(global.modules.tray) +}) +global.lx_event.mainWindow.on(MAIN_WINDOW_NAME.hide, () => { + createMenu(global.modules.tray) +}) + const createTray = () => { if ((global.modules.tray && !global.modules.tray.isDestroyed()) || !global.appSetting.tray || !global.appSetting.tray.isShow) return @@ -58,8 +68,24 @@ const destroyTray = () => { } const createMenu = tray => { - if (!global.modules.tray || !isWin) return + if (!global.modules.tray) return let menu = [] + global.modules.mainWindow && menu.push(global.modules.mainWindow.isVisible() ? { + label: '隐藏主界面', + click() { + global.modules.mainWindow.hide() + }, + } : { + label: '显示主界面', + click() { + if (!global.modules.mainWindow) return + if (!global.modules.mainWindow.isVisible()) { + global.modules.mainWindow.show() + } + global.modules.mainWindow.restore() + global.modules.mainWindow.focus() + }, + }) menu.push(global.appSetting.desktopLyric.enable ? { label: '关闭桌面歌词', click() { diff --git a/src/main/rendererEvents/winEvent.js b/src/main/rendererEvents/winEvent.js index 766a94381c..6d797ec911 100644 --- a/src/main/rendererEvents/winEvent.js +++ b/src/main/rendererEvents/winEvent.js @@ -29,5 +29,13 @@ module.exports = mainWindow => { mainWindow.once('ready-to-show', () => { mainWindow.show() + global.lx_event.mainWindow.readyToShow() + }) + + mainWindow.on('show', () => { + global.lx_event.mainWindow.show() + }) + mainWindow.on('hide', () => { + global.lx_event.mainWindow.hide() }) } From 4db560fb4be64580afd664e4d23f468931a0499d Mon Sep 17 00:00:00 2001 From: lyswhut Date: Sun, 15 Nov 2020 14:08:11 +0800 Subject: [PATCH 10/14] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E5=8D=95=E9=A6=96=E6=AD=8C=E6=9B=B2=E6=97=B6=E5=87=BA=E7=8E=B0?= =?UTF-8?q?=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 | 1 + src/renderer/store/modules/list.js | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/publish/changeLog.md b/publish/changeLog.md index cf015e857b..479fe23726 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -10,3 +10,4 @@ - 修复专辑图片无法嵌入的问题 - 修复播放状态栏切换“上一首”歌曲按钮提示错误的问题 +- 修复移动单首歌曲时,如果目标列表存在该歌曲,会导致将源列表与目标列表里的目标歌曲移除 diff --git a/src/renderer/store/modules/list.js b/src/renderer/store/modules/list.js index e46f27823f..eb9e51cf07 100644 --- a/src/renderer/store/modules/list.js +++ b/src/renderer/store/modules/list.js @@ -92,8 +92,7 @@ const mutations = { if (!fromList || !toList) return fromList.list.splice(fromList.list.indexOf(musicInfo), 1) let index = toList.list.findIndex(s => s.songmid === musicInfo.songmid) - if (index > -1) return toList.list.splice(index, 1) - toList.list.push(musicInfo) + if (index < 0) toList.list.push(musicInfo) }, listAddMultiple(state, { id, list }) { let targetList = allList[id] @@ -110,7 +109,7 @@ const mutations = { }, // { fromId, toId, list } listMoveMultiple(state, { fromId, toId, list }) { - console.log(state.commit) + // console.log(state.commit) this.commit('list/listRemoveMultiple', { id: fromId, list }) this.commit('list/listAddMultiple', { id: toId, list }) }, From b3e3860b238b5d03f577b5734709ca8bc6f2319a Mon Sep 17 00:00:00 2001 From: lyswhut Date: Tue, 17 Nov 2020 17:14:47 +0800 Subject: [PATCH 11/14] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dkg=E6=BA=90=E6=AD=8C?= =?UTF-8?q?=E6=9B=B2=E4=BF=A1=E6=81=AF=E5=B8=A6=E6=9C=89=E5=8D=95=E5=BC=95?= =?UTF-8?q?=E5=8F=B7=E7=AD=89=E7=89=B9=E6=AE=8A=E5=AD=97=E7=AC=A6=E8=A2=AB?= =?UTF-8?q?=E8=BD=AC=E4=B9=89=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 | 1 + src/renderer/utils/index.js | 3 ++- src/renderer/utils/music/kg/comment.js | 6 +++--- src/renderer/utils/music/kg/hotSearch.js | 3 ++- src/renderer/utils/music/kg/leaderboard.js | 8 ++++---- src/renderer/utils/music/kg/lyric.js | 3 +++ src/renderer/utils/music/kg/musicSearch.js | 8 ++++---- src/renderer/utils/music/kg/songList.js | 14 +++++++------- 8 files changed, 26 insertions(+), 20 deletions(-) diff --git a/publish/changeLog.md b/publish/changeLog.md index 479fe23726..e44e90ecbe 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -11,3 +11,4 @@ - 修复专辑图片无法嵌入的问题 - 修复播放状态栏切换“上一首”歌曲按钮提示错误的问题 - 修复移动单首歌曲时,如果目标列表存在该歌曲,会导致将源列表与目标列表里的目标歌曲移除 +- 修复kg源歌曲信息带有单引号等特殊字符被转义的问题 diff --git a/src/renderer/utils/index.js b/src/renderer/utils/index.js index 093247747a..6c8b6adb25 100644 --- a/src/renderer/utils/index.js +++ b/src/renderer/utils/index.js @@ -78,8 +78,9 @@ const encodeNames = { '>': '>', '"': '"', ''': "'", + ''': "'", } -export const decodeName = str => str.replace(/(?:&|<|>|"|')/g, s => encodeNames[s]) +export const decodeName = str => str.replace(/(?:&|<|>|"|'|')/gm, s => encodeNames[s]) const easeInOutQuad = (t, b, c, d) => { t /= d / 2 diff --git a/src/renderer/utils/music/kg/comment.js b/src/renderer/utils/music/kg/comment.js index 71515fc1f9..6cb6fd528f 100644 --- a/src/renderer/utils/music/kg/comment.js +++ b/src/renderer/utils/music/kg/comment.js @@ -1,5 +1,5 @@ import { httpFetch } from '../../request' -import { dateFormat2 } from '../../' +import { decodeName, dateFormat2 } from '../../' export default { _requestObj: null, @@ -48,7 +48,7 @@ export default { return rawList.map(item => { let data = { id: item.id, - text: item.content.split('\n'), + text: decodeName(item.content || '').split('\n'), time: item.addtime, timeStr: dateFormat2(new Date(item.addtime).getTime()), userName: item.user_name, @@ -61,7 +61,7 @@ export default { return item.pcontent ? { id: item.id, - text: item.pcontent.split('\n'), + text: decodeName(item.pcontent).split('\n'), time: null, userName: item.puser, avatar: null, diff --git a/src/renderer/utils/music/kg/hotSearch.js b/src/renderer/utils/music/kg/hotSearch.js index 2cafe5b173..4e0e24439c 100644 --- a/src/renderer/utils/music/kg/hotSearch.js +++ b/src/renderer/utils/music/kg/hotSearch.js @@ -1,4 +1,5 @@ import { httpFetch } from '../../request' +import { decodeName } from '../..' export default { _requestObj: null, @@ -25,7 +26,7 @@ export default { filterList(rawList) { const list = [] rawList.forEach(item => { - item.keywords.map(k => list.push(k.keyword)) + item.keywords.map(k => list.push(decodeName(k.keyword))) }) return list }, diff --git a/src/renderer/utils/music/kg/leaderboard.js b/src/renderer/utils/music/kg/leaderboard.js index da250ef9ad..c5c347416f 100644 --- a/src/renderer/utils/music/kg/leaderboard.js +++ b/src/renderer/utils/music/kg/leaderboard.js @@ -1,5 +1,5 @@ import { httpGet, cancelHttp, httpFetch } from '../../request' -import { formatPlayTime, sizeFormate } from '../../index' +import { decodeName, formatPlayTime, sizeFormate } from '../../index' let boardList = [{ id: 'kg__8888', name: '酷狗TOP500', bangid: '8888' }, { id: 'kg__6666', name: '酷狗飙升榜', bangid: '6666' }, { id: 'kg__37361', name: '酷狗雷达榜', bangid: '37361' }, { id: 'kg__23784', name: '网络红歌榜', bangid: '23784' }, { id: 'kg__24971', name: 'DJ热歌榜', bangid: '24971' }, { id: 'kg__35811', name: '会员专享热歌榜', bangid: '35811' }, { id: 'kg__31308', name: '华语新歌榜', bangid: '31308' }, { id: 'kg__31310', name: '欧美新歌榜', bangid: '31310' }, { id: 'kg__31311', name: '韩国新歌榜', bangid: '31311' }, { id: 'kg__31312', name: '日本新歌榜', bangid: '31312' }, { id: 'kg__31313', name: '粤语新歌榜', bangid: '31313' }, { id: 'kg__33162', name: 'ACG新歌榜', bangid: '33162' }, { id: 'kg__21101', name: '酷狗分享榜', bangid: '21101' }, { id: 'kg__30972', name: '腾讯音乐人原创榜', bangid: '30972' }, { id: 'kg__22603', name: '5sing音乐榜', bangid: '22603' }, { id: 'kg__33160', name: '电音热歌榜', bangid: '33160' }, { id: 'kg__21335', name: '繁星音乐榜', bangid: '21335' }, { id: 'kg__33161', name: '古风新歌榜', bangid: '33161' }, { id: 'kg__33163', name: '影视金曲榜', bangid: '33163' }, { id: 'kg__33166', name: '欧美金曲榜', bangid: '33166' }, { id: 'kg__33165', name: '粤语金曲榜', bangid: '33165' }, { id: 'kg__36107', name: '小语种热歌榜', bangid: '36107' }, { id: 'kg__4681', name: '美国BillBoard榜', bangid: '4681' }, { id: 'kg__4680', name: '英国单曲榜', bangid: '4680' }, { id: 'kg__4673', name: '日本公信榜', bangid: '4673' }, { id: 'kg__38623', name: '韩国Melon音乐榜', bangid: '38623' }, { id: 'kg__42807', name: 'joox本地热歌榜', bangid: '42807' }, { id: 'kg__42808', name: '台湾KKBOX风云榜', bangid: '42808' }] @@ -134,9 +134,9 @@ export default { } } return { - singer: item.singername, - name: item.songname, - albumName: item.album_name, + singer: decodeName(item.singername), + name: decodeName(item.songname), + albumName: decodeName(item.album_name), albumId: item.album_id, songmid: item.audio_id, source: 'kg', diff --git a/src/renderer/utils/music/kg/lyric.js b/src/renderer/utils/music/kg/lyric.js index d0f4f903a2..1e6bc9c366 100644 --- a/src/renderer/utils/music/kg/lyric.js +++ b/src/renderer/utils/music/kg/lyric.js @@ -1,5 +1,6 @@ import { httpFetch } from '../../request' import { decodeLyric } from './util' +import { decodeName } from '../..' const parseLyric = str => { str = str.replace(/(?:<\d+,\d+,\d+>|\r)/g, '') @@ -30,6 +31,8 @@ const parseLyric = str => { return str.replace(result[1], time) }) tlyric = tlyric ? tlyric.join('\n') : '' + lyric = decodeName(lyric) + tlyric = decodeName(tlyric) return { lyric, tlyric, diff --git a/src/renderer/utils/music/kg/musicSearch.js b/src/renderer/utils/music/kg/musicSearch.js index 62f8b61a53..98aeeddb98 100644 --- a/src/renderer/utils/music/kg/musicSearch.js +++ b/src/renderer/utils/music/kg/musicSearch.js @@ -1,7 +1,7 @@ // import '../../polyfill/array.find' // import jshtmlencode from 'js-htmlencode' import { httpFetch } from '../../request' -import { formatPlayTime, sizeFormate } from '../../index' +import { decodeName, formatPlayTime, sizeFormate } from '../../index' // import { debug } from '../../utils/env' // import { formatSinger } from './util' @@ -50,9 +50,9 @@ export default { } } list.push({ - singer: item.singername, - name: item.songname, - albumName: item.album_name, + singer: decodeName(item.singername), + name: decodeName(item.songname), + albumName: decodeName(item.album_name), albumId: item.album_id, songmid: item.audio_id, source: 'kg', diff --git a/src/renderer/utils/music/kg/songList.js b/src/renderer/utils/music/kg/songList.js index 3c17f9e659..f1fc7afee1 100644 --- a/src/renderer/utils/music/kg/songList.js +++ b/src/renderer/utils/music/kg/songList.js @@ -1,5 +1,5 @@ import { httpFetch } from '../../request' -import { formatPlayTime, sizeFormate } from '../../index' +import { decodeName, formatPlayTime, sizeFormate } from '../../index' import { toMD5 } from '../utils' export default { @@ -454,9 +454,9 @@ export default { } } return { - singer: item.singername, - name: item.songname, - albumName: item.album_name, + singer: decodeName(item.singername), + name: decodeName(item.songname), + albumName: decodeName(item.album_name), albumId: item.album_id, songmid: item.audio_id, source: 'kg', @@ -507,9 +507,9 @@ export default { } } list.push({ - singer: item.author_name, - name: item.ori_audio_name, - albumName: item.album_info.album_name, + singer: decodeName(item.author_name), + name: decodeName(item.ori_audio_name), + albumName: decodeName(item.album_info.album_name), albumId: item.album_info.album_id, songmid: item.audio_info.audio_id, source: 'kg', From 64a53830e4d51da5f002703708ad3bc3edc54863 Mon Sep 17 00:00:00 2001 From: lyswhut Date: Thu, 19 Nov 2020 15:52:00 +0800 Subject: [PATCH 12/14] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=92=AD=E6=94=BE?= =?UTF-8?q?=E8=BF=9B=E5=BA=A6=E4=BF=A1=E6=81=AF=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- publish/changeLog.md | 1 + src/renderer/App.vue | 25 +++++++++++++++ src/renderer/components/core/Player.vue | 41 +++++++++++++++++++------ 3 files changed, 57 insertions(+), 10 deletions(-) diff --git a/publish/changeLog.md b/publish/changeLog.md index e44e90ecbe..f744f59367 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -1,6 +1,7 @@ ### 新增 - 托盘菜单新增显示、隐藏主界面选项,为Linux、MAC版添加托盘菜单 +- 新增播放进度信息保存 ### 优化 diff --git a/src/renderer/App.vue b/src/renderer/App.vue index 1495154160..01ccc8b38f 100644 --- a/src/renderer/App.vue +++ b/src/renderer/App.vue @@ -174,6 +174,9 @@ export default { ...mapMutations('search', { setSearchHistoryList: 'setHistory', }), + ...mapMutations('player', { + setPlayList: 'setList', + }), init() { document.documentElement.style.fontSize = this.windowSizeActive.fontSize @@ -276,6 +279,7 @@ export default { if (!loveList.list) loveList.list = [] this.initList({ defaultList, loveList, userList }) this.initDownloadList(downloadList) // 初始化下载列表 + this.initPlayInfo() }) }, initDownloadList(downloadList) { @@ -299,6 +303,27 @@ export default { } }) }, + initPlayInfo() { + rendererInvoke(NAMES.mainWindow.get_data, 'playInfo').then(info => { + // console.log(info, window.allList) + if (!info) return + if (info.listId) { + const list = window.allList[info.listId] + // console.log(list) + if (!list) return + info.list = list.list + } + + window.restorePlayInfo = info + this.setPlayList({ + list: { + list: info.list, + id: info.listId, + }, + index: info.index, + }) + }) + }, showUpdateModal() { (this.version.newVersion && this.version.newVersion.history ? Promise.resolve(this.version.newVersion) diff --git a/src/renderer/components/core/Player.vue b/src/renderer/components/core/Player.vue index 8a4b5fbc1d..b86e92d9c7 100644 --- a/src/renderer/components/core/Player.vue +++ b/src/renderer/components/core/Player.vue @@ -87,7 +87,7 @@ div(:class="$style.player")