From 8b59a72506f00af5d5764f86769a8465acad477a Mon Sep 17 00:00:00 2001 From: qier222 Date: Sat, 25 Sep 2021 23:54:48 +0800 Subject: [PATCH 01/30] chore: update package.json & build.yaml --- .github/workflows/build.yaml | 9 ++++----- package.json | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 1c2d2fd..8d40bbe 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,12 +1,11 @@ -name: Build / Release +name: Release on: push: branches: - - 'master' - pull_request: - branches: - - '!deploy' + - master + tags: + - v* jobs: release: diff --git a/package.json b/package.json index 2acb247..5edf246 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "yesplaymusic", - "version": "0.4.0", + "version": "0.4.1", "private": true, "description": "A third party music player for Netease Music", "author": "hawtim", From de818282c811c5564dc16f0258b96183dbcaf47b Mon Sep 17 00:00:00 2001 From: memorydream <34763046+memorydream@users.noreply.github.com> Date: Tue, 28 Sep 2021 19:05:34 +0800 Subject: [PATCH 02/30] =?UTF-8?q?fix:=20=E5=A2=9E=E5=BC=BA=E5=B9=B6?= =?UTF-8?q?=E6=98=8E=E7=A1=AE=E5=85=B3=E9=97=ADapp=E7=9A=84=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E8=A1=8C=E4=B8=BA=20(#938)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 分离close和minimize按钮行为 * bug fix --- src/background.js | 37 ++++++++++------------ src/electron/ipcMain.js | 63 +++++++++++++++++++++++++++++-------- src/electron/ipcRenderer.js | 7 +++++ src/locale/lang/en.js | 1 - src/locale/lang/tr.js | 1 - src/locale/lang/zh-CN.js | 1 - src/locale/lang/zh-TW.js | 1 - src/views/settings.vue | 3 -- 8 files changed, 74 insertions(+), 40 deletions(-) diff --git a/src/background.js b/src/background.js index b3c90cb..de03a10 100644 --- a/src/background.js +++ b/src/background.js @@ -206,18 +206,24 @@ class Background { this.window.on('close', e => { log('window close event'); - let closeOpt = this.store.get('settings.closeAppOption'); - if (this.willQuitApp && (closeOpt === 'exit' || closeOpt === 'ask')) { - /* the user tried to quit the app */ - this.window = null; - app.quit(); - } else if (!this.willQuitApp && isMac) { - e.preventDefault(); - this.window.hide(); + + if (isMac) { + if (this.willQuitApp) { + this.window = null; + app.quit(); + } else { + e.preventDefault(); + this.window.hide(); + } } else { - /* the user only tried to close the window */ - e.preventDefault(); - this.window.minimize(); + let closeOpt = this.store.get('settings.closeAppOption'); + if (this.willQuitApp && (closeOpt === 'exit' || closeOpt === 'ask')) { + this.window = null; + app.quit(); + } else { + e.preventDefault(); + this.window.hide(); + } } }); @@ -229,15 +235,6 @@ class Background { this.store.set('window', this.window.getBounds()); }); - this.window.on('minimize', () => { - if ( - !isMac && - this.store.get('settings.closeAppOption') === 'minimizeToTray' - ) { - this.window.hide(); - } - }); - this.window.webContents.on('new-window', function (e, url) { e.preventDefault(); log('open url'); diff --git a/src/electron/ipcMain.js b/src/electron/ipcMain.js index 2a89a95..f053775 100644 --- a/src/electron/ipcMain.js +++ b/src/electron/ipcMain.js @@ -37,22 +37,25 @@ export function initIpcMain(win, store) { }); ipcMain.on('close', e => { - if (process.platform == 'darwin') { + if (process.platform === 'darwin') { win.hide(); exitAsk(e); - return; - } - - let closeOpt = store.get('settings.closeAppOption'); - if (closeOpt === 'exit') { - win = null; - //app.quit(); - app.exit(); //exit()直接关闭客户端,不会执行quit(); - } else if (closeOpt === 'minimize' || closeOpt === 'minimizeToTray') { - e.preventDefault(); //阻止默认行为 - win.minimize(); //调用 最小化实例方法 } else { - exitAsk(e); + let closeOpt = store.get('settings.closeAppOption'); + console.log(closeOpt); + if (closeOpt === 'exit') { + win = null; + //app.quit(); + app.exit(); //exit()直接关闭客户端,不会执行quit(); + } else if (closeOpt === 'minimize') { + e.preventDefault(); //阻止默认行为 + win.minimize(); //调用 最小化实例方法 + } else if (closeOpt === 'minimizeToTray') { + e.preventDefault(); + win.hide(); + } else { + exitAskWithoutMac(e); + } } }); @@ -175,4 +178,38 @@ export function initIpcMain(win, store) { log(err); }); }; + + const exitAskWithoutMac = e => { + e.preventDefault(); //阻止默认行为 + dialog + .showMessageBox({ + type: 'info', + title: 'Information', + cancelId: 2, + defaultId: 0, + message: '确定要关闭吗?', + buttons: ['最小化到托盘', '直接退出'], + checkboxLabel: '记住我的选择', + }) + .then(result => { + if (result.checkboxChecked && result.response !== 2) { + win.webContents.send( + 'rememberCloseAppOption', + result.response === 0 ? 'minimizeToTray' : 'exit' + ); + } + + if (result.response === 0) { + e.preventDefault(); //阻止默认行为 + win.hide(); //调用 最小化实例方法 + } else if (result.response === 1) { + win = null; + //app.quit(); + app.exit(); //exit()直接关闭客户端,不会执行quit(); + } + }) + .catch(err => { + log(err); + }); + }; } diff --git a/src/electron/ipcRenderer.js b/src/electron/ipcRenderer.js index da3ccb5..0222658 100644 --- a/src/electron/ipcRenderer.js +++ b/src/electron/ipcRenderer.js @@ -76,4 +76,11 @@ export function ipcRenderer(vueInstance) { ipcRenderer.on('nextUp', () => { self.$refs.player.goToNextTracksPage(); }); + + ipcRenderer.on('rememberCloseAppOption', (event, value) => { + store.commit('updateSettings', { + key: 'closeAppOption', + value, + }); + }); } diff --git a/src/locale/lang/en.js b/src/locale/lang/en.js index f7e55d2..a97b675 100644 --- a/src/locale/lang/en.js +++ b/src/locale/lang/en.js @@ -165,7 +165,6 @@ export default { text: 'Close App...', ask: 'Ask', exit: 'Exit', - minimize: 'Minimize', minimizeToTray: 'Minimize to tray', }, }, diff --git a/src/locale/lang/tr.js b/src/locale/lang/tr.js index a774b11..f9432bc 100644 --- a/src/locale/lang/tr.js +++ b/src/locale/lang/tr.js @@ -160,7 +160,6 @@ export default { text: 'Close App...', ask: 'Ask', exit: 'Exit', - minimize: 'Minimize', minimizeToTray: 'Küçült', }, }, diff --git a/src/locale/lang/zh-CN.js b/src/locale/lang/zh-CN.js index 2dfaaac..dfcac60 100644 --- a/src/locale/lang/zh-CN.js +++ b/src/locale/lang/zh-CN.js @@ -166,7 +166,6 @@ export default { text: '关闭主面板时...', ask: '询问', exit: '退出', - minimize: '最小化', minimizeToTray: '最小化到托盘', }, }, diff --git a/src/locale/lang/zh-TW.js b/src/locale/lang/zh-TW.js index f506bf7..d195b54 100644 --- a/src/locale/lang/zh-TW.js +++ b/src/locale/lang/zh-TW.js @@ -163,7 +163,6 @@ export default { text: '關閉主面板時...', ask: '詢問', exit: '退出', - minimize: '最小化', minimizeToTray: '最小化到系統列', }, }, diff --git a/src/views/settings.vue b/src/views/settings.vue index eaf6a0b..6f484f5 100644 --- a/src/views/settings.vue +++ b/src/views/settings.vue @@ -295,9 +295,6 @@ - From d424f2cad59548173b5476f2b3253c0834f9012a Mon Sep 17 00:00:00 2001 From: memorydream <34763046+memorydream@users.noreply.github.com> Date: Mon, 11 Oct 2021 10:18:49 +0800 Subject: [PATCH 03/30] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E6=AD=8C?= =?UTF-8?q?=E5=90=8D=E7=BF=BB=E8=AF=91=E7=9A=84=E5=AE=9E=E7=8E=B0=EF=BC=8C?= =?UTF-8?q?=E4=BB=A5=E9=81=BF=E5=85=8D=E5=B1=95=E7=A4=BA=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E7=9A=84=E4=BF=A1=E6=81=AF=20(#958)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * change song translate impl * i18n * 修改个变量名 * bug fix? --- src/components/TrackListItem.vue | 36 ++++++++++++++++++++++---------- src/locale/lang/en.js | 1 + src/locale/lang/tr.js | 1 + src/locale/lang/zh-CN.js | 1 + src/locale/lang/zh-TW.js | 1 + src/store/initLocalStorage.js | 1 + src/views/settings.vue | 29 +++++++++++++++++++++++++ 7 files changed, 59 insertions(+), 11 deletions(-) diff --git a/src/components/TrackListItem.vue b/src/components/TrackListItem.vue index fb572d8..302be50 100644 --- a/src/components/TrackListItem.vue +++ b/src/components/TrackListItem.vue @@ -43,8 +43,8 @@ - - ({{ translate }}) + + ({{ subTitle }})
@@ -124,11 +124,21 @@ export default { album() { return this.track.album || this.track.al || this.track?.simpleSong?.al; }, - translate() { - let t; - if (this.track?.tns?.length > 0) t = this.track.tns[0]; - else t = this.track.alia[0]; - return t; + subTitle() { + let tn = undefined; + if ( + this.track?.tns?.length > 0 && + this.track.name !== this.track.tns[0] + ) { + tn = this.track.tns[0]; + } + + //优先显示alia + if (this.$store.state.settings.subTitleDefault) { + return this.track?.alia?.length > 0 ? this.track.alia[0] : tn; + } else { + return tn === undefined ? this.track.alia[0] : tn; + } }, type() { return this.$parent.type; @@ -136,8 +146,12 @@ export default { isAlbum() { return this.type === 'album'; }, - isTranslate() { - return this.track?.tns?.length > 0 || this.track.alia?.length > 0; + isSubTitle() { + return ( + (this.track?.tns?.length > 0 && + this.track.name !== this.track.tns[0]) || + this.track.alia?.length > 0 + ); }, isPlaylist() { return this.type === 'playlist'; @@ -294,7 +308,7 @@ button { font-size: 14px; opacity: 0.72; } - .translate { + .subTitle { color: #aeaeae; margin-left: 4px; } @@ -398,7 +412,7 @@ button { .title, .album, .time, - .title-and-artist .translate { + .title-and-artist .subTitle { color: var(--color-primary); } .title .featured, diff --git a/src/locale/lang/en.js b/src/locale/lang/en.js index a97b675..4065e98 100644 --- a/src/locale/lang/en.js +++ b/src/locale/lang/en.js @@ -155,6 +155,7 @@ export default { enableDiscordRichPresence: 'Enable Discord Rich Presence', enableGlobalShortcut: 'Enable Global Shortcut', showLibraryDefault: 'Show library default', + subTitleDefault: 'Sub title alia default', lyricsBackground: { text: 'Show Lyrics Background', off: 'Off', diff --git a/src/locale/lang/tr.js b/src/locale/lang/tr.js index f9432bc..56d5e4d 100644 --- a/src/locale/lang/tr.js +++ b/src/locale/lang/tr.js @@ -150,6 +150,7 @@ export default { showPlaylistsByAppleMusic: "Apple Music'in Çalma Listelerini Göster", enableDiscordRichPresence: 'Discord gösterimini aktifleştir', showLibraryDefault: 'Kitaplık Varsayılanını göster', + subTitleDefault: 'Sub title alia default', lyricsBackground: { text: 'Şarkı Sözleri Arka Planını Göster', off: 'kapalı', diff --git a/src/locale/lang/zh-CN.js b/src/locale/lang/zh-CN.js index dfcac60..99c0029 100644 --- a/src/locale/lang/zh-CN.js +++ b/src/locale/lang/zh-CN.js @@ -156,6 +156,7 @@ export default { enableDiscordRichPresence: '启用 Discord Rich Presence', enableGlobalShortcut: '启用全局快捷键', showLibraryDefault: '启动后显示音乐库', + subTitleDefault: '副标题使用别名', lyricsBackground: { text: '显示歌词背景', off: '关闭', diff --git a/src/locale/lang/zh-TW.js b/src/locale/lang/zh-TW.js index d195b54..5e66d07 100644 --- a/src/locale/lang/zh-TW.js +++ b/src/locale/lang/zh-TW.js @@ -153,6 +153,7 @@ export default { enableDiscordRichPresence: '啟用 Discord Rich Presence', enableGlobalShortcut: '啟用全域快捷鍵', showLibraryDefault: '啟動後顯示音樂庫', + subTitleDefault: '副標題使用別名', lyricsBackground: { text: '顯示歌詞背景', off: '關閉', diff --git a/src/store/initLocalStorage.js b/src/store/initLocalStorage.js index 7e642a2..5fa494a 100644 --- a/src/store/initLocalStorage.js +++ b/src/store/initLocalStorage.js @@ -26,6 +26,7 @@ let localStorage = { enableDiscordRichPresence: false, enableGlobalShortcut: true, showLibraryDefault: false, + subTitleDefault: false, enabledPlaylistCategories, proxyConfig: { protocol: 'noProxy', diff --git a/src/views/settings.vue b/src/views/settings.vue index 6f484f5..1992348 100644 --- a/src/views/settings.vue +++ b/src/views/settings.vue @@ -337,6 +337,24 @@
+ +
+
+
{{ $t('settings.subTitleDefault') }}
+
+
+
+ + +
+
+
+
🐈️ 🏳️‍🌈
@@ -747,6 +765,17 @@ export default { }); }, }, + subTitleDefault: { + get() { + return this.settings.subTitleDefault; + }, + set(value) { + this.$store.commit('updateSettings', { + key: 'subTitleDefault', + value, + }); + }, + }, enableGlobalShortcut: { get() { return this.settings.enableGlobalShortcut; From b6cc6f82845a40c85466e116d80c08b71a74bc6c Mon Sep 17 00:00:00 2001 From: memorydream <34763046+memorydream@users.noreply.github.com> Date: Mon, 11 Oct 2021 10:19:10 +0800 Subject: [PATCH 04/30] =?UTF-8?q?fix:=20=E5=BD=93=E4=B8=8D=E5=AD=98?= =?UTF-8?q?=E5=9C=A8=E4=B8=93=E8=BE=91=E6=97=B6=EF=BC=8C=E4=B8=8D=E5=9C=A8?= =?UTF-8?q?=E6=AD=8C=E8=AF=8D=E7=95=8C=E9=9D=A2=E6=98=BE=E7=A4=BA=E5=A4=9A?= =?UTF-8?q?=E4=BD=99=E7=9A=84=E7=AC=A6=E5=8F=B7=20(#941)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * code clear * 当不存在专辑时,不在歌词界面显示 - 符号 * some change --- src/electron/ipcMain.js | 4 ---- src/views/lyrics.vue | 16 +++++++++------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/electron/ipcMain.js b/src/electron/ipcMain.js index f053775..839c34c 100644 --- a/src/electron/ipcMain.js +++ b/src/electron/ipcMain.js @@ -42,14 +42,10 @@ export function initIpcMain(win, store) { exitAsk(e); } else { let closeOpt = store.get('settings.closeAppOption'); - console.log(closeOpt); if (closeOpt === 'exit') { win = null; //app.quit(); app.exit(); //exit()直接关闭客户端,不会执行quit(); - } else if (closeOpt === 'minimize') { - e.preventDefault(); //阻止默认行为 - win.minimize(); //调用 最小化实例方法 } else if (closeOpt === 'minimizeToTray') { e.preventDefault(); win.hide(); diff --git a/src/views/lyrics.vue b/src/views/lyrics.vue index 027c107..13d4cd5 100644 --- a/src/views/lyrics.vue +++ b/src/views/lyrics.vue @@ -57,13 +57,15 @@ @click.native="toggleLyrics" >{{ artist.name }} - - - {{ album.name }} - + + - + {{ album.name }} + +
From 704732a046e791011630d3009e9312db8e85016a Mon Sep 17 00:00:00 2001 From: memorydream <34763046+memorydream@users.noreply.github.com> Date: Mon, 11 Oct 2021 10:19:27 +0800 Subject: [PATCH 05/30] =?UTF-8?q?try=20tray=20context=20on=20linux=20|=20?= =?UTF-8?q?=E5=B0=9D=E8=AF=95=E5=9C=A8linux=E4=B8=8A=E5=AE=9E=E7=8E=B0?= =?UTF-8?q?=E6=89=98=E7=9B=98=E8=8F=9C=E5=8D=95=20(#926)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * try tray context on linux * 调整linux下托盘菜单的选项位置 * bug fix * fix : linux tray contextMenu cant open * prettier code * 移除 显示主面板 的图标 --- src/electron/tray.js | 162 +++++++++++++++++++++++++------------------ 1 file changed, 94 insertions(+), 68 deletions(-) diff --git a/src/electron/tray.js b/src/electron/tray.js index 0981460..b0ec291 100644 --- a/src/electron/tray.js +++ b/src/electron/tray.js @@ -9,79 +9,105 @@ export function createTray(win) { height: 20, width: 20, }); - let tray = new Tray(icon); + let contextMenu = Menu.buildFromTemplate([ + //setContextMenu破坏了预期的click行为 + //在linux下,鼠标左右键都会呼出contextMenu + //所以此处单独为linux添加一个 显示主面板 选项 + ...(process.platform === 'linux' + ? [ + { + label: '显示主面板', + click: () => { + win.show(); + }, + }, + { + type: 'separator', + }, + ] + : []), + { + label: '播放/暂停', + icon: nativeImage.createFromPath( + path.join(__static, 'img/icons/play.png') + ), + click: () => { + win.webContents.send('play'); + }, + }, + { + label: '上一首', + icon: nativeImage.createFromPath( + path.join(__static, 'img/icons/left.png') + ), + accelerator: 'CmdOrCtrl+Left', + click: () => { + win.webContents.send('previous'); + }, + }, + { + label: '下一首', + icon: nativeImage.createFromPath( + path.join(__static, 'img/icons/right.png') + ), + accelerator: 'CmdOrCtrl+Right', + click: () => { + win.webContents.send('next'); + }, + }, + { + label: '循环播放', + icon: nativeImage.createFromPath( + path.join(__static, 'img/icons/repeat.png') + ), + accelerator: 'Alt+R', + click: () => { + win.webContents.send('repeat'); + }, + }, + { + label: '加入喜欢', + icon: nativeImage.createFromPath( + path.join(__static, 'img/icons/like.png') + ), + accelerator: 'CmdOrCtrl+L', + click: () => { + win.webContents.send('like'); + }, + }, + { + label: '退出', + icon: nativeImage.createFromPath( + path.join(__static, 'img/icons/exit.png') + ), + accelerator: 'CmdOrCtrl+W', + click: () => { + app.exit(); + }, + }, + ]); + let tray = new Tray(icon); tray.setToolTip('YesPlayMusic'); - tray.on('click', () => { - win.show(); - }); + if (process.platform === 'linux') { + //linux下托盘的实现方式比较迷惑 + //right-click无法在linux下使用 + //click在默认行为下会弹出一个contextMenu,里面的唯一选项才会调用click事件 + //setContextMenu应该是目前唯一能在linux下使用托盘菜单api + //但是无法区分鼠标左右键 - tray.on('right-click', () => { - const contextMenu = Menu.buildFromTemplate([ - { - label: '播放/暂停', - icon: nativeImage.createFromPath( - path.join(__static, 'img/icons/play.png') - ), - click: () => { - win.webContents.send('play'); - }, - }, - { - label: '上一首', - icon: nativeImage.createFromPath( - path.join(__static, 'img/icons/left.png') - ), - accelerator: 'CmdOrCtrl+Left', - click: () => { - win.webContents.send('previous'); - }, - }, - { - label: '下一首', - icon: nativeImage.createFromPath( - path.join(__static, 'img/icons/right.png') - ), - accelerator: 'CmdOrCtrl+Right', - click: () => { - win.webContents.send('next'); - }, - }, - { - label: '循环播放', - icon: nativeImage.createFromPath( - path.join(__static, 'img/icons/repeat.png') - ), - accelerator: 'Alt+R', - click: () => { - win.webContents.send('repeat'); - }, - }, - { - label: '加入喜欢', - icon: nativeImage.createFromPath( - path.join(__static, 'img/icons/like.png') - ), - accelerator: 'CmdOrCtrl+L', - click: () => { - win.webContents.send('like'); - }, - }, - { - label: '退出', - icon: nativeImage.createFromPath( - path.join(__static, 'img/icons/exit.png') - ), - accelerator: 'CmdOrCtrl+W', - click: () => { - app.exit(); - }, - }, - ]); + tray.setContextMenu(contextMenu); + } else { + //windows and macos + tray.on('click', () => { + win.show(); + }); - tray.popUpContextMenu(contextMenu); - }); + tray.on('right-click', () => { + tray.popUpContextMenu(contextMenu); + }); + } return tray; } From 9d18ad51f6182742e72ba1b5ed9efaacc1598dbf Mon Sep 17 00:00:00 2001 From: memorydream <34763046+memorydream@users.noreply.github.com> Date: Mon, 11 Oct 2021 10:19:37 +0800 Subject: [PATCH 06/30] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DLinux=E4=B8=8B?= =?UTF-8?q?=EF=BC=8C=E5=85=B3=E9=97=AD=E4=B8=BB=E9=9D=A2=E6=9D=BF=E6=97=B6?= =?UTF-8?q?...=20=E8=AF=A2=E9=97=AE=E9=80=89=E9=A1=B9=E6=97=A0=E6=95=88?= =?UTF-8?q?=E7=9A=84bug=20(#969)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: Linux close app ask cant work * Update background.js * fix: bug --- src/background.js | 47 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/src/background.js b/src/background.js index de03a10..5f2946d 100644 --- a/src/background.js +++ b/src/background.js @@ -26,6 +26,49 @@ const log = text => { console.log(`${clc.blueBright('[background.js]')} ${text}`); }; +const closeOnLinux = (e, win, store) => { + let closeOpt = store.get('settings.closeAppOption'); + if (closeOpt !== 'exit') { + e.preventDefault(); + } + + if (closeOpt === 'ask') { + dialog + .showMessageBox({ + type: 'info', + title: 'Information', + cancelId: 2, + defaultId: 0, + message: '确定要关闭吗?', + buttons: ['最小化到托盘', '直接退出'], + checkboxLabel: '记住我的选择', + }) + .then(result => { + if (result.checkboxChecked && result.response !== 2) { + win.webContents.send( + 'rememberCloseAppOption', + result.response === 0 ? 'minimizeToTray' : 'exit' + ); + } + + if (result.response === 0) { + win.hide(); //调用 最小化实例方法 + } else if (result.response === 1) { + win = null; + app.exit(); //exit()直接关闭客户端,不会执行quit(); + } + }) + .catch(err => { + log(err); + }); + } else if (closeOpt === 'exit') { + win = null; + app.quit(); + } else { + win.hide(); + } +}; + const isWindows = process.platform === 'win32'; const isMac = process.platform === 'darwin'; const isLinux = process.platform === 'linux'; @@ -207,7 +250,9 @@ class Background { this.window.on('close', e => { log('window close event'); - if (isMac) { + if (isLinux) { + closeOnLinux(e, this.window, this.store); + } else if (isMac) { if (this.willQuitApp) { this.window = null; app.quit(); From c25a3065e199559b808c06069f7f6ebd5234e96a Mon Sep 17 00:00:00 2001 From: memorydream <34763046+memorydream@users.noreply.github.com> Date: Fri, 22 Oct 2021 16:51:04 +0800 Subject: [PATCH 07/30] =?UTF-8?q?fix:=20=E5=9C=A8windows=E5=92=8Clinux?= =?UTF-8?q?=E4=B8=AD=EF=BC=8C=E5=BD=93=E5=90=AF=E5=8A=A8=E7=AC=AC=E4=BA=8C?= =?UTF-8?q?=E4=B8=AA=E7=AA=97=E5=8F=A3=E6=97=B6=EF=BC=8C=E5=91=BC=E5=87=BA?= =?UTF-8?q?=E5=B7=B2=E7=BB=8F=E5=90=AF=E5=8A=A8=E7=9A=84=E7=AA=97=E5=8F=A3?= =?UTF-8?q?=20(#992)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 在windows和linux中,当启动第二个窗口时,呼出已经启动的窗口 * prettier code * change --- src/background.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/background.js b/src/background.js index 5f2946d..5efde71 100644 --- a/src/background.js +++ b/src/background.js @@ -86,7 +86,7 @@ class Background { }); this.neteaseMusicAPI = null; this.expressApp = null; - this.willQuitApp = isMac ? false : true; + this.willQuitApp = !isMac; this.init(); } @@ -387,6 +387,18 @@ class Background { // unregister all global shortcuts globalShortcut.unregisterAll(); }); + + if (!isMac) { + app.on('second-instance', (e, cl, wd) => { + if (this.window) { + this.window.show(); + if (this.window.isMinimized()) { + this.window.restore(); + } + this.window.focus(); + } + }); + } } } From 75bb6b9e2d02b353147006b6c9cb2ad366e63a3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=81=AB=E8=8A=B1=E2=9C=A8?= <61813396+Hibanaw@users.noreply.github.com> Date: Fri, 22 Oct 2021 16:52:00 +0800 Subject: [PATCH 08/30] fix: remove zh-tw flag emoji (#991) * fix: correct zh-tw flag emoji * Update settings.vue Co-authored-by: qier222 --- src/views/settings.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/settings.vue b/src/views/settings.vue index 1992348..d4b7046 100644 --- a/src/views/settings.vue +++ b/src/views/settings.vue @@ -35,7 +35,7 @@ - +
From d0ae7fee72cda22549e3cbb998c40d6a205198b4 Mon Sep 17 00:00:00 2001 From: qier222 Date: Fri, 22 Oct 2021 20:43:42 +0800 Subject: [PATCH 09/30] chore: update .env.example --- .env.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.example b/.env.example index c31b035..7c0058a 100644 --- a/.env.example +++ b/.env.example @@ -1,6 +1,6 @@ VUE_APP_NETEASE_API_URL=/api VUE_APP_ELECTRON_API_URL=/api -VUE_APP_ELECTRON_API_URL_DEV=http://127.0.0.1:3000 +VUE_APP_ELECTRON_API_URL_DEV=http://127.0.0.1:10754 VUE_APP_LASTFM_API_KEY=09c55292403d961aa517ff7f5e8a3d9c VUE_APP_LASTFM_API_SHARED_SECRET=307c9fda32b3904e53654baff215cb67 DEV_SERVER_PORT=20201 From 9b565c41c209c3f57673def28c50c472dbacb8d8 Mon Sep 17 00:00:00 2001 From: qier222 Date: Fri, 22 Oct 2021 20:44:39 +0800 Subject: [PATCH 10/30] chore: update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5edf246..5258849 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "yesplaymusic", - "version": "0.4.1", + "version": "0.4.2", "private": true, "description": "A third party music player for Netease Music", "author": "hawtim", From ee59479ff8f39aaac667b319ea6839eb4f5fa0e7 Mon Sep 17 00:00:00 2001 From: Hawtim Date: Thu, 28 Oct 2021 01:09:00 +0800 Subject: [PATCH 11/30] feat: enhance (#1016) --- package.json | 6 +++--- src/components/Navbar.vue | 1 + src/components/TrackListItem.vue | 10 +++++++--- src/store/actions.js | 2 +- src/utils/Player.js | 8 ++++++-- yarn.lock | 6 +++--- 6 files changed, 21 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 5258849..02c72b9 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "0.4.2", "private": true, "description": "A third party music player for Netease Music", - "author": "hawtim", + "author": "qier222", "scripts": { "serve": "vue-cli-service serve", "build": "vue-cli-service build", @@ -47,14 +47,14 @@ "electron-store": "^6.0.1", "electron-updater": "^4.3.5", "express": "^4.17.1", - "md5": "^2.3.0", - "music-metadata": "^7.5.3", "express-fileupload": "^1.2.0", "express-http-proxy": "^1.6.2", "extract-zip": "^2.0.1", "howler": "^2.2.3", "js-cookie": "^2.2.1", "lodash": "^4.17.20", + "md5": "^2.3.0", + "music-metadata": "^7.5.3", "node-vibrant": "^3.1.6", "nprogress": "^0.2.0", "pac-proxy-agent": "^4.1.0", diff --git a/src/components/Navbar.vue b/src/components/Navbar.vue index 372fca0..6b01a48 100644 --- a/src/components/Navbar.vue +++ b/src/components/Navbar.vue @@ -53,6 +53,7 @@
- {{ album.name }} + {{ + album.name + }}
@@ -85,6 +87,7 @@ import ArtistsInLine from '@/components/ArtistsInLine.vue'; import ExplicitSymbol from '@/components/ExplicitSymbol.vue'; import { mapState } from 'vuex'; +import { isNil } from 'lodash'; export default { name: 'TrackListItem', @@ -117,8 +120,9 @@ export default { return image + '?param=224y224'; }, artists() { - if (this.track.ar !== undefined) return this.track.ar; - if (this.track.artists !== undefined) return this.track.artists; + const { ar, artists } = this.track; + if (!isNil(ar)) return ar; + if (!isNil(artists)) return artists; return []; }, album() { diff --git a/src/store/actions.js b/src/store/actions.js index d29eb88..39bb019 100644 --- a/src/store/actions.js +++ b/src/store/actions.js @@ -100,7 +100,7 @@ export default { if (!isLooseLoggedIn()) return; if (isAccountLoggedIn()) { return userPlaylist({ - uid: state.data.user.userId, + uid: state.data.user?.userId, limit: 2000, // 最多只加载2000个歌单(等有用户反馈问题再修) timestamp: new Date().getTime(), }).then(result => { diff --git a/src/utils/Player.js b/src/utils/Player.js index 20ff303..4f81941 100644 --- a/src/utils/Player.js +++ b/src/utils/Player.js @@ -235,7 +235,9 @@ export default class { }); if (autoplay) { this.play(); - document.title = `${this._currentTrack.name} · ${this._currentTrack.ar[0].name} - YesPlayMusic`; + if (this._currentTrack.name) { + document.title = `${this._currentTrack.name} · ${this._currentTrack.ar[0].name} - YesPlayMusic`; + } } this.setOutputDevice(); this._howler.once('end', () => { @@ -485,7 +487,9 @@ export default class { if (this._howler?.playing()) return; this._howler?.play(); this._playing = true; - document.title = `${this._currentTrack.name} · ${this._currentTrack.ar[0].name} - YesPlayMusic`; + if (this._currentTrack.name) { + document.title = `${this._currentTrack.name} · ${this._currentTrack.ar[0].name} - YesPlayMusic`; + } this._playDiscordPresence(this._currentTrack, this.seek()); if (store.state.lastfm.key !== undefined) { trackUpdateNowPlaying({ diff --git a/yarn.lock b/yarn.lock index 257e6c4..d6bd1ac 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3238,9 +3238,9 @@ caniuse-api@^3.0.0: lodash.uniq "^4.5.0" caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001208: - version "1.0.30001208" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001208.tgz#a999014a35cebd4f98c405930a057a0d75352eb9" - integrity sha512-OE5UE4+nBOro8Dyvv0lfx+SRtfVIOM9uhKqFmJeUbGriqhhStgp1A0OyBpgy3OUF8AhYCT+PVwPC1gMl2ZcQMA== + version "1.0.30001271" + resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001271.tgz" + integrity sha512-BBruZFWmt3HFdVPS8kceTBIguKxu4f99n5JNp06OlPD/luoAMIaIK5ieV5YjnBLH3Nysai9sxj9rpJj4ZisXOA== capital-case@^1.0.4: version "1.0.4" From d580e633581df7c67e37831e42cb6ada4f03e26b Mon Sep 17 00:00:00 2001 From: memorydream <34763046+memorydream@users.noreply.github.com> Date: Thu, 28 Oct 2021 22:02:58 +0800 Subject: [PATCH 12/30] fix: #1009 (#1018) * fix: goToList bug * lyrics page title go to fix * change --- src/components/Player.vue | 33 ++++++++++++++------------------- src/utils/playList.js | 22 ++++++++++++++++++++++ src/views/lyrics.vue | 13 ++++++++++++- 3 files changed, 48 insertions(+), 20 deletions(-) create mode 100644 src/utils/playList.js diff --git a/src/components/Player.vue b/src/components/Player.vue index 9789a67..5458ff3 100644 --- a/src/components/Player.vue +++ b/src/components/Player.vue @@ -30,16 +30,19 @@ @click="goToAlbum" />
-
+
{{ currentTrack.name }}
- {{ ar.name }} {{ ar.name }} ,
@@ -173,6 +176,7 @@ import '@/assets/css/slider.css'; import ButtonIcon from '@/components/ButtonIcon.vue'; import VueSlider from 'vue-slider-component'; +import { goToListSource, hasListSource } from '@/utils/playList'; export default { name: 'Player', @@ -217,22 +221,11 @@ export default { let sec = (~~(value % 60)).toString().padStart(2, '0'); return `${min}:${sec}`; }, + hasList() { + return hasListSource(); + }, goToList() { - if (this.player.playlistSource.id === this.data.likedSongPlaylistID) { - this.$router.push({ path: '/library/liked-songs' }); - } else if (this.player.playlistSource.type === 'url') { - this.$router.push({ path: this.player.playlistSource.id }); - } else if (this.player.playlistSource.type === 'cloudDisk') { - this.$router.push({ path: '/library' }); - } else { - this.$router.push({ - path: - '/' + - this.player.playlistSource.type + - '/' + - this.player.playlistSource.id, - }); - } + goToListSource(); }, goToAlbum() { if (this.player.currentTrack.al.id === 0) return; @@ -319,12 +312,14 @@ export default { opacity: 0.88; color: var(--color-text); margin-bottom: 4px; - cursor: pointer; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; overflow: hidden; word-break: break-all; + } + .hasList { + cursor: pointer; &:hover { text-decoration: underline; } diff --git a/src/utils/playList.js b/src/utils/playList.js new file mode 100644 index 0000000..f476f28 --- /dev/null +++ b/src/utils/playList.js @@ -0,0 +1,22 @@ +import router from '../router'; +import state from '../store/state'; + +export function hasListSource() { + return !state.player.isPersonalFM && state.player.playlistSource.id !== 0; +} + +export function goToListSource() { + router.push({ path: getListSourcePath() }); +} + +export function getListSourcePath() { + if (state.player.playlistSource.id === state.data.likedSongPlaylistID) { + return '/library/liked-songs'; + } else if (state.player.playlistSource.type === 'url') { + return state.player.playlistSource.id; + } else if (state.player.playlistSource.type === 'cloudDisk') { + return '/library'; + } else { + return `/${state.player.playlistSource.type}/${state.player.playlistSource.id}`; + } +} diff --git a/src/views/lyrics.vue b/src/views/lyrics.vue index 13d4cd5..41763f6 100644 --- a/src/views/lyrics.vue +++ b/src/views/lyrics.vue @@ -46,10 +46,14 @@
{{ currentTrack.name }} + + {{ currentTrack.name }} +
From e4298fdad6b8c3356742b1dafe289c0cc3569cab Mon Sep 17 00:00:00 2001 From: memorydream <34763046+memorydream@users.noreply.github.com> Date: Mon, 8 Nov 2021 14:37:52 +0800 Subject: [PATCH 13/30] fix: name (#1033) --- src/components/Player.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Player.vue b/src/components/Player.vue index 5458ff3..1c1fb14 100644 --- a/src/components/Player.vue +++ b/src/components/Player.vue @@ -31,7 +31,7 @@ />
{{ currentTrack.name }} @@ -318,7 +318,7 @@ export default { overflow: hidden; word-break: break-all; } - .hasList { + .has-list { cursor: pointer; &:hover { text-decoration: underline; From 83417278821b556762d94beaea92b2d4322bbffd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=AF=E8=99=B9=E5=B7=9D=E9=A3=B4?= Date: Tue, 9 Nov 2021 10:55:36 +0800 Subject: [PATCH 14/30] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20issues=20#101?= =?UTF-8?q?9=20(#1040)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * issues #1019 的迫真修复 * 修复 issues #1019 * 修复 issues #1019 * 改回 pickedLyric() 逻辑 --- src/views/library.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/views/library.vue b/src/views/library.vue index 2c7fb7b..693b1da 100644 --- a/src/views/library.vue +++ b/src/views/library.vue @@ -286,7 +286,15 @@ export default { getLyric( this.liked.songs[randomNum(0, this.liked.songs.length - 1)] ).then(data => { - if (data.lrc !== undefined) this.lyric = data.lrc.lyric; + if (data.lrc !== undefined) { + let ifl = data.lrc.lyric.split('\n').filter(l => { + if (l.includes('作词')) { + this.lyric = data.lrc.lyric; + return true + ifl; + } + return false; + }); + } }); }, openAddPlaylistModal() { From 0d3df4a1e4f44adafe8a52b81623bf3e34c22262 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=AF=E8=99=B9=E5=B7=9D=E9=A3=B4?= Date: Mon, 6 Dec 2021 18:27:24 +0800 Subject: [PATCH 15/30] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20issues=20#101?= =?UTF-8?q?9=20=E7=9A=84=E8=B7=9F=E8=BF=9B=E9=97=AE=E9=A2=98=20(#1068)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * issues #1019 的迫真修复 * 修复 issues #1019 * 修复 issues #1019 * 改回 pickedLyric() 逻辑 * 更进一步的避免取词卡死问题 * 更新网易云 api 到 4.2.0 * Update README.md * Revert "Update README.md" This reverts commit b862ef7d4dabd40c8fe57e4837fc6220806a1456. --- netease_api/module/artist_video.js | 24 ++++++++ netease_api/module/comment.js | 36 ------------ netease_api/module/comment_album.js | 22 ------- netease_api/module/comment_dj.js | 22 ------- netease_api/module/comment_floor.js | 21 ------- netease_api/module/comment_hot.js | 24 -------- netease_api/module/comment_hug_list.js | 27 --------- netease_api/module/comment_like.js | 26 --------- netease_api/module/comment_music.js | 22 ------- netease_api/module/comment_mv.js | 22 ------- netease_api/module/comment_new.js | 31 ---------- netease_api/module/comment_playlist.js | 22 ------- netease_api/module/comment_video.js | 22 ------- netease_api/module/playlist_create.js | 2 +- netease_api/module/playlist_track_all.js | 47 +++++++++++++++ ...omment_event.js => record_recent_album.js} | 8 +-- ...{share_resource.js => record_recent_dj.js} | 8 +-- netease_api/module/record_recent_playlist.js | 16 +++++ netease_api/module/record_recent_song.js | 16 +++++ netease_api/module/record_recent_video.js | 16 +++++ netease_api/module/record_recent_voice.js | 16 +++++ netease_api/module/song_download_url.js | 20 +++++++ netease_api/package.json | 2 +- netease_api/public/home.html | 58 +++++++++++++++++++ netease_api/public/login.html | 47 +++++++++++++++ netease_api/test/login.test.js | 7 ++- netease_api/util/request.js | 16 +++-- src/views/library.vue | 3 + 28 files changed, 286 insertions(+), 317 deletions(-) create mode 100644 netease_api/module/artist_video.js delete mode 100644 netease_api/module/comment.js delete mode 100644 netease_api/module/comment_album.js delete mode 100644 netease_api/module/comment_dj.js delete mode 100644 netease_api/module/comment_floor.js delete mode 100644 netease_api/module/comment_hot.js delete mode 100644 netease_api/module/comment_hug_list.js delete mode 100644 netease_api/module/comment_like.js delete mode 100644 netease_api/module/comment_music.js delete mode 100644 netease_api/module/comment_mv.js delete mode 100644 netease_api/module/comment_new.js delete mode 100644 netease_api/module/comment_playlist.js delete mode 100644 netease_api/module/comment_video.js create mode 100644 netease_api/module/playlist_track_all.js rename netease_api/module/{comment_event.js => record_recent_album.js} (53%) rename netease_api/module/{share_resource.js => record_recent_dj.js} (52%) create mode 100644 netease_api/module/record_recent_playlist.js create mode 100644 netease_api/module/record_recent_song.js create mode 100644 netease_api/module/record_recent_video.js create mode 100644 netease_api/module/record_recent_voice.js create mode 100644 netease_api/module/song_download_url.js create mode 100644 netease_api/public/home.html create mode 100644 netease_api/public/login.html diff --git a/netease_api/module/artist_video.js b/netease_api/module/artist_video.js new file mode 100644 index 0000000..735fe07 --- /dev/null +++ b/netease_api/module/artist_video.js @@ -0,0 +1,24 @@ +// 歌手相关视频 + +module.exports = (query, request) => { + const data = { + artistId: query.id, + page: JSON.stringify({ + size: query.size || 10, + cursor: query.cursor || 0, + }), + tab: 0, + order: query.order || 0, + } + return request( + 'POST', + `https://music.163.com/weapi/mlog/artist/video`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + }, + ) +} diff --git a/netease_api/module/comment.js b/netease_api/module/comment.js deleted file mode 100644 index 9395bf3..0000000 --- a/netease_api/module/comment.js +++ /dev/null @@ -1,36 +0,0 @@ -const { resourceTypeMap } = require('../util/config.json') -// 发送与删除评论 - -module.exports = (query, request) => { - query.cookie.os = 'pc' - query.t = { - 1: 'add', - 0: 'delete', - 2: 'reply', - }[query.t] - query.type = resourceTypeMap[query.type] - const data = { - threadId: query.type + query.id, - } - - if (query.type == 'A_EV_2_') { - data.threadId = query.threadId - } - if (query.t == 'add') data.content = query.content - else if (query.t == 'delete') data.commentId = query.commentId - else if (query.t == 'reply') { - data.commentId = query.commentId - data.content = query.content - } - return request( - 'POST', - `https://music.163.com/weapi/resource/comments/${query.t}`, - data, - { - crypto: 'weapi', - cookie: query.cookie, - proxy: query.proxy, - realIP: query.realIP, - }, - ) -} diff --git a/netease_api/module/comment_album.js b/netease_api/module/comment_album.js deleted file mode 100644 index d701d2d..0000000 --- a/netease_api/module/comment_album.js +++ /dev/null @@ -1,22 +0,0 @@ -// 专辑评论 - -module.exports = (query, request) => { - query.cookie.os = 'pc' - const data = { - rid: query.id, - limit: query.limit || 20, - offset: query.offset || 0, - beforeTime: query.before || 0, - } - return request( - 'POST', - `https://music.163.com/weapi/v1/resource/comments/R_AL_3_${query.id}`, - data, - { - crypto: 'weapi', - cookie: query.cookie, - proxy: query.proxy, - realIP: query.realIP, - }, - ) -} diff --git a/netease_api/module/comment_dj.js b/netease_api/module/comment_dj.js deleted file mode 100644 index 70b7dbf..0000000 --- a/netease_api/module/comment_dj.js +++ /dev/null @@ -1,22 +0,0 @@ -// 电台评论 - -module.exports = (query, request) => { - query.cookie.os = 'pc' - const data = { - rid: query.id, - limit: query.limit || 20, - offset: query.offset || 0, - beforeTime: query.before || 0, - } - return request( - 'POST', - `https://music.163.com/weapi/v1/resource/comments/A_DJ_1_${query.id}`, - data, - { - crypto: 'weapi', - cookie: query.cookie, - proxy: query.proxy, - realIP: query.realIP, - }, - ) -} diff --git a/netease_api/module/comment_floor.js b/netease_api/module/comment_floor.js deleted file mode 100644 index de28470..0000000 --- a/netease_api/module/comment_floor.js +++ /dev/null @@ -1,21 +0,0 @@ -const { resourceTypeMap } = require('../util/config.json') -module.exports = (query, request) => { - query.type = resourceTypeMap[query.type] - const data = { - parentCommentId: query.parentCommentId, - threadId: query.type + query.id, - time: query.time || -1, - limit: query.limit || 20, - } - return request( - 'POST', - `https://music.163.com/api/resource/comment/floor/get`, - data, - { - crypto: 'weapi', - cookie: query.cookie, - proxy: query.proxy, - realIP: query.realIP, - }, - ) -} diff --git a/netease_api/module/comment_hot.js b/netease_api/module/comment_hot.js deleted file mode 100644 index 4858678..0000000 --- a/netease_api/module/comment_hot.js +++ /dev/null @@ -1,24 +0,0 @@ -const { resourceTypeMap } = require('../util/config.json') -// 热门评论 - -module.exports = (query, request) => { - query.cookie.os = 'pc' - query.type = resourceTypeMap[query.type] - const data = { - rid: query.id, - limit: query.limit || 20, - offset: query.offset || 0, - beforeTime: query.before || 0, - } - return request( - 'POST', - `https://music.163.com/weapi/v1/resource/hotcomments/${query.type}${query.id}`, - data, - { - crypto: 'weapi', - cookie: query.cookie, - proxy: query.proxy, - realIP: query.realIP, - }, - ) -} diff --git a/netease_api/module/comment_hug_list.js b/netease_api/module/comment_hug_list.js deleted file mode 100644 index 394a2df..0000000 --- a/netease_api/module/comment_hug_list.js +++ /dev/null @@ -1,27 +0,0 @@ -const { resourceTypeMap } = require('../util/config.json') -module.exports = (query, request) => { - query.cookie.os = 'ios' - query.cookie.appver = '8.1.20' - query.type = resourceTypeMap[query.type || 0] - const threadId = query.type + query.sid - const data = { - targetUserId: query.uid, - commentId: query.cid, - cursor: query.cursor || '-1', - threadId: threadId, - pageNo: query.page || 1, - idCursor: query.idCursor || -1, - pageSize: query.pageSize || 100, - } - return request( - 'POST', - `https://music.163.com/api/v2/resource/comments/hug/list`, - data, - { - crypto: 'api', - cookie: query.cookie, - proxy: query.proxy, - realIP: query.realIP, - }, - ) -} diff --git a/netease_api/module/comment_like.js b/netease_api/module/comment_like.js deleted file mode 100644 index fa382a8..0000000 --- a/netease_api/module/comment_like.js +++ /dev/null @@ -1,26 +0,0 @@ -const { resourceTypeMap } = require('../util/config.json') -// 点赞与取消点赞评论 - -module.exports = (query, request) => { - query.cookie.os = 'pc' - query.t = query.t == 1 ? 'like' : 'unlike' - query.type = resourceTypeMap[query.type] - const data = { - threadId: query.type + query.id, - commentId: query.cid, - } - if (query.type == 'A_EV_2_') { - data.threadId = query.threadId - } - return request( - 'POST', - `https://music.163.com/weapi/v1/comment/${query.t}`, - data, - { - crypto: 'weapi', - cookie: query.cookie, - proxy: query.proxy, - realIP: query.realIP, - }, - ) -} diff --git a/netease_api/module/comment_music.js b/netease_api/module/comment_music.js deleted file mode 100644 index 9fbc8f1..0000000 --- a/netease_api/module/comment_music.js +++ /dev/null @@ -1,22 +0,0 @@ -// 歌曲评论 - -module.exports = (query, request) => { - query.cookie.os = 'pc' - const data = { - rid: query.id, - limit: query.limit || 20, - offset: query.offset || 0, - beforeTime: query.before || 0, - } - return request( - 'POST', - `https://music.163.com/api/v1/resource/comments/R_SO_4_${query.id}`, - data, - { - crypto: 'weapi', - cookie: query.cookie, - proxy: query.proxy, - realIP: query.realIP, - }, - ) -} diff --git a/netease_api/module/comment_mv.js b/netease_api/module/comment_mv.js deleted file mode 100644 index 979c035..0000000 --- a/netease_api/module/comment_mv.js +++ /dev/null @@ -1,22 +0,0 @@ -// MV评论 - -module.exports = (query, request) => { - query.cookie.os = 'pc' - const data = { - rid: query.id, - limit: query.limit || 20, - offset: query.offset || 0, - beforeTime: query.before || 0, - } - return request( - 'POST', - `https://music.163.com/weapi/v1/resource/comments/R_MV_5_${query.id}`, - data, - { - crypto: 'weapi', - cookie: query.cookie, - proxy: query.proxy, - realIP: query.realIP, - }, - ) -} diff --git a/netease_api/module/comment_new.js b/netease_api/module/comment_new.js deleted file mode 100644 index ad3cb0b..0000000 --- a/netease_api/module/comment_new.js +++ /dev/null @@ -1,31 +0,0 @@ -const { resourceTypeMap } = require('../util/config.json') -// 评论 - -module.exports = (query, request) => { - query.cookie.os = 'pc' - query.type = resourceTypeMap[query.type] - const threadId = query.type + query.id - const pageSize = query.pageSize || 20 - const pageNo = query.pageNo || 1 - const data = { - threadId: threadId, - pageNo, - showInner: query.showInner || true, - pageSize, - cursor: - +query.sortType === 3 ? query.cursor || '0' : (pageNo - 1) * pageSize, - sortType: query.sortType || 1, //1:按推荐排序,2:按热度排序,3:按时间排序 - } - return request( - 'POST', - `https://music.163.com/api/v2/resource/comments`, - data, - { - crypto: 'eapi', - cookie: query.cookie, - proxy: query.proxy, - realIP: query.realIP, - url: '/api/v2/resource/comments', - }, - ) -} diff --git a/netease_api/module/comment_playlist.js b/netease_api/module/comment_playlist.js deleted file mode 100644 index 52fc544..0000000 --- a/netease_api/module/comment_playlist.js +++ /dev/null @@ -1,22 +0,0 @@ -// 歌单评论 - -module.exports = (query, request) => { - query.cookie.os = 'pc' - const data = { - rid: query.id, - limit: query.limit || 20, - offset: query.offset || 0, - beforeTime: query.before || 0, - } - return request( - 'POST', - `https://music.163.com/weapi/v1/resource/comments/A_PL_0_${query.id}`, - data, - { - crypto: 'weapi', - cookie: query.cookie, - proxy: query.proxy, - realIP: query.realIP, - }, - ) -} diff --git a/netease_api/module/comment_video.js b/netease_api/module/comment_video.js deleted file mode 100644 index ae015a9..0000000 --- a/netease_api/module/comment_video.js +++ /dev/null @@ -1,22 +0,0 @@ -// 视频评论 - -module.exports = (query, request) => { - query.cookie.os = 'pc' - const data = { - rid: query.id, - limit: query.limit || 20, - offset: query.offset || 0, - beforeTime: query.before || 0, - } - return request( - 'POST', - `https://music.163.com/weapi/v1/resource/comments/R_VI_62_${query.id}`, - data, - { - crypto: 'weapi', - cookie: query.cookie, - proxy: query.proxy, - realIP: query.realIP, - }, - ) -} diff --git a/netease_api/module/playlist_create.js b/netease_api/module/playlist_create.js index 8a1ae26..f33f5f0 100644 --- a/netease_api/module/playlist_create.js +++ b/netease_api/module/playlist_create.js @@ -5,7 +5,7 @@ module.exports = (query, request) => { const data = { name: query.name, privacy: query.privacy, //0 为普通歌单,10 为隐私歌单 - type: query.type || 'NORMAL', // NORMAL|VIDEO + type: query.type || 'NORMAL', // NORMAL|VIDEO|SHARED } return request('POST', `https://music.163.com/api/playlist/create`, data, { crypto: 'weapi', diff --git a/netease_api/module/playlist_track_all.js b/netease_api/module/playlist_track_all.js new file mode 100644 index 0000000..03a8c3a --- /dev/null +++ b/netease_api/module/playlist_track_all.js @@ -0,0 +1,47 @@ +// 通过传过来的歌单id拿到所有歌曲数据 +// 支持传递参数limit来限制获取歌曲的数据数量 例如: /playlist/track/all?id=7044354223&limit=10 + +module.exports = (query, request) => { + const data = { + id: query.id, + n: 100000, + s: query.s || 8, + } + //不放在data里面避免请求带上无用的数据 + let limit = query.limit + let trackIds + let idsData = Object.create(null) + + return request('POST', `https://music.163.com/api/v6/playlist/detail`, data, { + crypto: 'api', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + }).then((res) => { + const ids = [] + let trackIds = res.body.playlist.trackIds + if (typeof limit === 'undefined') { + limit = trackIds.length + } + trackIds.forEach((item, index) => { + if (index < limit) { + ids.push(item.id) + } + }) + idsData = { + c: '[' + ids.map((id) => '{"id":' + id + '}').join(',') + ']', + } + + return request( + 'POST', + `https://music.163.com/api/v3/song/detail`, + idsData, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + }, + ) + }) +} diff --git a/netease_api/module/comment_event.js b/netease_api/module/record_recent_album.js similarity index 53% rename from netease_api/module/comment_event.js rename to netease_api/module/record_recent_album.js index 460a560..804bc19 100644 --- a/netease_api/module/comment_event.js +++ b/netease_api/module/record_recent_album.js @@ -1,14 +1,10 @@ -// 获取动态评论 - module.exports = (query, request) => { const data = { - limit: query.limit || 20, - offset: query.offset || 0, - beforeTime: query.before || 0, + limit: query.limit || 100, } return request( 'POST', - `https://music.163.com/weapi/v1/resource/comments/${query.threadId}`, + `https://music.163.com/api/play-record/album/list`, data, { crypto: 'weapi', diff --git a/netease_api/module/share_resource.js b/netease_api/module/record_recent_dj.js similarity index 52% rename from netease_api/module/share_resource.js rename to netease_api/module/record_recent_dj.js index 64c016a..6bd6062 100644 --- a/netease_api/module/share_resource.js +++ b/netease_api/module/record_recent_dj.js @@ -1,14 +1,10 @@ -// 分享歌曲到动态 - module.exports = (query, request) => { const data = { - type: query.type || 'song', // song,playlist,mv,djprogram,djradio - msg: query.msg || '', - id: query.id || '', + limit: query.limit || 100, } return request( 'POST', - `https://music.163.com/weapi/share/friends/resource`, + `https://music.163.com/api/play-record/djradio/list`, data, { crypto: 'weapi', diff --git a/netease_api/module/record_recent_playlist.js b/netease_api/module/record_recent_playlist.js new file mode 100644 index 0000000..d9a7d3d --- /dev/null +++ b/netease_api/module/record_recent_playlist.js @@ -0,0 +1,16 @@ +module.exports = (query, request) => { + const data = { + limit: query.limit || 100, + } + return request( + 'POST', + `https://music.163.com/api/play-record/playlist/list`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + }, + ) +} diff --git a/netease_api/module/record_recent_song.js b/netease_api/module/record_recent_song.js new file mode 100644 index 0000000..275caaa --- /dev/null +++ b/netease_api/module/record_recent_song.js @@ -0,0 +1,16 @@ +module.exports = (query, request) => { + const data = { + limit: query.limit || 100, + } + return request( + 'POST', + `https://music.163.com/api/play-record/song/list`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + }, + ) +} diff --git a/netease_api/module/record_recent_video.js b/netease_api/module/record_recent_video.js new file mode 100644 index 0000000..5a22b96 --- /dev/null +++ b/netease_api/module/record_recent_video.js @@ -0,0 +1,16 @@ +module.exports = (query, request) => { + const data = { + limit: query.limit || 100, + } + return request( + 'POST', + `https://music.163.com/api/play-record/newvideo/list`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + }, + ) +} diff --git a/netease_api/module/record_recent_voice.js b/netease_api/module/record_recent_voice.js new file mode 100644 index 0000000..43f5b1c --- /dev/null +++ b/netease_api/module/record_recent_voice.js @@ -0,0 +1,16 @@ +module.exports = (query, request) => { + const data = { + limit: query.limit || 100, + } + return request( + 'POST', + `https://music.163.com/api/play-record/voice/list`, + data, + { + crypto: 'weapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + }, + ) +} diff --git a/netease_api/module/song_download_url.js b/netease_api/module/song_download_url.js new file mode 100644 index 0000000..73eccc9 --- /dev/null +++ b/netease_api/module/song_download_url.js @@ -0,0 +1,20 @@ +// 获取客户端歌曲下载链接 + +module.exports = (query, request) => { + const data = { + id: query.id, + br: parseInt(query.br || 999000), + } + return request( + 'POST', + `https://interface.music.163.com/eapi/song/enhance/download/url`, + data, + { + crypto: 'eapi', + cookie: query.cookie, + proxy: query.proxy, + realIP: query.realIP, + url: '/api/song/enhance/download/url', + }, + ) +} diff --git a/netease_api/package.json b/netease_api/package.json index 3990157..8a81185 100644 --- a/netease_api/package.json +++ b/netease_api/package.json @@ -1,6 +1,6 @@ { "name": "NeteaseCloudMusicApi", - "version": "4.0.8", + "version": "4.2.0", "description": "网易云音乐 NodeJS 版 API", "scripts": { "start": "node app.js", diff --git a/netease_api/public/home.html b/netease_api/public/home.html new file mode 100644 index 0000000..1459dc9 --- /dev/null +++ b/netease_api/public/home.html @@ -0,0 +1,58 @@ + + + + + + + home + + + + + + + + diff --git a/netease_api/public/login.html b/netease_api/public/login.html new file mode 100644 index 0000000..1aa597d --- /dev/null +++ b/netease_api/public/login.html @@ -0,0 +1,47 @@ + + + + + + + 登录 + + + + + + + + diff --git a/netease_api/test/login.test.js b/netease_api/test/login.test.js index d10da4b..e7551d6 100644 --- a/netease_api/test/login.test.js +++ b/netease_api/test/login.test.js @@ -3,11 +3,14 @@ const axios = require('axios') const host = global.host || 'http://localhost:3000' console.log('注意: 测试登录需在 test/login.test.js 中填写账号密码!!!') -const phone = '' -const password = '' +const country_code = '1' +const phone = '3156678705' +const password = '1q2w3e4R' describe('测试登录是否正常', () => { it('手机登录 code 应该等于200', (done) => { const qs = { + countrycode: + process.env.NCM_API_TEST_LOGIN_COUNTRY_CODE || country_code || '', phone: process.env.NCM_API_TEST_LOGIN_PHONE || phone || '', password: process.env.NCM_API_TEST_LOGIN_PASSWORD || password || '', } diff --git a/netease_api/util/request.js b/netease_api/util/request.js index 7b4f45a..bcb245a 100644 --- a/netease_api/util/request.js +++ b/netease_api/util/request.js @@ -117,7 +117,7 @@ const createRequest = (method, url, data, options) => { headers: headers, data: queryString.stringify(data), httpAgent: new http.Agent({ keepAlive: true }), - httpsAgent: new https.Agent({ keepAlive: true, rejectUnauthorized: false }), + httpsAgent: new https.Agent({ keepAlive: true }), } if (options.crypto === 'eapi') settings.encoding = null @@ -127,7 +127,7 @@ const createRequest = (method, url, data, options) => { settings.httpAgent = new PacProxyAgent(options.proxy) settings.httpsAgent = new PacProxyAgent(options.proxy) } else { - var purl = qs.parse(options.proxy) + const purl = qs.parse(options.proxy) if (purl.hostname) { const agent = tunnel.httpsOverHttp({ proxy: { @@ -142,6 +142,8 @@ const createRequest = (method, url, data, options) => { console.error('代理配置无效,不使用代理') } } + } else { + settings.proxy = false } if (options.crypto === 'eapi') { settings = { @@ -172,13 +174,19 @@ const createRequest = (method, url, data, options) => { } } catch (e) { // console.log(e) - answer.body = body + try { + answer.body = JSON.parse(body.toString()) + } catch (err) { + // console.log(err) + // can't decrypt and can't parse directly + answer.body = body + } answer.status = res.status } answer.status = 100 < answer.status && answer.status < 600 ? answer.status : 400 - if (answer.status == 200) resolve(answer) + if (answer.status === 200) resolve(answer) else reject(answer) }) .catch((err) => { diff --git a/src/views/library.vue b/src/views/library.vue index 693b1da..c8243a7 100644 --- a/src/views/library.vue +++ b/src/views/library.vue @@ -289,6 +289,9 @@ export default { if (data.lrc !== undefined) { let ifl = data.lrc.lyric.split('\n').filter(l => { if (l.includes('作词')) { + if (l.includes('纯音乐,请欣赏') || l.includes('作词 : 无')) { + return false; + } this.lyric = data.lrc.lyric; return true + ifl; } From 3bc9d24677a90c8bc0ae81a2dd63f17f094d7d44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=BA=E5=B7=A5=E7=9F=A5=E8=83=BD?= <42119227+Kaitul@users.noreply.github.com> Date: Sun, 19 Dec 2021 16:46:35 +0800 Subject: [PATCH 16/30] fix: update zh-TW.js (#1087) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Localize translations 本地化翻譯 --- src/locale/lang/zh-TW.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/locale/lang/zh-TW.js b/src/locale/lang/zh-TW.js index 5e66d07..ff0b656 100644 --- a/src/locale/lang/zh-TW.js +++ b/src/locale/lang/zh-TW.js @@ -57,14 +57,14 @@ export default { search: '搜尋歌單內音樂', }, login: { - accessToAll: '可存取全部數據', - loginText: '登入網易雲帳號', - search: '搜尋網易雲帳號', - readonly: '只能讀取帳號公開數據', + accessToAll: '可存取全部資料', + loginText: '登入網易雲帳戶', + search: '搜尋網易雲帳戶', + readonly: '只能讀取帳戶公開資料', usernameLogin: '使用者名稱登入', searchHolder: '請輸入您的網易雲使用者名稱', enterTip: '按 Enter 搜尋', - choose: '在選單中選擇你的帳號', + choose: '在選單中選擇你的帳戶', confirm: '確認', countryCode: '國際區碼', phone: '手機號碼', @@ -73,15 +73,15 @@ export default { login: '登入', loginWithEmail: '信箱登入', loginWithPhone: '手機號碼登入', - notice: `YesPlayMusic 承諾不會保存您的任何帳號資訊到雲端。
+ notice: `YesPlayMusic 承諾不會保存您的任何帳戶資訊到雲端。
您的密碼會在本地進行 MD5 加密後再傳輸到網易雲 API。
- YesPlayMusic 並非網易雲官方網站,輸入帳號資訊前請慎重考慮。 您也可以前往 + YesPlayMusic 並非網易雲官方網站,輸入帳戶資訊前請慎重考慮。 您也可以前往 YesPlayMusic 的 GitHub 原始碼 Repo 自行編譯並使用自託管的網易雲 API。`, noticeElectron: `您的密碼會在本地進行 MD5 加密後再傳輸到網易雲 API。
- YesPlayMusic 不會傳輸你的帳號數據到任何非網易雲音樂官方的伺服器。
`, + YesPlayMusic 不會傳輸你的帳戶資料到任何非網易雲音樂官方的伺服器。
`, }, mv: { moreVideo: '更多影片', @@ -148,7 +148,7 @@ export default { clearSongsCache: '清除歌曲快取', cacheCount: '已快取 {song} 首 ({size})', showLyricsTranslation: '顯示歌詞翻譯', - minimizeToTray: '最小化到系統列', + minimizeToTray: '最小化到工作列角落', showPlaylistsByAppleMusic: '首頁顯示來自 Apple Music 的歌單', enableDiscordRichPresence: '啟用 Discord Rich Presence', enableGlobalShortcut: '啟用全域快捷鍵', @@ -164,7 +164,7 @@ export default { text: '關閉主面板時...', ask: '詢問', exit: '退出', - minimizeToTray: '最小化到系統列', + minimizeToTray: '最小化到工作列角落', }, }, contextMenu: { @@ -176,7 +176,7 @@ export default { removeFromLibrary: '從音樂庫刪除', addToPlaylist: '新增至歌單', searchInPlaylist: '歌單內搜尋', - copyUrl: '複製超連結', + copyUrl: '複製連結', allPlaylists: '全部歌單', minePlaylists: '我建立的歌單', likedPlaylists: '收藏的歌單', @@ -188,6 +188,6 @@ export default { removedFromMyLikedSongs: '已從喜歡的音樂中刪除', copied: '已複製', copyFailed: '複製失敗:', - needToLogin: '此動作需要登入網易雲帳號', + needToLogin: '此動作需要登入網易雲帳戶', }, }; From 16c36132672efc40af6077fd815e53713ce3cc13 Mon Sep 17 00:00:00 2001 From: pan93412 Date: Mon, 20 Dec 2021 18:56:26 +0800 Subject: [PATCH 17/30] feat: Use actively maintained unblockNeteaseMusic (#1105) * refactor: use @unblockneteasemusic/server we also use ipcMain.handle for unblock-music. * refactor(utils/nativeAlert): remove the deprecated "remote" * refactor(ipcMain): use our default sources * style(config/vue): prettier * feat(README): update for new UNM --- README.md | 4 +- package.json | 3 +- src/electron/ipcMain.js | 75 +++++- src/utils/Player.js | 4 +- src/utils/nativeAlert.js | 6 +- vue.config.js | 125 +++++----- yarn.lock | 498 ++++++++++++++++----------------------- 7 files changed, 335 insertions(+), 380 deletions(-) diff --git a/README.md b/README.md index 8fbc7e6..a0643d7 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,9 @@ - 📻 支持私人 FM / 每日推荐歌曲 - 🚫🤝 无任何社交功能 - 🌎️ 海外用户可直接播放(需要登录网易云账号) -- 🔐 支持 [UnblockNeteaseMusic](https://github.com/nondanee/UnblockNeteaseMusic)([使用 revincx 修复的 npm 包](https://github.com/revincx/UnblockNeteaseMusic)),自动使用 QQ/酷狗/酷我音源替换变灰歌曲链接 (网页版不支持) +- 🔐 支持 [UnblockNeteaseMusic](https://github.com/UnblockNeteaseMusic/server#音源清单),自动使用[各类音源](https://github.com/UnblockNeteaseMusic/server#音源清单)替换变灰歌曲链接 (网页版不支持) + - 「各类音源」指默认启用的音源。 + - YouTube 音源需自行安装 `yt-dlp`。 - ✔️ 每日自动签到(手机端和电脑端同时签到) - 🌚 Light/Dark Mode 自动切换 - 👆 支持 Touch Bar diff --git a/package.json b/package.json index 02c72b9..729c51c 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ }, "main": "background.js", "dependencies": { - "@revincx/unblockneteasemusic": "^0.25.7", + "@unblockneteasemusic/server": "v0.27.0-rc.4", "axios": "^0.21.0", "change-case": "^4.1.2", "cli-color": "^2.0.0", @@ -74,6 +74,7 @@ "vuex": "^3.4.0" }, "devDependencies": { + "@types/node": "^17.0.0", "@vue/cli-plugin-babel": "~4.5.0", "@vue/cli-plugin-eslint": "~4.5.0", "@vue/cli-plugin-pwa": "~4.5.0", diff --git a/src/electron/ipcMain.js b/src/electron/ipcMain.js index 839c34c..dc1fed6 100644 --- a/src/electron/ipcMain.js +++ b/src/electron/ipcMain.js @@ -1,5 +1,5 @@ import { app, dialog, globalShortcut, ipcMain } from 'electron'; -import match from '@revincx/unblockneteasemusic'; +import match from '@unblockneteasemusic/server'; import { registerGlobalShortcut } from '@/electron/globalShortcut'; import cloneDeep from 'lodash/cloneDeep'; import shortcuts from '@/utils/shortcuts'; @@ -12,28 +12,79 @@ const log = text => { const client = require('discord-rich-presence')('818936529484906596'); +/** + * Make data a Buffer. + * + * @param {?} data The data to convert. + * @returns {import("buffer").Buffer} The converted data. + */ +function toBuffer(data) { + if (data instanceof Buffer) { + return data; + } else { + return Buffer.from(data); + } +} + +/** + * Get the file URI from bilivideo. + * + * @param {string} url The URL to fetch. + * @returns {Promise} The file URI. + */ +async function getBiliVideoFile(url) { + const axios = await import('axios').then(m => m.default); + const response = await axios.get(url, { + headers: { + Referer: 'https://www.bilibili.com/', + 'User-Agent': 'okhttp/3.4.1', + }, + responseType: 'arraybuffer', + }); + + const buffer = toBuffer(response.data); + const encodedData = buffer.toString('base64'); + + return `data:application/octet-stream;base64,${encodedData}`; +} + export function initIpcMain(win, store) { - ipcMain.on('unblock-music', (event, track) => { + ipcMain.handle('unblock-music', async (_, track) => { // 兼容 unblockneteasemusic 所使用的 api 字段 track.alias = track.alia || []; track.duration = track.dt || 0; track.album = track.al || []; track.artists = track.ar || []; - const matchPromise = match(track.id, ['qq', 'kuwo', 'migu'], track); const timeoutPromise = new Promise((_, reject) => { setTimeout(() => { reject('timeout'); - }, 3000); + }, 5000); }); - Promise.race([matchPromise, timeoutPromise]) - .then(res => { - event.returnValue = res; - }) - .catch(err => { - log('unblock music error: ', err); - event.returnValue = null; - }); + + try { + const matchedAudio = await Promise.race([ + // TODO: tell users to install yt-dlp. + // we passed "null" to source, to let UNM choose the default source. + match(track.id, null, track), + timeoutPromise, + ]); + + if (!matchedAudio || !matchedAudio.url) { + throw new Error('no such a song found'); + } + + // bilibili's audio file needs some special treatment + if (matchedAudio.url.includes('bilivideo.com')) { + matchedAudio.url = await getBiliVideoFile(matchedAudio.url); + } + + return matchedAudio; + } catch (err) { + const errorMessage = err instanceof Error ? `${err.message}` : `${err}`; + log(`UnblockNeteaseMusic failed: ${errorMessage}`); + return null; + } }); ipcMain.on('close', e => { diff --git a/src/utils/Player.js b/src/utils/Player.js index 4f81941..f1c7f4f 100644 --- a/src/utils/Player.js +++ b/src/utils/Player.js @@ -269,7 +269,7 @@ export default class { }); } } - _getAudioSourceFromUnblockMusic(track) { + async _getAudioSourceFromUnblockMusic(track) { console.debug(`[debug][Player.js] _getAudioSourceFromUnblockMusic`); if ( process.env.IS_ELECTRON !== true || @@ -277,7 +277,7 @@ export default class { ) { return null; } - const source = ipcRenderer.sendSync('unblock-music', track); + const source = await ipcRenderer.invoke('unblock-music', track); if (store.state.settings.automaticallyCacheSongs && source?.url) { // TODO: 将unblockMusic字样换成真正的来源(比如酷我咪咕等) cacheTrackSource(track, source.url, 128000, 'unblockMusic'); diff --git a/src/utils/nativeAlert.js b/src/utils/nativeAlert.js index 64e716b..123cc70 100644 --- a/src/utils/nativeAlert.js +++ b/src/utils/nativeAlert.js @@ -13,14 +13,12 @@ */ const nativeAlert = (() => { if (process.env.IS_ELECTRON === true) { - const { - remote: { dialog }, - } = require('electron'); + const { dialog } = require('electron'); if (dialog) { return message => { var options = { type: 'warning', - detail: message, + message, }; dialog.showMessageBoxSync(null, options); }; diff --git a/vue.config.js b/vue.config.js index 80c80af..9d0abd7 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,4 +1,4 @@ -const path = require("path"); +const path = require('path'); function resolve(dir) { return path.join(__dirname, dir); } @@ -8,23 +8,23 @@ module.exports = { disableHostCheck: true, port: process.env.DEV_SERVER_PORT || 8080, proxy: { - "^/api": { - target: "http://localhost:3000", + '^/api': { + target: 'http://localhost:3000', changeOrigin: true, pathRewrite: { - "^/api": "/", + '^/api': '/', }, }, }, }, pwa: { - name: "YesPlayMusic", + name: 'YesPlayMusic', iconPaths: { - favicon32: "img/icons/favicon-32x32.png", + favicon32: 'img/icons/favicon-32x32.png', }, - themeColor: "#ffffff00", + themeColor: '#ffffff00', manifestOptions: { - background_color: "#335eea", + background_color: '#335eea', }, // workboxOptions: { // swSrc: "dev/sw.js", @@ -32,25 +32,25 @@ module.exports = { }, pages: { index: { - entry: "src/main.js", - template: "public/index.html", - filename: "index.html", - title: "YesPlayMusic", - chunks: ["main", "chunk-vendors", "chunk-common", "index"], + entry: 'src/main.js', + template: 'public/index.html', + filename: 'index.html', + title: 'YesPlayMusic', + chunks: ['main', 'chunk-vendors', 'chunk-common', 'index'], }, }, chainWebpack(config) { - config.module.rules.delete("svg"); - config.module.rule("svg").exclude.add(resolve("src/assets/icons")).end(); + config.module.rules.delete('svg'); + config.module.rule('svg').exclude.add(resolve('src/assets/icons')).end(); config.module - .rule("icons") + .rule('icons') .test(/\.svg$/) - .include.add(resolve("src/assets/icons")) + .include.add(resolve('src/assets/icons')) .end() - .use("svg-sprite-loader") - .loader("svg-sprite-loader") + .use('svg-sprite-loader') + .loader('svg-sprite-loader') .options({ - symbolId: "icon-[name]", + symbolId: 'icon-[name]', }) .end(); }, @@ -59,82 +59,85 @@ module.exports = { // electron-builder的配置文件 electronBuilder: { nodeIntegration: true, - externals: [ "@revincx/unblockneteasemusic" ], + externals: [ + '@unblockneteasemusic/server', + '@unblockneteasemusic/server/src/consts', + ], builderOptions: { - productName: "YesPlayMusic", - copyright: "Copyright © YesPlayMusic", + productName: 'YesPlayMusic', + copyright: 'Copyright © YesPlayMusic', // compression: "maximum", // 机器好的可以打开,配置压缩,开启后会让 .AppImage 格式的客户端启动缓慢 asar: true, publish: [ { - provider: "github", - owner: "qier222", - repo: "YesPlayMusic", + provider: 'github', + owner: 'qier222', + repo: 'YesPlayMusic', vPrefixedTagName: true, - releaseType: "draft", + releaseType: 'draft', }, ], directories: { - output: "dist_electron", + output: 'dist_electron', }, mac: { target: [ { - target: "dmg", - arch: ["x64", "arm64", "universal"], + target: 'dmg', + arch: ['x64', 'arm64', 'universal'], }, ], - artifactName: "${productName}-${os}-${version}-${arch}.${ext}", - category: "public.app-category.music", + artifactName: '${productName}-${os}-${version}-${arch}.${ext}', + category: 'public.app-category.music', darkModeSupport: true, }, win: { target: [ { - target: "portable", - arch: ["x64"], + target: 'portable', + arch: ['x64'], }, { - target: "nsis", - arch: ["x64"], + target: 'nsis', + arch: ['x64'], }, ], - publisherName: "YesPlayMusic", - icon: "build/icons/icon.ico", - publish: ["github"], + publisherName: 'YesPlayMusic', + icon: 'build/icons/icon.ico', + publish: ['github'], }, linux: { target: [ { - target: "AppImage", - arch: ["x64"], + target: 'AppImage', + arch: ['x64'], }, { - target: "tar.gz", - arch: ["x64"], + target: 'tar.gz', + arch: ['x64'], }, { - target: "deb", - arch: ["x64", "armv7l"], + target: 'deb', + arch: ['x64', 'armv7l'], }, { - target: "rpm", - arch: ["x64"], + target: 'rpm', + arch: ['x64'], }, { - target: "snap", - arch: ["x64"], + target: 'snap', + arch: ['x64'], }, { - target: "pacman", - arch: ["x64"], + target: 'pacman', + arch: ['x64'], }, ], - category: "Music", - icon: "./build/icon.icns", + category: 'Music', + icon: './build/icon.icns', }, dmg: { - icon: "build/icons/icon.icns", + icon: 'build/icons/icon.icns', }, nsis: { oneClick: true, @@ -143,25 +146,25 @@ module.exports = { }, }, // 主线程的配置文件 - chainWebpackMainProcess: (config) => { - config.plugin("define").tap((args) => { - args[0]["IS_ELECTRON"] = true; + chainWebpackMainProcess: config => { + config.plugin('define').tap(args => { + args[0]['IS_ELECTRON'] = true; return args; }); }, // 渲染线程的配置文件 - chainWebpackRendererProcess: (config) => { + chainWebpackRendererProcess: config => { // 渲染线程的一些其他配置 // Chain webpack config for electron renderer process only // The following example will set IS_ELECTRON to true in your app - config.plugin("define").tap((args) => { - args[0]["IS_ELECTRON"] = true; + config.plugin('define').tap(args => { + args[0]['IS_ELECTRON'] = true; return args; }); }, // 主入口文件 // mainProcessFile: 'src/main.js', - mainProcessWatch: ["../netease_api/routes.js"], + mainProcessWatch: ['../netease_api/routes.js'], // mainProcessArgs: [] }, }, diff --git a/yarn.lock b/yarn.lock index d6bd1ac..4df813a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -256,11 +256,6 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@7.13.13": - version "7.13.13" - resolved "https://registry.nlark.com/@babel/parser/download/@babel/parser-7.13.13.tgz#42f03862f4aed50461e543270916b47dd501f0df" - integrity sha1-QvA4YvSu1QRh5UMnCRa0fdUB8N8= - "@babel/parser@^7.12.13", "@babel/parser@^7.13.15", "@babel/parser@^7.7.0": version "7.13.15" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.13.15.tgz#8e66775fb523599acb6a289e12929fa5ab0954d8" @@ -867,15 +862,6 @@ debug "^4.1.0" globals "^11.1.0" -"@babel/types@7.13.12": - version "7.13.12" - resolved "https://registry.nlark.com/@babel/types/download/@babel/types-7.13.12.tgz?cache=0&sync_timestamp=1620839476067&other_urls=https%3A%2F%2Fregistry.nlark.com%2F%40babel%2Ftypes%2Fdownload%2F%40babel%2Ftypes-7.13.12.tgz#edbf99208ef48852acdff1c8a681a1e4ade580cd" - integrity sha1-7b+ZII70iFKs3/HIpoGh5K3lgM0= - dependencies: - "@babel/helper-validator-identifier" "^7.12.11" - lodash "^4.17.19" - to-fast-properties "^2.0.0" - "@babel/types@^7.0.0", "@babel/types@^7.12.1", "@babel/types@^7.12.13", "@babel/types@^7.13.0", "@babel/types@^7.13.12", "@babel/types@^7.13.14", "@babel/types@^7.4.4", "@babel/types@^7.7.0": version "7.13.14" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.13.14.tgz#c35a4abb15c7cd45a2746d78ab328e362cbace0d" @@ -894,9 +880,9 @@ ajv-keywords "^3.4.1" "@electron/get@^1.0.1": - version "1.12.4" - resolved "https://registry.yarnpkg.com/@electron/get/-/get-1.12.4.tgz#a5971113fc1bf8fa12a8789dc20152a7359f06ab" - integrity sha512-6nr9DbJPUR9Xujw6zD3y+rS95TyItEVM0NVjt1EehY2vUWfIgPiIPVHxCvaTS0xr2B+DRxovYVKbuOWqC35kjg== + version "1.13.1" + resolved "https://registry.yarnpkg.com/@electron/get/-/get-1.13.1.tgz#42a0aa62fd1189638bd966e23effaebb16108368" + integrity sha512-U5vkXDZ9DwXtkPqlB45tfYnnYBN8PePp1z/XDCupnSpdrxT8/ThCv9WCwPLf9oqiSGZTkH6dx2jDUPuoXpjkcA== dependencies: debug "^4.1.1" env-paths "^2.2.0" @@ -906,7 +892,7 @@ semver "^6.2.0" sumchecker "^3.0.1" optionalDependencies: - global-agent "^2.0.2" + global-agent "^3.0.0" global-tunnel-ng "^2.7.1" "@electron/universal@1.0.4": @@ -1428,13 +1414,6 @@ mkdirp "^1.0.4" rimraf "^3.0.2" -"@revincx/unblockneteasemusic@^0.25.7": - version "0.25.7" - resolved "https://registry.nlark.com/@revincx/unblockneteasemusic/download/@revincx/unblockneteasemusic-0.25.7.tgz#eb42cc147a46f15fb565fdf244a4cfc5df37af6a" - integrity sha1-60LMFHpG8V+1Zf3yRKTPxd83r2o= - dependencies: - pkg "^5.1.0" - "@sindresorhus/is@^0.14.0": version "0.14.0" resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea" @@ -1581,6 +1560,11 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.60.tgz#35f3d6213daed95da7f0f73e75bcc6980e90597b" integrity sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw== +"@types/node@^17.0.0": + version "17.0.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.0.tgz#62797cee3b8b497f6547503b2312254d4fe3c2bb" + integrity sha512-eMhwJXc931Ihh4tkU+Y7GiLzT/y/DBNpNtr4yU9O2w3SYBsr9NaOPhQlLKRmoWtI54uNwuo0IOUFQjVOTZYRvw== + "@types/normalize-package-data@^2.4.0": version "2.4.0" resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e" @@ -1708,6 +1692,15 @@ dependencies: "@types/node" "*" +"@unblockneteasemusic/server@v0.27.0-rc.4": + version "0.27.0-rc.4" + resolved "https://registry.yarnpkg.com/@unblockneteasemusic/server/-/server-0.27.0-rc.4.tgz#56f057fde01f86cb9ed273f63fe66f0e115e8c4f" + integrity sha512-fqFStb71/N9Ek9VoYRF4ConMc1A7LJBBCzOz2Haq3UnXi4W7tlvWb038ih/qh7wH03/qJGLDxxD3oThJQHJFZQ== + dependencies: + node-windows "^1.0.0-beta.6" + pino "6" + pino-pretty "^7.1.0" + "@vue/babel-helper-vue-jsx-merge-props@^1.2.1": version "1.2.1" resolved "https://registry.yarnpkg.com/@vue/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-1.2.1.tgz#31624a7a505fb14da1d58023725a4c5f270e6a81" @@ -2339,7 +2332,7 @@ app-builder-lib@22.10.5: semver "^7.3.4" temp-file "^3.3.7" -aproba@^1.0.3, aproba@^1.1.1: +aproba@^1.1.1: version "1.2.0" resolved "https://registry.nlark.com/aproba/download/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" integrity sha1-aALmJk79GMeQobDVF/DyYnvyyUo= @@ -2349,14 +2342,6 @@ arch@^2.1.1: resolved "https://registry.yarnpkg.com/arch/-/arch-2.2.0.tgz#1bc47818f305764f23ab3306b0bfc086c5a29d11" integrity sha512-Of/R0wqp83cgHozfIYLbBMnej79U/SVGOOyuB3VVFv1NRM/PSFMK12x9KVtiYzJqmnU5WR2qp0Z5rHb7sWGnFQ== -are-we-there-yet@~1.1.2: - version "1.1.5" - resolved "https://registry.npm.taobao.org/are-we-there-yet/download/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" - integrity sha1-SzXClE8GKov82mZBB2A1D+nd/CE= - dependencies: - delegates "^1.0.0" - readable-stream "^2.0.6" - argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" @@ -2369,7 +2354,7 @@ argparse@^2.0.1: resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== -args@^5.0.0: +args@^5.0.0, args@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/args/-/args-5.0.1.tgz#4bf298df90a4799a09521362c579278cc2fdd761" integrity sha512-1kqmFCFsPffavQFGt8OxJdIcETti99kySRUPMpOhaGjL6mRJn8HFU1OxKY5bMqfZKUwTQc1mZkAjmGYaVOHFtQ== @@ -2532,6 +2517,11 @@ atob@^2.1.2: resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== +atomic-sleep@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/atomic-sleep/-/atomic-sleep-1.0.0.tgz#eb85b77a601fc932cfe432c5acd364a9e2c9075b" + integrity sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ== + atomically@^1.3.1: version "1.7.0" resolved "https://registry.yarnpkg.com/atomically/-/atomically-1.7.0.tgz#c07a0458432ea6dbc9a3506fffa424b48bccaafe" @@ -2730,15 +2720,6 @@ bindings@^1.3.0, bindings@^1.5.0: dependencies: file-uri-to-path "1.0.0" -bl@^4.0.3: - version "4.1.0" - resolved "https://registry.nlark.com/bl/download/bl-4.1.0.tgz#451535264182bec2fbbc83a62ab98cf11d9f7b3a" - integrity sha1-RRU1JkGCvsL7vIOmKrmM8R2fezo= - dependencies: - buffer "^5.5.0" - inherits "^2.0.4" - readable-stream "^3.4.0" - bluebird-lst@^1.0.9: version "1.0.9" resolved "https://registry.yarnpkg.com/bluebird-lst/-/bluebird-lst-1.0.9.tgz#a64a0e4365658b9ab5fe875eb9dfb694189bb41c" @@ -2988,7 +2969,7 @@ buffer@^4.3.0: ieee754 "^1.1.4" isarray "^1.0.0" -buffer@^5.1.0, buffer@^5.2.0, buffer@^5.4.3, buffer@^5.5.0: +buffer@^5.1.0, buffer@^5.2.0, buffer@^5.4.3: version "5.7.1" resolved "https://registry.nlark.com/buffer/download/buffer-5.7.1.tgz?cache=0&sync_timestamp=1618846959596&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fbuffer%2Fdownload%2Fbuffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" integrity sha1-umLnwTEzBTWCGXFghRqPZI6Z7tA= @@ -3623,6 +3604,11 @@ colorette@^1.2.1, colorette@^1.2.2: resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.2.tgz#cbcc79d5e99caea2dbf10eb3a26fd8b3e6acfa94" integrity sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w== +colorette@^2.0.7: + version "2.0.16" + resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.16.tgz#713b9af84fdb000139f04546bd4a93f62a5085da" + integrity sha512-hUewv7oMjCp+wkBv5Rm0v87eJhq4woh5rSR+42YSQJKecCqgIqNkZ6lAlQms/BwHPJA5NKMRlpxPRv0n8HQW6g== + colors@1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/colors/-/colors-1.0.3.tgz#0433f44d809680fdeb60ed260f1b0c262e82a40b" @@ -3768,11 +3754,6 @@ console-browserify@^1.1.0: resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.2.0.tgz#67063cef57ceb6cf4993a2ab3a55840ae8c49336" integrity sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA== -console-control-strings@^1.0.0, console-control-strings@~1.1.0: - version "1.1.0" - resolved "https://registry.nlark.com/console-control-strings/download/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" - integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= - consolidate@^0.15.1: version "0.15.1" resolved "https://registry.yarnpkg.com/consolidate/-/consolidate-0.15.1.tgz#21ab043235c71a07d45d9aad98593b0dba56bab7" @@ -4179,6 +4160,11 @@ data-uri-to-buffer@3: resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-3.0.1.tgz#594b8973938c5bc2c33046535785341abc4f3636" integrity sha512-WboRycPNsVw3B3TL559F7kuBUM4d8CgMEvk6xEJlOp7OBPjt6G7z8WMWlD2rOFZLk6OYfFIUGsCOWzcQH9K2og== +dateformat@^4.6.3: + version "4.6.3" + resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-4.6.3.tgz#556fa6497e5217fedb78821424f8a1c22fa3f4b5" + integrity sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA== + dayjs@^1.8.36: version "1.10.4" resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.10.4.tgz#8e544a9b8683f61783f570980a8a80eaf54ab1e2" @@ -4241,13 +4227,6 @@ decompress-response@^3.3.0: dependencies: mimic-response "^1.0.0" -decompress-response@^4.2.0: - version "4.2.1" - resolved "https://registry.npm.taobao.org/decompress-response/download/decompress-response-4.2.1.tgz?cache=0&sync_timestamp=1613125280468&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdecompress-response%2Fdownload%2Fdecompress-response-4.2.1.tgz#414023cc7a302da25ce2ec82d0d5238ccafd8986" - integrity sha1-QUAjzHowLaJc4uyC0NUjjMr9iYY= - dependencies: - mimic-response "^2.0.0" - deep-equal@^1.0.1: version "1.1.1" resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.1.1.tgz#b5c98c942ceffaf7cb051e24e1434a25a2e6076a" @@ -4382,11 +4361,6 @@ delegate@^3.1.2: resolved "https://registry.nlark.com/delegate/download/delegate-3.2.0.tgz#b66b71c3158522e8ab5744f720d8ca0c2af59166" integrity sha1-tmtxwxWFIuirV0T3INjKDCr1kWY= -delegates@^1.0.0: - version "1.0.0" - resolved "https://registry.npm.taobao.org/delegates/download/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" - integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= - depd@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" @@ -4405,11 +4379,6 @@ destroy@~1.0.4: resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= -detect-libc@^1.0.3: - version "1.0.3" - resolved "https://registry.npm.taobao.org/detect-libc/download/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" - integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= - detect-node@^2.0.4: version "2.0.5" resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.0.5.tgz#9d270aa7eaa5af0b72c4c9d9b814e7f4ce738b79" @@ -4647,6 +4616,16 @@ duplexify@^4.1.1: readable-stream "^3.1.1" stream-shift "^1.0.0" +duplexify@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-4.1.2.tgz#18b4f8d28289132fa0b9573c898d9f903f81c7b0" + integrity sha512-fz3OjcNCHmRP12MJoZMPglx8m4rrFP8rovnk4vT8Fs+aonZoCwGg10dSsQsfP/E62eZcPTMSMP6686fu9Qlqtw== + dependencies: + end-of-stream "^1.4.1" + inherits "^2.0.3" + readable-stream "^3.1.1" + stream-shift "^1.0.0" + easy-stack@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/easy-stack/-/easy-stack-1.0.1.tgz#8afe4264626988cabb11f3c704ccd0c835411066" @@ -4816,9 +4795,9 @@ electron-updater@^4.3.5: semver "^7.3.4" electron@^13.0.1: - version "13.0.1" - resolved "https://registry.yarnpkg.com/electron/-/electron-13.0.1.tgz#7dd3666f0f966ab83a1f9868d84add2e6205d43a" - integrity sha512-ds1cf0m46nStil0jbM2r9W/p+Kprdq22+2MikIUqEu69eGl1c86IinQVrpmJ9bR4RshDSF4j3uD32a0bsHDMnQ== + version "13.6.3" + resolved "https://registry.yarnpkg.com/electron/-/electron-13.6.3.tgz#c0217178807d3e0b2175c49dbe33ea8dac447e73" + integrity sha512-kevgR6/RuEhchJQbgCKhHle9HvJhi2dOJlicFZJqbbqa9BVpZARqqFDlwTSatYxmUPUJwu09FvyMwJG2DMQIng== dependencies: "@electron/get" "^1.0.1" "@types/node" "^14.6.2" @@ -5033,18 +5012,6 @@ escodegen@^1.8.1: optionalDependencies: source-map "~0.6.1" -escodegen@^2.0.0: - version "2.0.0" - resolved "https://registry.nlark.com/escodegen/download/escodegen-2.0.0.tgz#5e32b12833e8aa8fa35e1bf0befa89380484c7dd" - integrity sha1-XjKxKDPoqo+jXhvwvvqJOASEx90= - dependencies: - esprima "^4.0.1" - estraverse "^5.2.0" - esutils "^2.0.2" - optionator "^0.8.1" - optionalDependencies: - source-map "~0.6.1" - eslint-config-prettier@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.1.0.tgz#4ef1eaf97afe5176e6a75ddfb57c335121abc5a6" @@ -5317,11 +5284,6 @@ expand-brackets@^2.1.4: snapdragon "^0.8.1" to-regex "^3.0.1" -expand-template@^2.0.3: - version "2.0.3" - resolved "https://registry.npm.taobao.org/expand-template/download/expand-template-2.0.3.tgz#6e14b3fcee0f3a6340ecb57d2e8918692052a47c" - integrity sha1-bhSz/O4POmNA7LV9LokYaSBSpHw= - express-fileupload@^1.2.0: version "1.2.1" resolved "https://registry.yarnpkg.com/express-fileupload/-/express-fileupload-1.2.1.tgz#73ac798bd14247d510adb1e439af2420c8367ded" @@ -5514,6 +5476,21 @@ fast-levenshtein@~2.0.6: resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= +fast-redact@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/fast-redact/-/fast-redact-3.0.2.tgz#c940ba7162dde3aeeefc522926ae8c5231412904" + integrity sha512-YN+CYfCVRVMUZOUPeinHNKgytM1wPI/C/UCLEi56EsY2dwwvI00kIJHJoI7pMVqGoMew8SMZ2SSfHKHULHXDsg== + +fast-safe-stringify@^2.0.7, fast-safe-stringify@^2.0.8: + version "2.1.1" + resolved "https://registry.yarnpkg.com/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz#c406a83b6e70d9e35ce3b30a81141df30aeba884" + integrity sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA== + +fastify-warning@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/fastify-warning/-/fastify-warning-0.2.0.tgz#e717776026a4493dc9a2befa44db6d17f618008f" + integrity sha512-s1EQguBw/9qtc1p/WTY4eq9WMRIACkj+HTcOIK1in4MV5aFaQC9ZCIt0dJ7pr5bIf4lPpHvAtP2ywpTNgs7hqw== + fastq@^1.6.0: version "1.11.0" resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.11.0.tgz#bb9fb955a07130a918eb63c1f5161cc32a5d0858" @@ -5707,6 +5684,11 @@ flat-cache@^2.0.1: rimraf "2.6.3" write "1.0.3" +flatstr@^1.0.12: + version "1.0.12" + resolved "https://registry.yarnpkg.com/flatstr/-/flatstr-1.0.12.tgz#c2ba6a08173edbb6c9640e3055b95e287ceb5931" + integrity sha512-4zPxDyhCyiN2wIAtSLI6gc82/EjqZc1onI4Mz/l0pWrAlsSfYH/2ZIcU+e3oA2wDwbzIWNKwa23F8rh6+DRWkw== + flatted@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.2.tgz#4575b21e2bcee7434aa9be662f4b7b5f9c2b5138" @@ -5770,7 +5752,7 @@ friendly-errors-webpack-plugin@^1.7.0: error-stack-parser "^2.0.0" string-width "^2.0.0" -from2@^2.1.0, from2@^2.3.0: +from2@^2.1.0: version "2.3.0" resolved "https://registry.nlark.com/from2/download/from2-2.3.0.tgz#8bfb5502bde4a4d36cfdeea007fcca21d7e382af" integrity sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8= @@ -5778,11 +5760,6 @@ from2@^2.1.0, from2@^2.3.0: inherits "^2.0.1" readable-stream "^2.0.0" -fs-constants@^1.0.0: - version "1.0.0" - resolved "https://registry.npm.taobao.org/fs-constants/download/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" - integrity sha1-a+Dem+mYzhavivwkSXue6bfM2a0= - fs-extra@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-1.0.0.tgz#cd3ce5f7e7cb6145883fcae3191e9877f8587950" @@ -5882,20 +5859,6 @@ functional-red-black-tree@^1.0.1: resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= -gauge@~2.7.3: - version "2.7.4" - resolved "https://registry.npm.taobao.org/gauge/download/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" - integrity sha1-LANAXHU4w51+s3sxcCLjJfsBi/c= - dependencies: - aproba "^1.0.3" - console-control-strings "^1.0.0" - has-unicode "^2.0.0" - object-assign "^4.1.0" - signal-exit "^3.0.0" - string-width "^1.0.1" - strip-ansi "^3.0.1" - wide-align "^1.1.0" - gensync@^1.0.0-beta.2: version "1.0.0-beta.2" resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" @@ -5981,11 +5944,6 @@ gifwrap@^0.9.2: image-q "^1.1.1" omggif "^1.0.10" -github-from-package@0.0.0: - version "0.0.0" - resolved "https://registry.npm.taobao.org/github-from-package/download/github-from-package-0.0.0.tgz#97fb5d96bfde8973313f20e8288ef9a167fa64ce" - integrity sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4= - glob-parent@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" @@ -6018,13 +5976,12 @@ glob@^7.0.3, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6: once "^1.3.0" path-is-absolute "^1.0.0" -global-agent@^2.0.2: - version "2.2.0" - resolved "https://registry.yarnpkg.com/global-agent/-/global-agent-2.2.0.tgz#566331b0646e6bf79429a16877685c4a1fbf76dc" - integrity sha512-+20KpaW6DDLqhG7JDiJpD1JvNvb8ts+TNl7BPOYcURqCrXqnN1Vf+XVOrkKJAFPqfX+oEhsdzOj1hLWkBTdNJg== +global-agent@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/global-agent/-/global-agent-3.0.0.tgz#ae7cd31bd3583b93c5a16437a1afe27cc33a1ab6" + integrity sha512-PT6XReJ+D07JvGoxQMkT6qji/jVNfX/h364XHZOWeRzy64sSFr+xJ5OX7LI3b4MPQzdL4H8Y8M0xzPpsVMwA8Q== dependencies: boolean "^3.0.1" - core-js "^3.6.5" es6-error "^4.1.1" matcher "^3.0.0" roarr "^2.15.3" @@ -6075,7 +6032,7 @@ globalthis@^1.0.1: dependencies: define-properties "^1.1.3" -globby@^11.0.1, globby@^11.0.3: +globby@^11.0.1: version "11.0.3" resolved "https://registry.nlark.com/globby/download/globby-11.0.3.tgz?cache=0&sync_timestamp=1618846983468&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fglobby%2Fdownload%2Fglobby-11.0.3.tgz#9b1f0cb523e171dd1ad8c7b2a9fb4b644b9593cb" integrity sha1-mx8MtSPhcd0a2MeyqftLZEuVk8s= @@ -6216,11 +6173,6 @@ has-symbols@^1.0.1, has-symbols@^1.0.2: resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.2.tgz#165d3070c00309752a1236a479331e3ac56f1423" integrity sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw== -has-unicode@^2.0.0: - version "2.0.1" - resolved "https://registry.npm.taobao.org/has-unicode/download/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" - integrity sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk= - has-value@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" @@ -6533,7 +6485,7 @@ https-browserify@^1.0.0: resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" integrity sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM= -https-proxy-agent@5, https-proxy-agent@^5.0.0: +https-proxy-agent@5: version "5.0.0" resolved "https://registry.nlark.com/https-proxy-agent/download/https-proxy-agent-5.0.0.tgz#e2a90542abb68a762e0a0850f6c9edadfd8506b2" integrity sha1-4qkFQqu2inYuCghQ9sntrf2FBrI= @@ -6771,14 +6723,6 @@ internal-ip@^4.3.0: default-gateway "^4.2.0" ipaddr.js "^1.9.0" -into-stream@^6.0.0: - version "6.0.0" - resolved "https://registry.npm.taobao.org/into-stream/download/into-stream-6.0.0.tgz#4bfc1244c0128224e18b8870e85b2de8e66c6702" - integrity sha1-S/wSRMASgiThi4hw6Fst6OZsZwI= - dependencies: - from2 "^2.3.0" - p-is-promise "^3.0.0" - invert-kv@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" @@ -7262,6 +7206,11 @@ jimp@^0.9.3: core-js "^3.4.1" regenerator-runtime "^0.13.3" +joycon@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/joycon/-/joycon-3.1.1.tgz#bce8596d6ae808f8b68168f5fc69280996894f03" + integrity sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw== + jpeg-js@0.4.2: version "0.4.2" resolved "https://registry.yarnpkg.com/jpeg-js/-/jpeg-js-0.4.2.tgz#8b345b1ae4abde64c2da2fe67ea216a114ac279d" @@ -8028,11 +7977,6 @@ mimic-response@^1.0.0, mimic-response@^1.0.1: resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ== -mimic-response@^2.0.0: - version "2.1.0" - resolved "https://registry.nlark.com/mimic-response/download/mimic-response-2.1.0.tgz#d13763d35f613d09ec37ebb30bac0469c0ee8f43" - integrity sha1-0Tdj019hPQnsN+uzC6wEacDuj0M= - min-document@^2.19.0: version "2.19.0" resolved "https://registry.yarnpkg.com/min-document/-/min-document-2.19.0.tgz#7bd282e3f5842ed295bb748cdd9f1ffa2c824685" @@ -8067,11 +8011,16 @@ minimatch@3.0.4, minimatch@^3.0.4: dependencies: brace-expansion "^1.1.7" -minimist@^1.2.0, minimist@^1.2.3, minimist@^1.2.5: +minimist@^1.2.0, minimist@^1.2.5: version "1.2.5" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== +minimist@~0.0.1: + version "0.0.10" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" + integrity sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8= + minipass-collect@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/minipass-collect/-/minipass-collect-1.0.2.tgz#22b813bf745dc6edba2576b940022ad6edc8c617" @@ -8137,11 +8086,6 @@ mixin-deep@^1.2.0: for-in "^1.0.2" is-extendable "^1.0.1" -mkdirp-classic@^0.5.2, mkdirp-classic@^0.5.3: - version "0.5.3" - resolved "https://registry.nlark.com/mkdirp-classic/download/mkdirp-classic-0.5.3.tgz#fa10c9115cc6d8865be221ba47ee9bed78601113" - integrity sha1-+hDJEVzG2IZb4iG6R+6b7XhgERM= - mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@^0.5.4, mkdirp@^0.5.5, mkdirp@~0.5.1: version "0.5.5" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" @@ -8209,14 +8153,6 @@ multicast-dns@^6.0.1: dns-packet "^1.3.1" thunky "^1.0.2" -multistream@^4.1.0: - version "4.1.0" - resolved "https://registry.npm.taobao.org/multistream/download/multistream-4.1.0.tgz#7bf00dfd119556fbc153cff3de4c6d477909f5a8" - integrity sha1-e/AN/RGVVvvBU8/z3kxtR3kJ9ag= - dependencies: - once "^1.4.0" - readable-stream "^3.6.0" - music-metadata@^7.5.3: version "7.8.6" resolved "https://registry.yarnpkg.com/music-metadata/-/music-metadata-7.8.6.tgz#e511f9c1756d5aef8378b76b46ab5bdab0fc4efd" @@ -8265,11 +8201,6 @@ nanomatch@^1.2.1, nanomatch@^1.2.9: snapdragon "^0.8.1" to-regex "^3.0.1" -napi-build-utils@^1.0.1: - version "1.0.2" - resolved "https://registry.npm.taobao.org/napi-build-utils/download/napi-build-utils-1.0.2.tgz#b1fddc0b2c46e380a0b7a76f984dd47c41a13806" - integrity sha1-sf3cCyxG44Cgt6dvmE3UfEGhOAY= - natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" @@ -8320,13 +8251,6 @@ no-case@^3.0.4: lower-case "^2.0.2" tslib "^2.0.3" -node-abi@^2.7.0: - version "2.26.0" - resolved "https://registry.nlark.com/node-abi/download/node-abi-2.26.0.tgz#355d5d4bc603e856f74197adbf3f5117a396ba40" - integrity sha1-NV1dS8YD6Fb3QZetvz9RF6OWukA= - dependencies: - semver "^5.4.1" - node-addon-api@^1.3.0, node-addon-api@^1.6.3: version "1.7.2" resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-1.7.2.tgz#3df30b95720b53c24e59948b49532b662444f54d" @@ -8398,10 +8322,13 @@ node-vibrant@^3.1.6: lodash "^4.17.20" url "^0.11.0" -noop-logger@^0.1.1: - version "0.1.1" - resolved "https://registry.npm.taobao.org/noop-logger/download/noop-logger-0.1.1.tgz#94a2b1633c4f1317553007d8966fd0e841b6a4c2" - integrity sha1-lKKxYzxPExdVMAfYlm/Q6EG2pMI= +node-windows@^1.0.0-beta.6: + version "1.0.0-beta.6" + resolved "https://registry.yarnpkg.com/node-windows/-/node-windows-1.0.0-beta.6.tgz#04bf66946760bb8507f1d1326267587b56b8c8b3" + integrity sha512-Ehig70tF9A9Wns4VMpnsvT7dyat/d2fio6C4g1RAEaAi+piAjN6Wc+/fdSOifl8YCCncVllijv5Q9wdyHvdgeA== + dependencies: + optimist "~0.6.0" + xml "0.0.12" normalize-package-data@^2.3.2, normalize-package-data@^2.5.0: version "2.5.0" @@ -8487,16 +8414,6 @@ npm-run-path@^4.0.0, npm-run-path@^4.0.1: dependencies: path-key "^3.0.0" -npmlog@^4.0.1: - version "4.1.2" - resolved "https://registry.nlark.com/npmlog/download/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" - integrity sha1-CKfyqL9zRgR3mp76StXMcXq7lUs= - dependencies: - are-we-there-yet "~1.1.2" - console-control-strings "~1.1.0" - gauge "~2.7.3" - set-blocking "~2.0.0" - nprogress@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/nprogress/-/nprogress-0.2.0.tgz#cb8f34c53213d895723fcbab907e9422adbcafb1" @@ -8671,6 +8588,14 @@ opn@^5.5.0: dependencies: is-wsl "^1.1.0" +optimist@~0.6.0: + version "0.6.1" + resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" + integrity sha1-2j6nRob6IaGaERwybpDrFaAZZoY= + dependencies: + minimist "~0.0.1" + wordwrap "~0.0.2" + optionator@^0.8.1, optionator@^0.8.3: version "0.8.3" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" @@ -8734,11 +8659,6 @@ p-finally@^2.0.0: resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-2.0.1.tgz#bd6fcaa9c559a096b680806f4d657b3f0f240561" integrity sha512-vpm09aKwq6H9phqRQzecoDpD8TmVyGw70qmWlyq5onxY7tqyTTFVvxMykxQSQKILBSFlbXpypIw2T1Ml7+DDtw== -p-is-promise@^3.0.0: - version "3.0.0" - resolved "https://registry.npm.taobao.org/p-is-promise/download/p-is-promise-3.0.0.tgz?cache=0&sync_timestamp=1618557038207&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fp-is-promise%2Fdownload%2Fp-is-promise-3.0.0.tgz#58e78c7dfe2e163cf2a04ff869e7c1dba64a5971" - integrity sha1-WOeMff4uFjzyoE/4aefB26ZKWXE= - p-limit@^2.0.0, p-limit@^2.2.0, p-limit@^2.2.1, p-limit@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" @@ -9133,6 +9053,50 @@ pinkie@^2.0.0: resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA= +pino-abstract-transport@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/pino-abstract-transport/-/pino-abstract-transport-0.5.0.tgz#4b54348d8f73713bfd14e3dc44228739aa13d9c0" + integrity sha512-+KAgmVeqXYbTtU2FScx1XS3kNyfZ5TrXY07V96QnUSFqo2gAqlvmaxH67Lj7SWazqsMabf+58ctdTcBgnOLUOQ== + dependencies: + duplexify "^4.1.2" + split2 "^4.0.0" + +pino-pretty@^7.1.0: + version "7.3.0" + resolved "https://registry.yarnpkg.com/pino-pretty/-/pino-pretty-7.3.0.tgz#277fdc2306a2f6d727a1127e7747d1c078efdd4b" + integrity sha512-HAhShJ2z2QzxXhYAn6XfwYpF13o1PQbjzSNA9q+30FAvhjOmeACit9lprhV/mCOw/8YFWSyyNk0YCq2EDYGYpw== + dependencies: + args "^5.0.1" + colorette "^2.0.7" + dateformat "^4.6.3" + fast-safe-stringify "^2.0.7" + joycon "^3.1.1" + pino-abstract-transport "^0.5.0" + pump "^3.0.0" + readable-stream "^3.6.0" + rfdc "^1.3.0" + secure-json-parse "^2.4.0" + sonic-boom "^2.2.0" + strip-json-comments "^3.1.1" + +pino-std-serializers@^3.1.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/pino-std-serializers/-/pino-std-serializers-3.2.0.tgz#b56487c402d882eb96cd67c257868016b61ad671" + integrity sha512-EqX4pwDPrt3MuOAAUBMU0Tk5kR/YcCM5fNPEzgCO2zJ5HfX0vbiH9HbJglnyeQsN96Kznae6MWD47pZB5avTrg== + +pino@6: + version "6.13.3" + resolved "https://registry.yarnpkg.com/pino/-/pino-6.13.3.tgz#60b93bcda1541f92fb37b3f2be0a25cf1d05b6fe" + integrity sha512-tJy6qVgkh9MwNgqX1/oYi3ehfl2Y9H0uHyEEMsBe74KinESIjdMrMQDWpcZPpPicg3VV35d/GLQZmo4QgU2Xkg== + dependencies: + fast-redact "^3.0.0" + fast-safe-stringify "^2.0.8" + fastify-warning "^0.2.0" + flatstr "^1.0.12" + pino-std-serializers "^3.1.0" + quick-format-unescaped "^4.0.3" + sonic-boom "^1.0.2" + pixelmatch@^4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/pixelmatch/-/pixelmatch-4.0.2.tgz#8f47dcec5011b477b67db03c243bc1f3085e8854" @@ -9168,19 +9132,6 @@ pkg-dir@^5.0.0: dependencies: find-up "^5.0.0" -pkg-fetch@3.1.1: - version "3.1.1" - resolved "https://registry.nlark.com/pkg-fetch/download/pkg-fetch-3.1.1.tgz#8f94115d926e71359ed96c211fe022b7a2452f8d" - integrity sha1-j5QRXZJucTWe2WwhH+Ait6JFL40= - dependencies: - chalk "^4.1.0" - fs-extra "^9.1.0" - https-proxy-agent "^5.0.0" - node-fetch "^2.6.1" - progress "^2.0.3" - semver "^7.3.5" - yargs "^16.2.0" - pkg-up@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/pkg-up/-/pkg-up-3.1.0.tgz#100ec235cc150e4fd42519412596a28512a0def5" @@ -9188,27 +9139,6 @@ pkg-up@^3.1.0: dependencies: find-up "^3.0.0" -pkg@^5.1.0: - version "5.2.1" - resolved "https://registry.nlark.com/pkg/download/pkg-5.2.1.tgz#929294d2dedbcd4427cfc00121a80c151a2a1d4c" - integrity sha1-kpKU0t7bzUQnz8ABIagMFRoqHUw= - dependencies: - "@babel/parser" "7.13.13" - "@babel/types" "7.13.12" - chalk "^4.1.0" - escodegen "^2.0.0" - fs-extra "^9.1.0" - globby "^11.0.3" - into-stream "^6.0.0" - minimist "^1.2.5" - multistream "^4.1.0" - pkg-fetch "3.1.1" - prebuild-install "6.0.1" - progress "^2.0.3" - resolve "^1.20.0" - stream-meter "^1.0.4" - tslib "2.1.0" - please-upgrade-node@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz#aeddd3f994c933e4ad98b99d9a556efa0e2fe942" @@ -9662,27 +9592,6 @@ posthtml@^0.9.2: posthtml-parser "^0.2.0" posthtml-render "^1.0.5" -prebuild-install@6.0.1: - version "6.0.1" - resolved "https://registry.nlark.com/prebuild-install/download/prebuild-install-6.0.1.tgz#5902172f7a40eb67305b96c2a695db32636ee26d" - integrity sha1-WQIXL3pA62cwW5bCppXbMmNu4m0= - dependencies: - detect-libc "^1.0.3" - expand-template "^2.0.3" - github-from-package "0.0.0" - minimist "^1.2.3" - mkdirp-classic "^0.5.3" - napi-build-utils "^1.0.1" - node-abi "^2.7.0" - noop-logger "^0.1.1" - npmlog "^4.0.1" - pump "^3.0.0" - rc "^1.2.7" - simple-get "^3.0.3" - tar-fs "^2.0.0" - tunnel-agent "^0.6.0" - which-pm-runs "^1.0.0" - prelude-ls@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" @@ -9905,6 +9814,11 @@ queue-microtask@^1.2.2: resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== +quick-format-unescaped@^4.0.3: + version "4.0.4" + resolved "https://registry.yarnpkg.com/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz#93ef6dd8d3453cbc7970dd614fad4c5954d6b5a7" + integrity sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg== + randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5, randombytes@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" @@ -9950,7 +9864,7 @@ raw-body@^2.2.0, raw-body@^2.3.0: iconv-lite "0.4.24" unpipe "1.0.0" -rc@^1.2.7, rc@^1.2.8: +rc@^1.2.8: version "1.2.8" resolved "https://registry.nlark.com/rc/download/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" integrity sha1-zZJL9SAKB1uDwYjNa54hG3/A0+0= @@ -9998,7 +9912,7 @@ read-pkg@^5.1.1: parse-json "^5.0.0" type-fest "^0.6.0" -"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.1.4, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.6, readable-stream@~2.3.6: +"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.6, readable-stream@~2.3.6: version "2.3.7" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== @@ -10021,7 +9935,7 @@ readable-stream@1.1.x: isarray "0.0.1" string_decoder "~0.10.x" -readable-stream@^3.0.0, readable-stream@^3.0.6, readable-stream@^3.1.1, readable-stream@^3.4.0, readable-stream@^3.6.0: +readable-stream@^3.0.0, readable-stream@^3.0.6, readable-stream@^3.1.1, readable-stream@^3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== @@ -10306,6 +10220,11 @@ reusify@^1.0.4: resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== +rfdc@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.3.0.tgz#d0b7c441ab2720d05dc4cf26e01c89631d9da08b" + integrity sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA== + rgb-regex@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/rgb-regex/-/rgb-regex-1.0.1.tgz#c0e0d6882df0e23be254a475e8edd41915feaeb1" @@ -10462,6 +10381,11 @@ schema-utils@^3.0.0: ajv "^6.12.5" ajv-keywords "^3.5.2" +secure-json-parse@^2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/secure-json-parse/-/secure-json-parse-2.4.0.tgz#5aaeaaef85c7a417f76271a4f5b0cc3315ddca85" + integrity sha512-Q5Z/97nbON5t/L/sH6mY2EacfjVGwrCcSi5D3btRO2GZ8pf1K1UN7Z9H5J57hjVU2Qzxr1xO+FmBhOvEkzCMmg== + select-hose@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/select-hose/-/select-hose-2.0.0.tgz#625d8658f865af43ec962bfc376a37359a4994ca" @@ -10496,7 +10420,7 @@ semver-regex@^3.1.2: resolved "https://registry.yarnpkg.com/semver-regex/-/semver-regex-3.1.2.tgz#34b4c0d361eef262e07199dbef316d0f2ab11807" integrity sha512-bXWyL6EAKOJa81XG1OZ/Yyuq+oT0b2YLlxx7c+mrdYPaPbnj6WgVULXhinMIeZGufuUBu/eVRqXEhiv4imfwxA== -"semver@2 || 3 || 4 || 5", semver@^5.4.1, semver@^5.5.0, semver@^5.6.0: +"semver@2 || 3 || 4 || 5", semver@^5.5.0, semver@^5.6.0: version "5.7.1" resolved "https://registry.nlark.com/semver/download/semver-5.7.1.tgz?cache=0&sync_timestamp=1618846864940&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fsemver%2Fdownload%2Fsemver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha1-qVT5Ma66UI0we78Gnv8MAclhFvc= @@ -10511,7 +10435,7 @@ semver@^6.0.0, semver@^6.1.0, semver@^6.1.1, semver@^6.1.2, semver@^6.2.0, semve resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== -semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5: +semver@^7.2.1, semver@^7.3.2, semver@^7.3.4: version "7.3.5" resolved "https://registry.nlark.com/semver/download/semver-7.3.5.tgz?cache=0&sync_timestamp=1618846864940&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fsemver%2Fdownload%2Fsemver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" integrity sha1-C2Ich5NI2JmOSw5L6Us/EuYBjvc= @@ -10583,7 +10507,7 @@ serve-static@1.14.1: parseurl "~1.3.3" send "0.17.1" -set-blocking@^2.0.0, set-blocking@~2.0.0: +set-blocking@^2.0.0: version "2.0.0" resolved "https://registry.nlark.com/set-blocking/download/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= @@ -10665,20 +10589,6 @@ signal-exit@^3.0.0, signal-exit@^3.0.2, signal-exit@^3.0.3: resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== -simple-concat@^1.0.0: - version "1.0.1" - resolved "https://registry.npm.taobao.org/simple-concat/download/simple-concat-1.0.1.tgz#f46976082ba35c2263f1c8ab5edfe26c41c9552f" - integrity sha1-9Gl2CCujXCJj8cirXt/ibEHJVS8= - -simple-get@^3.0.3: - version "3.1.0" - resolved "https://registry.npm.taobao.org/simple-get/download/simple-get-3.1.0.tgz#b45be062435e50d159540b576202ceec40b9c6b3" - integrity sha1-tFvgYkNeUNFZVAtXYgLO7EC5xrM= - dependencies: - decompress-response "^4.2.0" - once "^1.3.1" - simple-concat "^1.0.0" - simple-swizzle@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/simple-swizzle/-/simple-swizzle-0.2.2.tgz#a4da6b635ffcccca33f70d17cb92592de95e557a" @@ -10807,6 +10717,21 @@ socks@^2.3.3: ip "^1.1.5" smart-buffer "^4.1.0" +sonic-boom@^1.0.2: + version "1.4.1" + resolved "https://registry.yarnpkg.com/sonic-boom/-/sonic-boom-1.4.1.tgz#d35d6a74076624f12e6f917ade7b9d75e918f53e" + integrity sha512-LRHh/A8tpW7ru89lrlkU4AszXt1dbwSjVWguGrmlxE7tawVmDBlI1PILMkXAxJTwqhgsEeTHzj36D5CmHgQmNg== + dependencies: + atomic-sleep "^1.0.0" + flatstr "^1.0.12" + +sonic-boom@^2.2.0: + version "2.4.1" + resolved "https://registry.yarnpkg.com/sonic-boom/-/sonic-boom-2.4.1.tgz#6e1c3762c677425c6ffbd7bd106c4f8258b45b39" + integrity sha512-WgtVLfGl347/zS1oTuLaOAvVD5zijgjphAJHgbbnBJGgexnr+C1ULSj0j7ftoGxpuxR4PaV635NkwFemG8m/5w== + dependencies: + atomic-sleep "^1.0.0" + sort-keys-length@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/sort-keys-length/-/sort-keys-length-1.0.1.tgz#9cb6f4f4e9e48155a6aa0671edd336ff1479a188" @@ -10928,6 +10853,11 @@ split2@^3.0.0: dependencies: readable-stream "^3.0.0" +split2@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/split2/-/split2-4.1.0.tgz#101907a24370f85bb782f08adaabe4e281ecf809" + integrity sha512-VBiJxFkxiXRlUIeyMQi8s4hgvKCSjtknJv/LVYbrgALPwf5zSKmEwV9Lst25AkvMDnvxODugjdl6KZgwKM1WYQ== + sprintf-js@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.1.2.tgz#da1765262bf8c0f571749f2ad6c26300207ae673" @@ -11030,13 +10960,6 @@ stream-http@^2.7.2: to-arraybuffer "^1.0.0" xtend "^4.0.0" -stream-meter@^1.0.4: - version "1.0.4" - resolved "https://registry.npm.taobao.org/stream-meter/download/stream-meter-1.0.4.tgz#52af95aa5ea760a2491716704dbff90f73afdd1d" - integrity sha1-Uq+Vql6nYKJJFxZwTb/5D3Ov3R0= - dependencies: - readable-stream "^2.1.4" - stream-shift@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.1.tgz#d7088281559ab2778424279b0877da3c392d5a3d" @@ -11061,7 +10984,7 @@ string-width@^1.0.1, string-width@^1.0.2: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -"string-width@^1.0.2 || 2", string-width@^2.0.0: +string-width@^2.0.0: version "2.1.1" resolved "https://registry.nlark.com/string-width/download/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" integrity sha1-q5Pyeo3BPSjKyBXEYhQ6bZASrp4= @@ -11189,7 +11112,7 @@ strip-indent@^2.0.0: resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-2.0.0.tgz#5ef8db295d01e6ed6cbf7aab96998d7822527b68" integrity sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g= -strip-json-comments@^3.0.1: +strip-json-comments@^3.0.1, strip-json-comments@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== @@ -11348,27 +11271,6 @@ tapable@^1.0.0, tapable@^1.1.3: resolved "https://registry.yarnpkg.com/tapable/-/tapable-1.1.3.tgz#a1fccc06b58db61fd7a45da2da44f5f3a3e67ba2" integrity sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA== -tar-fs@^2.0.0: - version "2.1.1" - resolved "https://registry.nlark.com/tar-fs/download/tar-fs-2.1.1.tgz#489a15ab85f1f0befabb370b7de4f9eb5cbe8784" - integrity sha1-SJoVq4Xx8L76uzcLfeT561y+h4Q= - dependencies: - chownr "^1.1.1" - mkdirp-classic "^0.5.2" - pump "^3.0.0" - tar-stream "^2.1.4" - -tar-stream@^2.1.4: - version "2.2.0" - resolved "https://registry.npm.taobao.org/tar-stream/download/tar-stream-2.2.0.tgz#acad84c284136b060dc3faa64474aa9aebd77287" - integrity sha1-rK2EwoQTawYNw/qmRHSqmuvXcoc= - dependencies: - bl "^4.0.3" - end-of-stream "^1.4.1" - fs-constants "^1.0.0" - inherits "^2.0.3" - readable-stream "^3.1.1" - tar@^6.0.2: version "6.1.0" resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.0.tgz#d1724e9bcc04b977b18d5c573b333a2207229a83" @@ -11652,11 +11554,6 @@ ts-pnp@^1.1.6: resolved "https://registry.yarnpkg.com/ts-pnp/-/ts-pnp-1.2.0.tgz#a500ad084b0798f1c3071af391e65912c86bca92" integrity sha512-csd+vJOb/gkzvcCHgTGSChYpy5f1/XKNsmvBGO4JXS+z1v2HobugDz4s1IeFXM3wZB44uczs+eazB5Q/ccdhQw== -tslib@2.1.0: - version "2.1.0" - resolved "https://registry.nlark.com/tslib/download/tslib-2.1.0.tgz?cache=0&sync_timestamp=1618847097275&other_urls=https%3A%2F%2Fregistry.nlark.com%2Ftslib%2Fdownload%2Ftslib-2.1.0.tgz#da60860f1c2ecaa5703ab7d39bc05b6bf988b97a" - integrity sha1-2mCGDxwuyqVwOrfTm8Bba/mIuXo= - tslib@^1.9.0: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" @@ -12476,13 +12373,6 @@ which@^2.0.1: dependencies: isexe "^2.0.0" -wide-align@^1.1.0: - version "1.1.3" - resolved "https://registry.npm.taobao.org/wide-align/download/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" - integrity sha1-rgdOa9wMFKQx6ATmJFScYzsABFc= - dependencies: - string-width "^1.0.2 || 2" - widest-line@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-3.1.0.tgz#8292333bbf66cb45ff0de1603b136b7ae1496eca" @@ -12495,6 +12385,11 @@ word-wrap@~1.2.3: resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== +wordwrap@~0.0.2: + version "0.0.3" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" + integrity sha1-o9XabNXAvAAI03I0u68b7WMFkQc= + workbox-background-sync@^4.3.1: version "4.3.1" resolved "https://registry.yarnpkg.com/workbox-background-sync/-/workbox-background-sync-4.3.1.tgz#26821b9bf16e9e37fd1d640289edddc08afd1950" @@ -12734,6 +12629,11 @@ xml2js@^0.4.5: sax ">=0.6.0" xmlbuilder "~11.0.0" +xml@0.0.12: + version "0.0.12" + resolved "https://registry.yarnpkg.com/xml/-/xml-0.0.12.tgz#f08b347109912be00285785f46f15ad8e50a5f67" + integrity sha1-8Is0cQmRK+AChXhfRvFa2OUKX2c= + xmlbuilder@>=11.0.1: version "15.1.1" resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-15.1.1.tgz#9dcdce49eea66d8d10b42cae94a79c3c8d0c2ec5" From 5c6eaa8fda842f50861a9ad5afe34bd450d314d0 Mon Sep 17 00:00:00 2001 From: Changjian Gao Date: Mon, 20 Dec 2021 18:57:45 +0800 Subject: [PATCH 18/30] feat: Add "Open in Browser" context menu item to artist and album page (#1096) --- src/locale/lang/en.js | 1 + src/locale/lang/zh-CN.js | 1 + src/locale/lang/zh-TW.js | 1 + src/views/album.vue | 9 ++++++++- src/views/artist.vue | 9 ++++++++- 5 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/locale/lang/en.js b/src/locale/lang/en.js index 4065e98..fd33dc4 100644 --- a/src/locale/lang/en.js +++ b/src/locale/lang/en.js @@ -179,6 +179,7 @@ export default { addToPlaylist: 'Add to playlist', searchInPlaylist: 'Search in playlist', copyUrl: 'Copy URL', + openInBrowser: 'Open in Browser', allPlaylists: 'All Playlists', minePlaylists: 'My Playlists', likedPlaylists: 'Liked Playlists', diff --git a/src/locale/lang/zh-CN.js b/src/locale/lang/zh-CN.js index 99c0029..084c94a 100644 --- a/src/locale/lang/zh-CN.js +++ b/src/locale/lang/zh-CN.js @@ -180,6 +180,7 @@ export default { addToPlaylist: '添加到歌单', searchInPlaylist: '歌单内搜索', copyUrl: '复制链接', + openInBrowser: '在浏览器中打开', allPlaylists: '全部歌单', minePlaylists: '创建的歌单', likedPlaylists: '收藏的歌单', diff --git a/src/locale/lang/zh-TW.js b/src/locale/lang/zh-TW.js index ff0b656..06ac527 100644 --- a/src/locale/lang/zh-TW.js +++ b/src/locale/lang/zh-TW.js @@ -176,6 +176,7 @@ export default { removeFromLibrary: '從音樂庫刪除', addToPlaylist: '新增至歌單', searchInPlaylist: '歌單內搜尋', + openInBrowser: '在瀏覽器中打開', copyUrl: '複製連結', allPlaylists: '全部歌單', minePlaylists: '我建立的歌單', diff --git a/src/views/album.vue b/src/views/album.vue index cebd8df..3efc250 100644 --- a/src/views/album.vue +++ b/src/views/album.vue @@ -137,6 +137,9 @@
{{ $t('contextMenu.copyUrl') }}
+
{{ + $t('contextMenu.openInBrowser') + }}
@@ -305,7 +308,7 @@ export default { }, copyUrl(id) { let showToast = this.showToast; - this.$copyText('https://music.163.com/#/album?id=' + id) + this.$copyText(`https://music.163.com/#/album?id=${id}`) .then(function () { showToast(locale.t('toast.copied')); }) @@ -313,6 +316,10 @@ export default { showToast(`${locale.t('toast.copyFailed')}${error}`); }); }, + openInBrowser(id) { + const url = `https://music.163.com/#/album?id=${id}`; + window.open(url); + }, }, }; diff --git a/src/views/artist.vue b/src/views/artist.vue index 0f0721d..cec51e4 100644 --- a/src/views/artist.vue +++ b/src/views/artist.vue @@ -169,6 +169,9 @@
{{ $t('contextMenu.copyUrl') }}
+
{{ + $t('contextMenu.openInBrowser') + }}
@@ -339,7 +342,7 @@ export default { }, copyUrl(id) { let showToast = this.showToast; - this.$copyText('https://music.163.com/#/artist?id=' + id) + this.$copyText(`https://music.163.com/#/artist?id=${id}`) .then(function () { showToast(locale.t('toast.copied')); }) @@ -347,6 +350,10 @@ export default { showToast(`${locale.t('toast.copyFailed')}${error}`); }); }, + openInBrowser(id) { + const url = `https://music.163.com/#/artist?id=${id}`; + window.open(url); + }, }, }; From d322a29b7248534f55b02de1bb4c82e28218c18b Mon Sep 17 00:00:00 2001 From: Chiro Date: Mon, 20 Dec 2021 19:00:33 +0800 Subject: [PATCH 19/30] fix: #1063 #1010 (#1083) --- src/background.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/background.js b/src/background.js index 5efde71..4b7c86a 100644 --- a/src/background.js +++ b/src/background.js @@ -347,10 +347,12 @@ class Background { } // create dock menu for macOS - app.dock.setMenu(createDockMenu(this.window)); + const createdDockMenu = createDockMenu(this.window); + if (createDockMenu && app.dock) app.dock.setMenu(createdDockMenu); // create touch bar - this.window.setTouchBar(createTouchBar(this.window)); + const createdTouchBar = createTouchBar(this.window); + if (createdTouchBar) this.window.setTouchBar(createdTouchBar); // register global shortcuts if (this.store.get('settings.enableGlobalShortcut') !== false) { From e9d9c3aee8e2cef697d132965cef2b5dd74815a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=AF=E8=99=B9=E5=B7=9D=E9=A3=B4?= Date: Mon, 20 Dec 2021 19:00:59 +0800 Subject: [PATCH 20/30] fix: issues #1076 (#1080) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * issues #1019 的迫真修复 * 修复 issues #1019 * 修复 issues #1019 * 改回 pickedLyric() 逻辑 * 更进一步的避免取词卡死问题 * 更新网易云 api 到 4.2.0 * Update README.md * Revert "Update README.md" This reverts commit b862ef7d4dabd40c8fe57e4837fc6220806a1456. * Update lyrics.vue --- src/views/lyrics.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/views/lyrics.vue b/src/views/lyrics.vue index 41763f6..b7a1b06 100644 --- a/src/views/lyrics.vue +++ b/src/views/lyrics.vue @@ -338,7 +338,13 @@ export default { }, clickLyricLine(value, startPlay = false) { // TODO: 双击选择还会选中文字,考虑搞个右键菜单复制歌词 - if (window.getSelection().toString().length === 0) { + let jumpFlag = false; + this.lyric.filter(function (item) { + if (item.content == '纯音乐,请欣赏') { + jumpFlag = true; + } + }); + if (window.getSelection().toString().length === 0 && !jumpFlag) { this.player.seek(value); } if (startPlay === true) { From 47862d671056a005758cc38e22fbfcfe8650f929 Mon Sep 17 00:00:00 2001 From: memorydream <34763046+memorydream@users.noreply.github.com> Date: Tue, 21 Dec 2021 10:12:06 +0800 Subject: [PATCH 21/30] fix: disc color (#1114) --- src/components/TrackListItem.vue | 6 +++--- src/views/album.vue | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/components/TrackListItem.vue b/src/components/TrackListItem.vue index 6e5f5bb..94ae753 100644 --- a/src/components/TrackListItem.vue +++ b/src/components/TrackListItem.vue @@ -43,7 +43,7 @@ - + ({{ subTitle }})
@@ -312,7 +312,7 @@ button { font-size: 14px; opacity: 0.72; } - .subTitle { + .sub-title { color: #aeaeae; margin-left: 4px; } @@ -416,7 +416,7 @@ button { .title, .album, .time, - .title-and-artist .subTitle { + .title-and-artist .sub-title { color: var(--color-primary); } .title .featured, diff --git a/src/views/album.vue b/src/views/album.vue index 3efc250..f90fa19 100644 --- a/src/views/album.vue +++ b/src/views/album.vue @@ -73,7 +73,7 @@
-

Disc {{ cd }}

+

Disc {{ cd }}

Date: Tue, 21 Dec 2021 10:20:04 +0800 Subject: [PATCH 22/30] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20issues=20#101?= =?UTF-8?q?9=20=E7=9A=84=E8=B7=9F=E8=BF=9B=E9=97=AE=E9=A2=98=20=20(#1113)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * issues #1019 的迫真修复 * 修复 issues #1019 * 修复 issues #1019 * 改回 pickedLyric() 逻辑 * 更进一步的避免取词卡死问题 * 更新网易云 api 到 4.2.0 * Update README.md * Revert "Update README.md" This reverts commit b862ef7d4dabd40c8fe57e4837fc6220806a1456. * Update lyrics.vue * 过滤歌词 --- src/views/library.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/views/library.vue b/src/views/library.vue index c8243a7..5eb7b28 100644 --- a/src/views/library.vue +++ b/src/views/library.vue @@ -200,8 +200,11 @@ export default { if (this.lyric === undefined) return ''; let lyric = this.lyric.split('\n'); lyric = lyric.filter(l => { - if (l.includes('作词') || l.includes('作曲')) { - return false; + if (l.includes('纯音乐,请欣赏')) { + if (l.includes('作词') || l.includes('作曲')) { + return false; + } + return true; } return true; }); From d049eb4903abd97ab221c55881483c5e4fc39f80 Mon Sep 17 00:00:00 2001 From: pan93412 Date: Fri, 24 Dec 2021 15:22:27 +0800 Subject: [PATCH 23/30] fix(settings): update URL to our UNM fork's (#1120) --- src/views/settings.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/settings.vue b/src/views/settings.vue index d4b7046..959b622 100644 --- a/src/views/settings.vue +++ b/src/views/settings.vue @@ -245,7 +245,7 @@ Date: Fri, 24 Dec 2021 17:19:16 +0800 Subject: [PATCH 24/30] fix(player): release object urls (#1121) --- src/utils/Player.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/utils/Player.js b/src/utils/Player.js index f1c7f4f..c6b633e 100644 --- a/src/utils/Player.js +++ b/src/utils/Player.js @@ -38,6 +38,14 @@ export default class { this._personalFMTrack = { id: 0 }; // 私人FM当前歌曲 this._personalFMNextTrack = { id: 0 }; // 私人FM下一首歌曲信息(为了快速加载下一首) + /** + * The blob records for cleanup. + * + * @private + * @type {string[]} + */ + this.createdBlobRecords = []; + // howler (https://github.com/goldfire/howler.js) this._howler = null; Object.defineProperty(this, '_howler', { @@ -247,7 +255,21 @@ export default class { _getAudioSourceFromCache(id) { return getTrackSource(id).then(t => { if (!t) return null; + + // Create a new object URL. const source = URL.createObjectURL(new Blob([t.source])); + + // Clean up the previous object URLs since we've created a new one. + // Revoke object URLs can release the memory taken by a Blob, + // which occupied a large proportion of memory. + for (const url in this.createdBlobRecords) { + URL.revokeObjectURL(url); + } + + // Then, we replace the createBlobRecords with new one with + // our newly created object URL. + this.createdBlobRecords = [source]; + return source; }); } From c73da5c5ad3acccd2e72a98ea700305e094753d1 Mon Sep 17 00:00:00 2001 From: memorydream <34763046+memorydream@users.noreply.github.com> Date: Sat, 25 Dec 2021 13:08:01 +0800 Subject: [PATCH 25/30] fix: firefox lyrics scrollbar (#1128) --- src/views/lyrics.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/views/lyrics.vue b/src/views/lyrics.vue index b7a1b06..a76718e 100644 --- a/src/views/lyrics.vue +++ b/src/views/lyrics.vue @@ -641,6 +641,7 @@ export default { max-width: 460px; overflow-y: auto; transition: 0.5s; + scrollbar-width: none; // firefox .line { padding: 18px; From 83b78bab34b4b0d26cd94acb4ba7ddb9658b8497 Mon Sep 17 00:00:00 2001 From: pan93412 Date: Tue, 28 Dec 2021 00:49:31 +0800 Subject: [PATCH 26/30] feat: allow customizing UNM's sources (#1134) * feat(ipcMain/unm): allow passing customized source * feat(utils/Player): pass settings.unmSource According to c280221a44608777a69038306a6ea8e92953fb9a, we can let users customize their desired source now. * feat(views/settings): allow configuring sources We haven't supported specifying the environment variable in YPM yet. --- src/electron/ipcMain.js | 18 +++++++- src/utils/Player.js | 6 ++- src/views/settings.vue | 96 +++++++++++++++++++++++++++++++---------- 3 files changed, 94 insertions(+), 26 deletions(-) diff --git a/src/electron/ipcMain.js b/src/electron/ipcMain.js index dc1fed6..64e5168 100644 --- a/src/electron/ipcMain.js +++ b/src/electron/ipcMain.js @@ -48,8 +48,18 @@ async function getBiliVideoFile(url) { return `data:application/octet-stream;base64,${encodedData}`; } +/** + * Parse the source string (`a, b`) to source list `['a', 'b']`. + * + * @param {string} sourceString The source string. + * @returns {string[]} The source list. + */ +function parseSourceStringToList(sourceString) { + return sourceString.split(',').map(s => s.trim()); +} + export function initIpcMain(win, store) { - ipcMain.handle('unblock-music', async (_, track) => { + ipcMain.handle('unblock-music', async (_, track, source) => { // 兼容 unblockneteasemusic 所使用的 api 字段 track.alias = track.alia || []; track.duration = track.dt || 0; @@ -62,11 +72,15 @@ export function initIpcMain(win, store) { }, 5000); }); + const sourceList = + typeof source === 'string' ? parseSourceStringToList(source) : null; + log(`[UNM] using source: ${sourceList || ''}`); + try { const matchedAudio = await Promise.race([ // TODO: tell users to install yt-dlp. // we passed "null" to source, to let UNM choose the default source. - match(track.id, null, track), + match(track.id, sourceList, track), timeoutPromise, ]); diff --git a/src/utils/Player.js b/src/utils/Player.js index c6b633e..8fab401 100644 --- a/src/utils/Player.js +++ b/src/utils/Player.js @@ -299,7 +299,11 @@ export default class { ) { return null; } - const source = await ipcRenderer.invoke('unblock-music', track); + const source = await ipcRenderer.invoke( + 'unblock-music', + track, + store.state.settings.unmSource + ); if (store.state.settings.automaticallyCacheSongs && source?.url) { // TODO: 将unblockMusic字样换成真正的来源(比如酷我咪咕等) cacheTrackSource(track, source.url, 128000, 'unblockMusic'); diff --git a/src/views/settings.vue b/src/views/settings.vue index 959b622..37da6a9 100644 --- a/src/views/settings.vue +++ b/src/views/settings.vue @@ -222,6 +222,58 @@
+
+

UnblockNeteaseMusic 设定

+
+
+ +
+
+
+ + +
+
+
+
+
+
备选音源
+
+ 音源的具体代号 + + 可以点此到 UNM 的说明页面查询
+ 多个音源请用 , 逗号分隔。
+ 留空则使用 UNM 内置的默认值。 +
+
+
+ + +
+
+
+

第三方

@@ -240,29 +292,6 @@
-
-
- -
-
-
- - -
-
-
@@ -852,6 +881,21 @@ export default { }); }, }, + unmSource: { + /** + * @returns {string} + */ + get() { + return this.settings.unmSource || ''; + }, + /** @param {string?} value */ + set(value) { + this.$store.commit('updateSettings', { + key: 'unmSource', + value: value.length ? value : null, + }); + }, + }, isLastfmConnected() { return this.lastfm.key !== undefined; }, @@ -1128,6 +1172,12 @@ h3 { font-weight: 500; opacity: 0.78; } + + .description { + font-size: 14px; + margin-top: 0.5em; + opacity: 0.7; + } } select { From e838f1d6d43a712699b84da23082c3479ab8f5bc Mon Sep 17 00:00:00 2001 From: Vidocq Date: Tue, 28 Dec 2021 01:04:33 +0800 Subject: [PATCH 27/30] fix: toast covered by modal (#1137) --- src/components/Toast.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Toast.vue b/src/components/Toast.vue index 93af55a..d5b5eb8 100644 --- a/src/components/Toast.vue +++ b/src/components/Toast.vue @@ -30,7 +30,7 @@ export default { border-radius: 8px; box-sizing: border-box; padding: 6px 12px; - z-index: 100; + z-index: 1010; } [data-theme='dark'] { From f5cdbea37993f313a53498d7572fdd5d7d6aac68 Mon Sep 17 00:00:00 2001 From: pan93412 Date: Tue, 28 Dec 2021 17:58:31 +0800 Subject: [PATCH 28/30] =?UTF-8?q?refactor(views/library):=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=8F=96=E8=AF=8D=E9=80=BB=E8=BE=91=20(#1135)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor(views/library): 修改取词逻辑 * refactor(views/library): clean up long-winded code Co-authored-by: 是虹川飴 Closed: #1133 Fixed: #1019 #1127 #1067 #1064 #1058 #1022 --- src/views/library.vue | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/src/views/library.vue b/src/views/library.vue index 5eb7b28..2dc1874 100644 --- a/src/views/library.vue +++ b/src/views/library.vue @@ -199,15 +199,6 @@ export default { pickedLyric() { if (this.lyric === undefined) return ''; let lyric = this.lyric.split('\n'); - lyric = lyric.filter(l => { - if (l.includes('纯音乐,请欣赏')) { - if (l.includes('作词') || l.includes('作曲')) { - return false; - } - return true; - } - return true; - }); let lineIndex = randomNum(0, lyric.length - 1); while (lineIndex + 4 > lyric.length) { lineIndex = randomNum(0, lyric.length - 1); @@ -290,16 +281,12 @@ export default { this.liked.songs[randomNum(0, this.liked.songs.length - 1)] ).then(data => { if (data.lrc !== undefined) { - let ifl = data.lrc.lyric.split('\n').filter(l => { - if (l.includes('作词')) { - if (l.includes('纯音乐,请欣赏') || l.includes('作词 : 无')) { - return false; - } - this.lyric = data.lrc.lyric; - return true + ifl; - } - return false; - }); + const isInstrumental = data.lrc.lyric + .split('\n') + .filter(l => l.includes('纯音乐,请欣赏')); + if (isInstrumental.length === 0) { + this.lyric = data.lrc.lyric; + } } }); }, From d15381020552cbd0faa1c6447367687ea0b99657 Mon Sep 17 00:00:00 2001 From: pan93412 Date: Wed, 29 Dec 2021 07:37:58 +0800 Subject: [PATCH 29/30] fix(views/library): better lyric-picking logic (#1143) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(views/library): better lyric-picking logic * feat(views/library): filter out lines with "作詞" and "作曲" included --- src/views/library.vue | 45 ++++++++++++++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 11 deletions(-) diff --git a/src/views/library.vue b/src/views/library.vue index 2dc1874..fa54fc2 100644 --- a/src/views/library.vue +++ b/src/views/library.vue @@ -183,6 +183,16 @@ import CoverRow from '@/components/CoverRow.vue'; import SvgIcon from '@/components/SvgIcon.vue'; import MvRow from '@/components/MvRow.vue'; +/** + * Pick the lyric part from a string formed in `[timecode] lyric`. + * + * @param {string} rawLyric The raw lyric string formed in `[timecode] lyric` + * @returns {string} The lyric part + */ +function extractLyricPart(rawLyric) { + return rawLyric.split(']')[1].trim(); +} + export default { name: 'Library', components: { SvgIcon, CoverRow, TrackList, MvRow, ContextMenu }, @@ -196,18 +206,31 @@ export default { }, computed: { ...mapState(['data', 'liked']), + /** + * @returns {string[]} + */ pickedLyric() { - if (this.lyric === undefined) return ''; - let lyric = this.lyric.split('\n'); - let lineIndex = randomNum(0, lyric.length - 1); - while (lineIndex + 4 > lyric.length) { - lineIndex = randomNum(0, lyric.length - 1); - } - return [ - lyric[lineIndex].split(']')[1], - lyric[lineIndex + 1].split(']')[1], - lyric[lineIndex + 2].split(']')[1], - ]; + /** @type {string?} */ + const lyric = this.lyric; + + // Returns [] if we got no lyrics. + if (!lyric) return []; + + const lyricLine = lyric + .split('\n') + .filter(line => !line.includes('作词') && !line.includes('作曲')); + + // Pick 3 or fewer lyrics based on the lyric lines. + const lyricsToPick = Math.min(lyricLine.length, 3); + + // The upperbound of the lyric line to pick + const randomUpperBound = lyricLine.length - lyricsToPick; + const startLyricLineIndex = randomNum(0, randomUpperBound - 1); + + // Pick lyric lines to render. + return lyricLine + .slice(startLyricLineIndex, startLyricLineIndex + lyricsToPick) + .map(extractLyricPart); }, playlistFilter() { return this.data.libraryPlaylistFilter || 'all'; From cbeb64a65c8b74796f9a1278c054dd9525a7afc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=AF=E8=99=B9=E5=B7=9D=E9=A3=B4?= Date: Fri, 31 Dec 2021 18:56:16 +0800 Subject: [PATCH 30/30] fix #1152 (#1157) --- src/views/explore.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/explore.vue b/src/views/explore.vue index b41b0a3..2e5057b 100644 --- a/src/views/explore.vue +++ b/src/views/explore.vue @@ -132,7 +132,7 @@ export default { }, goToCategory(Category) { this.showCatOptions = false; - this.$router.push({ path: '/explore?category=' + Category }); + this.$router.push({ name: 'explore', query: { category: Category } }); }, updatePlaylist(playlists) { this.playlists.push(...playlists);