From ee248be2c5b7a7bd70a2d07891baa3ca1955d6ae Mon Sep 17 00:00:00 2001 From: qier222 Date: Sat, 6 Mar 2021 23:44:32 +0800 Subject: [PATCH] fix: bugs --- .env.example | 4 +- .github/workflows/build.yaml | 23 +- package.json | 5 +- public/img/icons/exit.png | Bin 0 -> 223 bytes public/img/icons/left.png | Bin 0 -> 191 bytes public/img/icons/like.png | Bin 0 -> 308 bytes public/img/icons/play.png | Bin 0 -> 396 bytes public/img/icons/repeat.png | Bin 0 -> 344 bytes public/img/icons/right.png | Bin 0 -> 218 bytes src/background.js | 7 +- src/components/FMCard.vue | 5 +- src/components/Navbar.vue | 19 +- src/electron/ipcMain.js | 8 - src/electron/ipcRenderer.js | 4 +- src/electron/tray.js | 24 +- src/main.js | 4 - vue.config.js | 19 +- yarn.lock | 7475 +++++++++++++++++----------------- 18 files changed, 3704 insertions(+), 3893 deletions(-) create mode 100644 public/img/icons/exit.png create mode 100644 public/img/icons/left.png create mode 100644 public/img/icons/like.png create mode 100644 public/img/icons/play.png create mode 100644 public/img/icons/repeat.png create mode 100644 public/img/icons/right.png diff --git a/.env.example b/.env.example index bd591ef..fb667ec 100644 --- a/.env.example +++ b/.env.example @@ -1,5 +1,5 @@ -VUE_APP_NETEASE_API_URL=http://127.0.0.1:3000 +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_ENABLE_SENTRY=false -DEV_SERVER_PORT=20201 \ No newline at end of file +DEV_SERVER_PORT=20201 diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 77cc6a7..06a6a0a 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -8,7 +8,7 @@ jobs: strategy: matrix: - os: [macos-latest, windows-latest] + os: [macos-latest, windows-latest, ubuntu-latest] steps: - name: Check out Git repository @@ -17,10 +17,17 @@ jobs: - name: Install Node.js, NPM and Yarn uses: actions/setup-node@v1 with: - node-version: 12.16.3 + node-version: 14.16.0 + + - name: Install RPM & Pacman (only on Linux) + if: runner.os == 'Linux' + run: | + sudo apt-get update && + sudo apt-get install --no-install-recommends -y rpm && + sudo apt-get install --no-install-recommends -y bsdtar - name: Build/release Electron app - uses: samuelmeuli/action-electron-builder@v1 + uses: samuelmeuli/action-electron-builder@v1.6.0 with: # GitHub token, automatically provided to the action # (No need to define this secret in the repo settings) @@ -35,11 +42,17 @@ jobs: - uses: actions/upload-artifact@v2 with: name: YesPlayMusic-mac - path: dist_electron/*.dmg + path: dist_electron/*-universal.dmg if-no-files-found: ignore - uses: actions/upload-artifact@v2 with: name: YesPlayMusic-win - path: dist_electron/*.exe + path: dist_electron/*Setup*.exe + if-no-files-found: ignore + + - uses: actions/upload-artifact@v2 + with: + name: YesPlayMusic-linux + path: dist_electron/*.AppImage if-no-files-found: ignore diff --git a/package.json b/package.json index 736073c..2f7e78c 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,8 @@ "core-js": "^3.6.5", "crypto-js": "^4.0.0", "dayjs": "^1.8.36", - "electron": "11.0.2", + "electron": "^12.0.0", + "electron-builder": "^22.10.5", "electron-context-menu": "^2.3.0", "electron-debug": "^3.1.0", "electron-devtools-installer": "^3.1.1", @@ -60,7 +61,6 @@ "vscode-codicons": "^0.0.14", "vue": "^2.6.11", "vue-analytics": "^5.22.1", - "vue-electron": "^1.0.6", "vue-i18n": "^8.22.0", "vue-router": "^3.4.3", "vue-slider-component": "^3.2.5", @@ -76,7 +76,6 @@ "@vue/cli-plugin-vuex": "~4.5.0", "@vue/cli-service": "~4.5.0", "babel-eslint": "^10.1.0", - "electron-builder": "^22.10.5", "eslint": "^6.7.2", "eslint-plugin-vue": "^6.2.2", "husky": "^4.3.0", diff --git a/public/img/icons/exit.png b/public/img/icons/exit.png new file mode 100644 index 0000000000000000000000000000000000000000..01e21b2c7f8e0e8f7e902cdd4221a7e46d5476a2 GIT binary patch literal 223 zcmV<503iQ~P)pf~V4a09N&=M*#sAn*(5B7o~o;61Q)fDLd?7k*H(02MF51vnWA7LbaM!1Js4 z0q7_!Kz+HvO~4odl$U%(oAF0D#0U}s^tjqN{5!<8u3n`eXXP3gfH`ua`w{KJJIO8H Z#t-s-9uZNcsP=D?O z&YZbNw0gHTNh%cYXjocWFnLEq^NeeZhniJd1T0iqEqA=S_qY82MpM2w?H9?lyY_$m1;$J5e1adJ9}ES$h{4m<&t;ucLK6T0Urqr4 literal 0 HcmV?d00001 diff --git a/public/img/icons/like.png b/public/img/icons/like.png new file mode 100644 index 0000000000000000000000000000000000000000..4bea102372bdb0ed5f1402210278a7bbdd01f4be GIT binary patch literal 308 zcmV-40n7f0P)~6Y~%%4prrn5S+Ni$v5_4s8+ieF39_+MN~h*( zn(qHzb!Rip%=vxi%sId5={R~F_38j)m`vcOG|!~@6(9MfCEx~qgfK)eDR?T|yTwuk z$pIUf#TD)_j;$1Uf_E%n6^}TJvm6lV9UyLK8j;~%^~@abh0%W&^)EIDJmVavEs#yD zVY+<63U;xKw;_-TM4=CHT>@ggkHxHwB`4~1i9uZ#s=Xu3*FZvikDVqTRA&zu!8(3$ zfp5%}DK%O7IQ2X<;f?LOy0ra;FjHjkIjl2nfL2>{2K)l(z9xeaGOaU1GX>iBP*QK(5*4pq7 zz_rDtITR9(QmNXb*;lK{kpyEM04Xi!qmU**y_oT=%CgW-nrn#y2s28{u}1zE;M(3M zK$A+#g}Ax6j@Sd!i_)+A=3E3I&J*B+ckSPrMAi{=%vel-cN;MiAF#cN5VWPVTxtcp zebxF$E0w3fBwS16L8wb%;?q*#ubO>2opbt@mrcqjv$wLyWH8xn{sdtWHjBlkNW#BBNB7Zn zdw%@}r=Fhsa?ba>-iCilA0E;=0P7g3AUU8NAIaNOQiwEmFrIlm!YB6PEC&o@6APJg9iR(0=qv$C=&i_E z1lyP>iuYAH&m)LXLw-Wb01@&Gsy0Vx$l$&Eu>9gkd*MaEGnBHipNxG%QiHs`slH#USp}{cn+4y@eR6 qNj&2f=S4S~zJ*e+>AqD2EkWPRYcCPoeH01+000017p&dM R7!GtSgQu&X%Q~loCICFuRIdO4 literal 0 HcmV?d00001 diff --git a/src/background.js b/src/background.js index fa7c55c..5d2a7c0 100644 --- a/src/background.js +++ b/src/background.js @@ -12,6 +12,7 @@ import installExtension, { VUEJS_DEVTOOLS } from "electron-devtools-installer"; import express from "express"; import expressProxy from "express-http-proxy"; import Store from "electron-store"; +import path from "path"; class Background { constructor() { @@ -88,20 +89,18 @@ class Background { createWindow() { console.log("creating app window"); - // Only for Windows, a special title bar for it - const withoutFrame = process.platform == "win32"; - this.window = new BrowserWindow({ width: this.store.get("window.width") | 1440, height: this.store.get("window.height") | 840, minWidth: 1080, minHeight: 720, titleBarStyle: "hiddenInset", - frame: !withoutFrame, + frame: process.platform !== "win32", webPreferences: { webSecurity: false, nodeIntegration: true, enableRemoteModule: true, + contextIsolation: false, }, }); diff --git a/src/components/FMCard.vue b/src/components/FMCard.vue index 96fb717..a6ef73b 100644 --- a/src/components/FMCard.vue +++ b/src/components/FMCard.vue @@ -8,7 +8,7 @@
{{ track.name }}
-
+
@@ -47,6 +47,9 @@ export default { isPlaying() { return this.player.playing && this.player.isPersonalFM; }, + artists() { + return this.track.artists || this.track.ar || []; + }, }, methods: { play() { diff --git a/src/components/Navbar.vue b/src/components/Navbar.vue index 2b6b8ea..9f50ad9 100644 --- a/src/components/Navbar.vue +++ b/src/components/Navbar.vue @@ -73,15 +73,16 @@