From 92d0b2ea8b11a3f7c07ffb086f5b7aca7e195547 Mon Sep 17 00:00:00 2001
From: qier222
Date: Mon, 3 Jan 2022 15:45:59 +0800
Subject: [PATCH 01/58] docs: update README
---
README.md | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index a0643d7..548dcc5 100644
--- a/README.md
+++ b/README.md
@@ -9,7 +9,8 @@
高颜值的第三方网易云播放器
🌎 访问DEMO |
- 📦️ 下载安装包
+ 📦️ 下载安装包 |
+ 💬 加入交流群
From f9ad6aef0516eb2a5e13843c23b7d955b52c28cc Mon Sep 17 00:00:00 2001
From: qier222
Date: Mon, 3 Jan 2022 15:56:22 +0800
Subject: [PATCH 02/58] build: release 0.4.3
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 729c51c..eb936ac 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "yesplaymusic",
- "version": "0.4.2",
+ "version": "0.4.3",
"private": true,
"description": "A third party music player for Netease Music",
"author": "qier222",
From 98ac9fd1acec6bc80b060be515608052549a04cf Mon Sep 17 00:00:00 2001
From: chen310 <33364396+chen310@users.noreply.github.com>
Date: Tue, 4 Jan 2022 18:35:31 +0800
Subject: [PATCH 03/58] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E6=9F=90?=
=?UTF-8?q?=E4=BA=9B=E6=AD=8C=E6=9B=B2=EF=BC=88=E5=A6=82=E5=B7=B2=E8=B4=AD?=
=?UTF-8?q?=E4=B8=93=E8=BE=91=EF=BC=89=E8=83=BD=E6=92=AD=E6=94=BE=E4=BD=86?=
=?UTF-8?q?=E4=BB=8D=E7=84=B6=E5=8F=98=E7=81=B0=E7=9A=84=E9=97=AE=E9=A2=98?=
=?UTF-8?q?=20(#1173)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/utils/common.js | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/utils/common.js b/src/utils/common.js
index b7f2355..0e6b2ff 100644
--- a/src/utils/common.js
+++ b/src/utils/common.js
@@ -9,6 +9,9 @@ export function isTrackPlayable(track) {
playable: true,
reason: '',
};
+ if (track?.privilege?.pl > 0) {
+ return result;
+ }
// cloud storage judgement logic
if (isAccountLoggedIn() && track?.privilege?.cs) {
return result;
From 5071e82e1c94f284b3b882547e697b21d00b1a6f Mon Sep 17 00:00:00 2001
From: pan93412
Date: Wed, 5 Jan 2022 20:14:08 +0800
Subject: [PATCH 04/58] build: degrade electron to 13.0.1
Seems like Electron 13.6 breaks the Windows 7 support.
We degrade Electron's version to what 0.4.2 uses.
Related: #1179
---
package.json | 2 +-
yarn.lock | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/package.json b/package.json
index eb936ac..145d9f0 100644
--- a/package.json
+++ b/package.json
@@ -36,7 +36,7 @@
"dayjs": "^1.8.36",
"dexie": "^3.0.3",
"discord-rich-presence": "^0.0.8",
- "electron": "^13.0.1",
+ "electron": "~13.0.1",
"electron-builder": "^22.10.5",
"electron-context-menu": "^2.3.0",
"electron-debug": "^3.1.0",
diff --git a/yarn.lock b/yarn.lock
index 4df813a..f8af82a 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -4794,10 +4794,10 @@ electron-updater@^4.3.5:
lodash.isequal "^4.5.0"
semver "^7.3.4"
-electron@^13.0.1:
- version "13.6.3"
- resolved "https://registry.yarnpkg.com/electron/-/electron-13.6.3.tgz#c0217178807d3e0b2175c49dbe33ea8dac447e73"
- integrity sha512-kevgR6/RuEhchJQbgCKhHle9HvJhi2dOJlicFZJqbbqa9BVpZARqqFDlwTSatYxmUPUJwu09FvyMwJG2DMQIng==
+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==
dependencies:
"@electron/get" "^1.0.1"
"@types/node" "^14.6.2"
From 3d71e9fc00f72eadd359d5cc68218d942b49adda Mon Sep 17 00:00:00 2001
From: Rick
Date: Fri, 7 Jan 2022 21:32:00 +0800
Subject: [PATCH 05/58] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E6=88=91?=
=?UTF-8?q?=E7=9A=84=E5=90=AC=E6=AD=8C=E6=8E=92=E8=A1=8C=20(#274)=20(#1197?=
=?UTF-8?q?)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
netease_api/routes/index.js | 1 +
src/api/user.js | 17 ++++++++++++
src/components/TrackListItem.vue | 5 +++-
src/store/actions.js | 25 ++++++++++++++++++
src/views/library.vue | 44 ++++++++++++++++++++++++++++++++
5 files changed, 91 insertions(+), 1 deletion(-)
diff --git a/netease_api/routes/index.js b/netease_api/routes/index.js
index 816ff3a..13e9112 100644
--- a/netease_api/routes/index.js
+++ b/netease_api/routes/index.js
@@ -25,6 +25,7 @@ const table = {
'/artist/sublist': require('../module/artist_sublist'),
'/login/refresh': require('../module/login_refresh'),
'/user/playlist': require('../module/user_playlist'),
+ '/user/record': require('../module/user_record'),
'/album/sublist': require('../module/album_sublist'),
'/artist/album': require('../module/artist_album'),
'/personalized': require('../module/personalized'),
diff --git a/src/api/user.js b/src/api/user.js
index 8269297..ec02014 100644
--- a/src/api/user.js
+++ b/src/api/user.js
@@ -50,6 +50,23 @@ export function userPlaylist(params) {
});
}
+/**
+ * 获取用户播放记录
+ * 说明 : 登录后调用此接口 , 传入用户 id, 可获取用户播放记录
+ * - uid : 用户 id
+ * - type : type=1 时只返回 weekData, type=0 时返回 allData
+ * @param {Object} params
+ * @param {number} params.uid
+ * @param {number} params.type
+ */
+export function userPlayHistory(params) {
+ return request({
+ url: '/user/record',
+ method: 'get',
+ params,
+ });
+}
+
/**
* 喜欢音乐列表(需要登录)
* 说明 : 调用此接口 , 传入用户 id, 可获取已喜欢音乐id列表(id数组)
diff --git a/src/components/TrackListItem.vue b/src/components/TrackListItem.vue
index 94ae753..9aaa45d 100644
--- a/src/components/TrackListItem.vue
+++ b/src/components/TrackListItem.vue
@@ -80,6 +80,8 @@
{{ track.dt | formatTime }}
+
+ {{ track.playCount }}
@@ -349,7 +351,8 @@ button {
-webkit-line-clamp: 2;
overflow: hidden;
}
- .time {
+ .time,
+ .count {
font-size: 16px;
width: 50px;
cursor: default;
diff --git a/src/store/actions.js b/src/store/actions.js
index 39bb019..e0218cc 100644
--- a/src/store/actions.js
+++ b/src/store/actions.js
@@ -5,6 +5,7 @@ import { getPlaylistDetail } from '@/api/playlist';
import { getTrackDetail } from '@/api/track';
import {
userPlaylist,
+ userPlayHistory,
userLikedSongsIDs,
likedAlbums,
likedArtists,
@@ -164,6 +165,30 @@ export default {
}
});
},
+ fetchPlayHistory: ({ state, commit }) => {
+ if (!isAccountLoggedIn()) return;
+ return Promise.all([
+ userPlayHistory({ uid: state.data.user?.userId, type: 0 }),
+ userPlayHistory({ uid: state.data.user?.userId, type: 1 }),
+ ]).then(result => {
+ const data = {};
+ const dataType = { 0: 'allData', 1: 'weekData' };
+ if (result[0] && result[1]) {
+ for (let i = 0; i < result.length; i++) {
+ const songData = result[i][dataType[i]].map(item => {
+ const song = item.song;
+ song.playCount = item.playCount;
+ return song;
+ });
+ data[[dataType[i]]] = songData;
+ }
+ commit('updateLikedXXX', {
+ name: 'playHistory',
+ data: data,
+ });
+ }
+ });
+ },
fetchUserProfile: ({ commit }) => {
if (!isAccountLoggedIn()) return;
return userAccount().then(result => {
diff --git a/src/views/library.vue b/src/views/library.vue
index fa54fc2..3d93e19 100644
--- a/src/views/library.vue
+++ b/src/views/library.vue
@@ -87,6 +87,13 @@
>
云盘
+
+ 听歌排行
+
+
+
+
+
+
+
{
@@ -279,6 +309,7 @@ export default {
this.$store.dispatch('fetchLikedArtists');
this.$store.dispatch('fetchLikedMVs');
this.$store.dispatch('fetchCloudDisk');
+ this.$store.dispatch('fetchPlayHistory');
},
playLikedSongs() {
this.$store.state.player.playPlaylistByID(
@@ -526,4 +557,17 @@ button.tab-button {
transform: scale(0.92);
}
}
+
+button.playHistory-button {
+ color: var(--color-text);
+ border-radius: 8px;
+ padding: 10px;
+ transition: 0.2s;
+ opacity: 0.68;
+ font-weight: 500;
+ &:hover {
+ opacity: 1;
+ background: var(--color-secondary-bg);
+ }
+}
From 07b5d4de3dbae68fd967567aef5b53a4e5366313 Mon Sep 17 00:00:00 2001
From: memorydream <34763046+memorydream@users.noreply.github.com>
Date: Sat, 8 Jan 2022 01:12:16 +0800
Subject: [PATCH 06/58] fix: lyrics sort (#1199)
---
src/utils/lyrics.js | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/utils/lyrics.js b/src/utils/lyrics.js
index f0ed888..1b2e064 100644
--- a/src/utils/lyrics.js
+++ b/src/utils/lyrics.js
@@ -29,5 +29,6 @@ export function parseLyric(lrc) {
}
}
}
+ lrcObj.sort((a, b) => a.time - b.time);
return lrcObj;
}
From 14566b20b295153ca4eed4a5163c62e7b195768e Mon Sep 17 00:00:00 2001
From: memorydream <34763046+memorydream@users.noreply.github.com>
Date: Sat, 8 Jan 2022 17:33:41 +0800
Subject: [PATCH 07/58] fix: library extract lyric part (#1201)
---
src/views/library.vue | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/views/library.vue b/src/views/library.vue
index 3d93e19..32acb7d 100644
--- a/src/views/library.vue
+++ b/src/views/library.vue
@@ -211,7 +211,7 @@ import MvRow from '@/components/MvRow.vue';
* @returns {string} The lyric part
*/
function extractLyricPart(rawLyric) {
- return rawLyric.split(']')[1].trim();
+ return rawLyric.split(']').pop().trim();
}
export default {
From 66f9b4f526f9e4a03496762833dfb3b7688ae0bd Mon Sep 17 00:00:00 2001
From: Rick
Date: Sat, 8 Jan 2022 19:26:11 +0800
Subject: [PATCH 08/58] =?UTF-8?q?chore:=20=E6=94=AF=E6=8C=81=20Docker=20?=
=?UTF-8?q?=E9=83=A8=E7=BD=B2=20(#1195)=20(#1200)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.dockerignore | 16 ++++++++++++++++
Dockerfile | 42 ++++++++++++++++++++++++++++++++++++++++++
README.md | 22 ++++++++++++++++++++++
docker-compose.yml | 9 +++++++++
4 files changed, 89 insertions(+)
create mode 100644 .dockerignore
create mode 100644 Dockerfile
create mode 100644 docker-compose.yml
diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 0000000..03f2450
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,16 @@
+node_modules
+npm-debug.log
+Dockerfile*
+docker-compose*
+.dockerignore
+.git
+.github
+.gitignore
+README.md
+LICENSE
+.vscode
+dist
+dist_electron
+build
+images
+script
\ No newline at end of file
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..58128ce
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,42 @@
+FROM node:lts-alpine as build
+ENV VUE_APP_NETEASE_API_URL=/api
+WORKDIR /app
+COPY . .
+RUN yarn && yarn build
+
+FROM nginx:alpine as app
+COPY --from=build /app/dist /usr/share/nginx/html
+COPY --from=build /app/netease_api /usr/src/netease_api
+WORKDIR /usr/src/netease_api
+
+RUN apk add --no-cache --repository http://nl.alpinelinux.org/alpine/edge/main libuv \
+ && apk add --no-cache --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/main nodejs=16.13.1-r1 npm=8.3.0-r0 \
+ && npm install
+
+RUN echo $'server { \n\
+ gzip on;\n\
+ listen 80; \n\
+ listen [::]:80; \n\
+ server_name localhost; \n\
+ \n\
+ location / { \n\
+ root /usr/share/nginx/html; \n\
+ index index.html; \n\
+ try_files $uri $uri/ /index.html; \n\
+ } \n\
+ \n\
+ location @rewrites { \n\
+ rewrite ^(.*)$ /index.html last; \n\
+ } \n\
+ \n\
+ location /api/ { \n\
+ proxy_set_header Host $host; \n\
+ proxy_set_header X-Real-IP $remote_addr; \n\
+ proxy_set_header X-Forwarded-For $remote_addr; \n\
+ proxy_set_header X-Forwarded-Host $remote_addr; \n\
+ proxy_set_header X-NginX-Proxy true; \n\
+ proxy_pass http://localhost:3000/; \n\
+ } \n\
+}' > /etc/nginx/conf.d/default.conf
+
+CMD nginx ; exec node app.js
\ No newline at end of file
diff --git a/README.md b/README.md
index 548dcc5..2f8c92c 100644
--- a/README.md
+++ b/README.md
@@ -113,6 +113,28 @@ yarn run build
7. 将 `/dist` 目录下的文件上传到你的 Web 服务器
+## ⚙️ Docker 部署
+
+1. 构建 Docker Image
+
+```sh
+docker build -t yesplaymusic .
+```
+
+2. 启动 Docker Container
+
+```sh
+docker run -d --name YesPlayMusic -p 80:80 yesplaymusic
+```
+
+3. Docker Compose 启动
+
+```sh
+docker-compose up -d
+```
+
+YesPlayMusic 地址为 `http://localhost`
+
## 👷♂️ 打包客户端
如果在 Release 页面没有找到适合你的设备的安装包的话,你可以根据下面的步骤来打包自己的客户端。
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644
index 0000000..efc2826
--- /dev/null
+++ b/docker-compose.yml
@@ -0,0 +1,9 @@
+services:
+ YesPlayMusic:
+ build:
+ context: .
+ image: yesplaymusic
+ container_name: YesPlayMusic
+ ports:
+ - 80:80
+ restart: always
From b501214c0283b2396140501ff6c190d8e7b29935 Mon Sep 17 00:00:00 2001
From: memorydream <34763046+memorydream@users.noreply.github.com>
Date: Sun, 9 Jan 2022 18:12:30 +0800
Subject: [PATCH 09/58] fix: context menu position (#1207)
* fix: context menu position
* fix: context menu position with player disabled
---
src/components/ContextMenu.vue | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/components/ContextMenu.vue b/src/components/ContextMenu.vue
index dd6365b..a290a47 100644
--- a/src/components/ContextMenu.vue
+++ b/src/components/ContextMenu.vue
@@ -15,6 +15,8 @@
-
-
-
-
-
-
-
-
-
-
-
-