From cd7cbefb5c714ed38b2e8d52d733f3dda8556126 Mon Sep 17 00:00:00 2001 From: Changjian Gao Date: Tue, 2 Apr 2024 20:49:06 +0800 Subject: [PATCH] =?UTF-8?q?Merge=20upstream:=20v0.4.7=20=E2=86=92=20v0.4.8?= =?UTF-8?q?=20(#6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 错误的选择了音源质量 (#1589) * feat: add img tag with loading attribute for lazy loading * fix: render weekData error * fix: vibrant worker error * docs: add powered by vercel * fix: bug * fix: 专辑分碟排序错误 (#1630) * fix: 专辑分碟排序错误 * update * fix(dockerfile): 限制最大標頭大小 原本的Nginx.conf没有定义最大标头大小。若不手动更改,则会出现无法登陆的bug,且Nginx会返回Header too big错误。 Fixed #1604 Co-Authored-By: huangyinhaow <64564727+huangyinhaow@users.noreply.github.com> * docs: update vercel links * fix: 歌词页视觉效果缺陷 (#1649) * fix: 部分linux发行版环境的托盘行为 (#1647) * fix: 音乐库收藏的歌单少了第一张歌单 (#1657) * chore(ci/cd): bump `actions/checkout` to v3 * chore(ci/cd): bump `actions/upload-artifact` to v3 * fix: 修复在长时间暂停后无法播放的问题 (#1627) * fix: 修复在长时间暂停后无法播放的问题 * 增加doc * fix: 歌名翻译文本位置 & FMCard背景颜色 (#1650) * fix: 歌名翻译文本位置 * fix: 使FMCard的背景颜色永远随着歌曲改变 * fix: 私人推荐歌单 (#1665) * fix: 私人推荐歌单 * update * feat: Add context menu on MV page (#1670) * feat: Added "Add to Playlist" on lyrics page (#1671) * fix(dockerfile): 设置 NCMAPI 版本 (#1689) * fix: dockerfile ncapi pinning * feat: ncmapi follows version in package.json * feat: Add "Volume Control" to Lyrics Page (#1672) * feat: Add "Volume Control" to Lyrics Page * fix: fix mute button * feat: Add time to lyric page (#1676) * feat: Add time on lyrics page * feat: Add the setting item of whether to display the time on the lyrics page * fix: fix some issue * fix: change port to workaround 21H2's port (#1706) * fix: change port to 35216 → workaround 21H2's port * style: with restyled (#1707) * Restyled by clang-format * Restyled by prettier * fix: change 21232 to 41342 Co-authored-by: restyled-io[bot] <32688539+restyled-io[bot]@users.noreply.github.com> Co-authored-by: Restyled.io * chore(deps): upgrade dependencies (#1708) * fix(ipcMain): unexpected “本草綱目“ from migu This is just a workaround, and the core issue is on UNM. However, refactoring UNM is time-comsuming and also requires a lot of hard work. Therefore, we disable "migu" at this moment simply. Fixed #1713 Fixed #1711 (?) * feat: add tutorial to deploy on Replit (#1731) * feat: Add status text to like button when hover event triggers (#1789) Signed-off-by: Kay Wei * feat: Tray icon theme now follows system theme * feat: osdlyrics desktop lyrics support * chore: improve translations * refactor: improve lyric file download implement * refactor(dockerfile): use `awk` to find NCMAPI version * refactor(dockerfile): separate nginx config from `Dockerfile` * feat: mount local time and time zone * fix: 更新api以尝试解决邮箱登录问题 * fix: 更新依赖以解决手机号登录问题;UnblockNeteaseMusic 更新 (#1915) * fix: 更新api以尝试解决邮箱登录问题 * fix: 又双更新api版本以修复手机号登录问题 (可能 * deps: [测试]更新UNM到0.4.0 * update copyright year (#1917) * fix: player volume bug (#1918) * fix: player volume bug * Update Player.js * Update Player.js * Update Player.js * Update Player.js * fix: bugs * fix: update version * revert: change port to workaround 21H2's port * fix: album.company显示问题 (#2009) * Update README.md * chore: define node engines (#1943) The `@achrinza/node-ipc` version we use in 1.x does not allow a version of Node.js greater than 17. As YesPlayMusic has been in maintenance mode, we define our supported Node.js engine version rather than upgrade this dependency. It may indicate the Vercel platform to not use 18 (or greater) in their deployment. The error message is: error @achrinza/node-ipc@9.2.2: The engine "node" is incompatible with this module. Expected version "8 || 10 || 12 || 14 || 16 || 17". Got "18.12.1" * fix(tracklist): TrackListItem 序号问题 (#2011) 直接使用 track.no 可能导致歌曲编号重复。改使用曲目在 阵列中的实际索引位置。 * fix(request): cross domain api issue (#2026) Fix the issue when NCMapi is not under the same domain as the one frontend uses. The original method using Vercel to proxy requests may cause latency under some circumstances. * fix(player): 修复歌曲时长过长时的进度显示问题 (#1936) 原先进度条遇到时长超过 1hr 的歌曲, 不会呈现小时数的部分。这个 commit 将歌曲时长小时数加到分钟数中。 * fix(player): Skip track when audio source not supported (#2033) * fix: 艺人页面专辑区不显示精选集 (#2046) * fix(navbar): Fixed the issue of overlapping with the control bar (#2073) * chore(deps): Add prettier to devDependencies (#2071) * feat(settings): Internationalize some strings (#2016) * fix(login): clear last interval when calling checkQrCodeLogin (#2094) Fixed #2093 * ci: Use Ubuntu 22.04 for Packaging (#2107) * feat(mpris): Add `xesam:url` field (#2095) chore: do not use fuo scheme, only netease music id is preserved fix: lint prettier error * feat(lyrics): Add pronunciation lyric mode (#2091) * feat: Add pronunciation lyric mode * fix(lyrics): Fixed issue where lyric-mode-switch displays when the translation setting is off * fix(player): 插队曲目切换后下一首曲目丢失 (#2118) * feat: use osdlyrics dbus interface to send lyric contents * fix(ui): add max-width attr for settings selector * feat(player): sync playing progress to mpris service on linux Co-authored-by: alex3236 <45303195+alex3236@users.noreply.github.com> * fix(Player.js): 右键播放不显示播放器(#1965) * refactor(Player.js): 确保在播放时播放器处于enabled状态 * fix: play icon not appear in Safari * Support unblock via docker. * Remove unneeded env setting * Make docker works * Make docker works * remove unneeded empty line. * 修正专辑下描述内艺人链接 * same thing on MvRow * Create sync.yml * fix typo * fix: fix build && adapte for bugs in NeteasyCloudMusicAPI * chore: remove useless space * chore: remove useless space * chore: bump to 0.4.8 * Update build.yaml * Update request.js * Fix build * Revert "修正专辑下描述内艺人链接" This reverts commit 3093b6f386e32d790e9bd6270d7793ee24f12d2d. --------- Signed-off-by: Kay Wei Co-authored-by: memorydream <34763046+memorydream@users.noreply.github.com> Co-authored-by: hawtimzhang Co-authored-by: qier222 Co-authored-by: pan93412 Co-authored-by: huangyinhaow <64564727+huangyinhaow@users.noreply.github.com> Co-authored-by: 郭桓桓 Co-authored-by: marcus <30408959+8790@users.noreply.github.com> Co-authored-by: Viyerelu23333 <11363469+Viyerelu23333@users.noreply.github.com> Co-authored-by: restyled-io[bot] <32688539+restyled-io[bot]@users.noreply.github.com> Co-authored-by: Restyled.io Co-authored-by: jbwfu <75001777+jbwfu@users.noreply.github.com> Co-authored-by: Kay W Co-authored-by: Revincx Co-authored-by: Karbob Co-authored-by: 草方块 <46253950+GrassBlock1@users.noreply.github.com> Co-authored-by: タイムライン <53483352+Nep-Timeline@users.noreply.github.com> Co-authored-by: Younglina Co-authored-by: moonrailgun Co-authored-by: Holger Co-authored-by: 洩氏诹诹子 <65452214+aldlss@users.noreply.github.com> Co-authored-by: Kris Hu Co-authored-by: Arthals <36695271+zhuozhiyongde@users.noreply.github.com> Co-authored-by: guaqiu <57245152+guaqiu5@users.noreply.github.com> Co-authored-by: Anmizi <1845513904@qq.com> Co-authored-by: Siykt <44022526+Siykt@users.noreply.github.com> Co-authored-by: poly000 <34085039+poly000@users.noreply.github.com> Co-authored-by: 拆家大主教 <1984096954@qq.com> Co-authored-by: Lvc Revincx Co-authored-by: runnableAir <83274041+runnableAir@users.noreply.github.com> Co-authored-by: alex3236 <45303195+alex3236@users.noreply.github.com> Co-authored-by: runnableAir <1316214297@qq.com> Co-authored-by: leex Co-authored-by: colawithsauce Co-authored-by: Davy <95214375+thedavidweng@users.noreply.github.com> Co-authored-by: GH Action - Upstream Sync Co-authored-by: undefined Co-authored-by: 代强 Co-authored-by: 是虹川肉 --- .github/workflows/build.yaml | 5 +- .github/workflows/sync.yml | 48 + Dockerfile | 11 +- README.md | 7 +- docker-compose.yml | 27 + package.json | 6 +- public/img/icons/menu-dark@88.png | Bin 0 -> 1096 bytes .../icons/{menu@88.png => menu-light@88.png} | Bin src/background.js | 18 +- src/components/Cover.vue | 2 +- src/components/MvRow.vue | 2 +- src/components/Navbar.vue | 2 +- src/components/TrackList.vue | 1 + src/components/TrackListItem.vue | 3 +- src/electron/mpris.js | 32 + src/electron/services.js | 1 + src/electron/tray.js | 7 +- src/locale/lang/en.js | 20 + src/locale/lang/tr.js | 13 + src/locale/lang/zh-CN.js | 19 + src/locale/lang/zh-TW.js | 19 + src/store/initLocalStorage.js | 1 + src/utils/Player.js | 58 +- src/utils/checkAuthToken.js | 8 + src/utils/lyrics.js | 1 + src/utils/request.js | 18 +- src/views/album.vue | 4 +- src/views/artist.vue | 4 +- src/views/loginAccount.vue | 4 +- src/views/lyrics.vue | 88 +- src/views/settings.vue | 71 +- vue.config.js | 20 + yarn.lock | 6403 +++++++++-------- 33 files changed, 3939 insertions(+), 2984 deletions(-) create mode 100644 .github/workflows/sync.yml create mode 100644 public/img/icons/menu-dark@88.png rename public/img/icons/{menu@88.png => menu-light@88.png} (100%) create mode 100644 src/utils/checkAuthToken.js diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ff3fd3be7b..4caf481cf8 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -17,7 +17,7 @@ jobs: strategy: matrix: - os: [macos-latest, windows-latest, ubuntu-18.04] + os: [macos-latest, windows-latest, ubuntu-22.04] steps: - name: Check out Git repository @@ -36,7 +36,7 @@ jobs: run: | sudo apt-get update && sudo apt-get install --no-install-recommends -y rpm && - sudo apt-get install --no-install-recommends -y bsdtar && + sudo apt-get install --no-install-recommends -y libarchive-tools && sudo apt-get install --no-install-recommends -y libopenjp2-tools - name: Install Snapcraft (on Ubuntu) @@ -81,6 +81,7 @@ jobs: - name: Build/release Electron app uses: samuelmeuli/action-electron-builder@v1.6.0 env: + VUE_APP_NETEASE_API_URL: /api VUE_APP_ELECTRON_API_URL: /api VUE_APP_ELECTRON_API_URL_DEV: http://127.0.0.1:10754 VUE_APP_LASTFM_API_KEY: 09c55292403d961aa517ff7f5e8a3d9c diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml new file mode 100644 index 0000000000..f8e0be8250 --- /dev/null +++ b/.github/workflows/sync.yml @@ -0,0 +1,48 @@ +name: Upstream Sync + +permissions: + contents: write + issues: write + actions: write + +on: + schedule: + - cron: '0 * * * *' # every hour + workflow_dispatch: + +jobs: + sync_latest_from_upstream: + name: Sync latest commits from upstream repo + runs-on: ubuntu-latest + if: ${{ github.event.repository.fork }} + + steps: + - uses: actions/checkout@v4 + + - name: Clean issue notice + uses: actions-cool/issues-helper@v3 + with: + actions: 'close-issues' + labels: '🚨 Sync Fail' + + - name: Sync upstream changes + id: sync + uses: aormsby/Fork-Sync-With-Upstream-action@v3.4 + with: + upstream_sync_repo: qier222/YesPlayMusic + upstream_sync_branch: master + target_sync_branch: master + target_repo_token: ${{ secrets.GITHUB_TOKEN }} # automatically generated, no need to set + test_mode: false + + - name: Sync check + if: failure() + uses: actions-cool/issues-helper@v3 + with: + actions: 'create-issue' + title: '🚨 同步失败 | Sync Fail' + labels: '🚨 Sync Fail' + body: | + Due to a change in the workflow file of the upstream repository, GitHub has automatically suspended the scheduled automatic update. You need to manually sync your fork. + + 由于上游仓库的 workflow 文件变更,导致 GitHub 自动暂停了本次自动更新,你需要手动 Sync Fork 一次。 diff --git a/Dockerfile b/Dockerfile index 19d38172a1..2fb8f95c4c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,20 @@ FROM node:16.13.1-alpine as build ENV VUE_APP_NETEASE_API_URL=/api WORKDIR /app -RUN apk add --no-cache python3 make g++ git +RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories &&\ + apk add --no-cache python3 make g++ git COPY package.json yarn.lock ./ RUN yarn install COPY . . -RUN yarn build +RUN yarn config set electron_mirror https://npmmirror.com/mirrors/electron/ && \ + yarn build FROM nginx:1.20.2-alpine as app COPY --from=build /app/package.json /usr/local/lib/ -RUN apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.14/main libuv \ +RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories &&\ + apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.14/main libuv \ && apk add --no-cache --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.14/main nodejs npm \ && npm i -g $(awk -F \" '{if($2=="NeteaseCloudMusicApi") print $2"@"$4}' /usr/local/lib/package.json) \ && rm -f /usr/local/lib/package.json @@ -19,4 +22,4 @@ RUN apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.14/m COPY --from=build /app/docker/nginx.conf.example /etc/nginx/conf.d/default.conf COPY --from=build /app/dist /usr/share/nginx/html -CMD nginx ; exec npx NeteaseCloudMusicApi +CMD nginx ; exec npx NeteaseCloudMusicApi \ No newline at end of file diff --git a/README.md b/README.md index 34efc41ee4..35018c416b 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,11 @@ [![Library][library-screenshot]](https://music.qier222.com) + +## 全新版本 +全新2.0 Alpha测试版已发布,欢迎前往 [Releases](https://github.com/qier222/YesPlayMusic/releases) 页面下载。 +当前版本将会进入维护模式,除重大bug修复外,不会再更新新功能。 + ## ✨ 特性 - ✅ 使用 Vue.js 全家桶开发 @@ -157,7 +162,7 @@ bash <(curl -s -L https://raw.githubusercontent.com/qier222/YesPlayMusic/main/in 4. 由于 replit 个人版限制内存为 1G(教育版为 3G),构建过程中可能会失败,请再次运行上述命令或运行以下命令: ```sh -cd /home/runner/${REPL_SLUG}/music && yarn installl && yarn run build +cd /home/runner/${REPL_SLUG}/music && yarn install && yarn run build ``` ## 👷‍♂️ 打包客户端 diff --git a/docker-compose.yml b/docker-compose.yml index 221b66d765..0930218980 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,6 +7,33 @@ services: volumes: - /etc/localtime:/etc/localtime:ro - /etc/timezone:/etc/timezone:ro + - ./docker/nginx.conf.example:/etc/nginx/conf.d/default.conf:ro ports: - 80:80 restart: always + depends_on: + - UnblockNeteaseMusic + environment: + - NODE_TLS_REJECT_UNAUTHORIZED=0 + networks: + my_network: + + UnblockNeteaseMusic: + image: pan93412/unblock-netease-music-enhanced + command: -o kugou kuwo migu bilibili pyncmd -p 80:443 -f 45.127.129.53 -e - + # environment: + # JSON_LOG: true + # LOG_LEVEL: debug + networks: + my_network: + aliases: + - music.163.com + - interface.music.163.com + - interface3.music.163.com + - interface.music.163.com.163jiasu.com + - interface3.music.163.com.163jiasu.com + restart: always + +networks: + my_network: + driver: bridge diff --git a/package.json b/package.json index 188b4fa1db..fc43227cc6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "yesplaymusic", - "version": "0.4.7", + "version": "0.4.8", "private": true, "description": "A third party music player for Netease Music", "author": "qier222", @@ -44,6 +44,8 @@ "electron-log": "^4.3.0", "electron-store": "^8.0.1", "electron-updater": "^5.0.1", + "esbuild": "^0.20.1", + "esbuild-loader": "^4.0.3", "express": "^4.17.1", "express-fileupload": "^1.2.0", "express-http-proxy": "^1.6.2", @@ -60,7 +62,6 @@ "pac-proxy-agent": "^4.1.0", "pangu": "^4.0.7", "plyr": "^3.6.2", - "prettier": "2.5.1", "qrcode": "^1.4.4", "register-service-worker": "^1.7.1", "svg-sprite-loader": "^6.0.11", @@ -89,6 +90,7 @@ "eslint-plugin-vue": "^7.9.0", "husky": "^4.3.0", "node-polyfill-webpack-plugin": "^2.0.1", + "prettier": "2.5.1", "sass": "^1.26.11", "sass-loader": "^10.0.2", "vue-cli-plugin-electron-builder": "~3.0.0-alpha.4", diff --git a/public/img/icons/menu-dark@88.png b/public/img/icons/menu-dark@88.png new file mode 100644 index 0000000000000000000000000000000000000000..a2feb00833cad8a136aeb2f031a7b4cd48c641ed GIT binary patch literal 1096 zcmV-O1h@N%P)6AOau)AOau)AOau(js!RoU?BqFkr$2xC?eoUfFl8*z8d$g*Jbat zJhsm6swvqTS(ZNkZtJo|+?;?DZ~{)i2{-{K-~^n26L10x6F9MOe*Nsui^!gcXxRVn ztcaZJM?~2EB_e+Y=lS046YBOLNj|&4d?+FxM1;!xEAU6zA9bS0hAawwT_DVD0@%+1 z^sR!`x(zV@b0<>AB!)Y%6tadi)HSNL1Xl$T4f5@Vl&f$xT-{ypK>OA(V0<#IC9|C} zr`#lbCL&h@kEtp784=<4&RVIEj)tn&ns?3V=p_BNRPdxFQJ1D==gZY;{RfzQv=@CpJ#py*YTUojnE4&npaj5L=Dyq5rhGjn zc~}x)g@xO=T#DN$5ip?DZ2&s!1tX;bRyBX=9)j8W=h6WyX#6vsmF!v@wE*tB4Vrb? zxQ&_stD1oe+7LbYl)vLP{22vWq~qce~ejvr+8uN|p#%n_Z|jS?gd3a%#Ucz_^2_u{#S> z@GSAA07kXEX^Bh7)*Xxi&mFM3gCxDMF<_x_sR19i3_p1|J zO-hr60Oo~3w+#V4#J9N7DJb=miTc&3B|=`1G!Hn1D43^a(xsq_OJ-h%tfDuyAm(Jx zm1CxM2_=-62X$ZFE{Vv`1|k2AIYz?zE>2jY3g?uWx<*~o#%;n0TTn7}j1E`*5F=su zrCQZY-EfJ?jVoLWXvBhQS$egznflWKXSpFFSGs|7uDrRu7;ug?k}?cH(~I8fTM=2T zQ?)eUvC8Z01h8`f-XB-#Z;zGV=;&dM0wM)a%z O0000 { console.log(`${clc.blueBright('[background.js]')} ${text}`); @@ -420,6 +421,21 @@ class Background { registerGlobalShortcut(this.window, this.store); } + // try to start osdlyrics process on start + if (this.store.get('settings.enableOsdlyricsSupport')) { + await createDbus(this.window); + log('try to start osdlyrics process'); + const osdlyricsProcess = spawn('osdlyrics'); + + osdlyricsProcess.on('error', err => { + log(`failed to start osdlyrics: ${err.message}`); + }); + + osdlyricsProcess.on('exit', (code, signal) => { + log(`osdlyrics process exited with code ${code}, signal ${signal}`); + }); + } + // create mpris if (isCreateMpris) { createMpris(this.window); diff --git a/src/components/Cover.vue b/src/components/Cover.vue index 67c030bd44..094cbd920b 100644 --- a/src/components/Cover.vue +++ b/src/components/Cover.vue @@ -136,7 +136,7 @@ img { cursor: default; transition: 0.2s; .svg-icon { - height: 44%; + width: 50%; margin: { left: 4px; } diff --git a/src/components/MvRow.vue b/src/components/MvRow.vue index f6ee06fa1e..a06fa6a99d 100644 --- a/src/components/MvRow.vue +++ b/src/components/MvRow.vue @@ -73,7 +73,7 @@ export default { artistName = mv.creator[0].userName; artistID = mv.creator[0].userId; } - return `${artistName}`; + return `${artistName}`; } else if (this.subtitle === 'publishTime') { return mv.publishTime; } diff --git a/src/components/Navbar.vue b/src/components/Navbar.vue index d362eead92..8813d6ca96 100644 --- a/src/components/Navbar.vue +++ b/src/components/Navbar.vue @@ -194,7 +194,7 @@ nav { @media (max-width: 1336px) { nav { - padding: 0 5vw; + padding: 0 max(5vw, 90px); } } diff --git a/src/components/TrackList.vue b/src/components/TrackList.vue index 9bfee491f8..1f273c6e12 100644 --- a/src/components/TrackList.vue +++ b/src/components/TrackList.vue @@ -73,6 +73,7 @@ v-for="(track, index) in tracks" :key="itemKey === 'id' ? track.id : `${track.id}${index}`" :track-prop="track" + :track-no="index + 1" :highlight-playing-track="highlightPlayingTrack" @dblclick.native=" playThisList(track.mainTrackId || track.id || track.songId) diff --git a/src/components/TrackListItem.vue b/src/components/TrackListItem.vue index a42b4a1c59..896d7fb47d 100644 --- a/src/components/TrackListItem.vue +++ b/src/components/TrackListItem.vue @@ -21,7 +21,7 @@ style="height: 14px; width: 14px" > - {{ track.no }} + {{ trackNo }}