mirror of
https://github.com/imsyy/SPlayer.git
synced 2025-11-25 03:14:57 +08:00
🐞 fix: 修复歌单歌曲数量异常 #303
This commit is contained in:
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@@ -20,7 +20,7 @@ jobs:
|
|||||||
- name: Install Node.js
|
- name: Install Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: "20.x"
|
node-version: "22.x"
|
||||||
# 复制环境变量文件
|
# 复制环境变量文件
|
||||||
- name: Copy .env.example
|
- name: Copy .env.example
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
40
package.json
40
package.json
@@ -49,7 +49,7 @@
|
|||||||
"@pixi/sprite": "^7.4.2",
|
"@pixi/sprite": "^7.4.2",
|
||||||
"@vueuse/core": "^10.11.1",
|
"@vueuse/core": "^10.11.1",
|
||||||
"NeteaseCloudMusicApi": "^4.25.0",
|
"NeteaseCloudMusicApi": "^4.25.0",
|
||||||
"axios": "^1.7.7",
|
"axios": "^1.7.8",
|
||||||
"change-case": "^5.4.4",
|
"change-case": "^5.4.4",
|
||||||
"dayjs": "^1.11.13",
|
"dayjs": "^1.11.13",
|
||||||
"electron-dl": "^3.5.2",
|
"electron-dl": "^3.5.2",
|
||||||
@@ -57,16 +57,16 @@
|
|||||||
"electron-updater": "^6.3.9",
|
"electron-updater": "^6.3.9",
|
||||||
"file-saver": "^2.0.5",
|
"file-saver": "^2.0.5",
|
||||||
"font-list": "^1.5.1",
|
"font-list": "^1.5.1",
|
||||||
"github-markdown-css": "^5.7.0",
|
"github-markdown-css": "^5.8.1",
|
||||||
"howler": "^2.2.4",
|
"howler": "^2.2.4",
|
||||||
"js-cookie": "^3.0.5",
|
"js-cookie": "^3.0.5",
|
||||||
"jss": "^10.10.0",
|
"jss": "^10.10.0",
|
||||||
"jss-preset-default": "^10.10.0",
|
"jss-preset-default": "^10.10.0",
|
||||||
"localforage": "^1.10.0",
|
"localforage": "^1.10.0",
|
||||||
"lodash-es": "^4.17.21",
|
"lodash-es": "^4.17.21",
|
||||||
"marked": "^14.1.3",
|
"marked": "^14.1.4",
|
||||||
"music-metadata": "7.14.0",
|
"music-metadata": "7.14.0",
|
||||||
"pinia": "^2.2.6",
|
"pinia": "^2.2.8",
|
||||||
"pinia-plugin-persistedstate": "^3.2.3",
|
"pinia-plugin-persistedstate": "^3.2.3",
|
||||||
"plyr": "^3.7.8",
|
"plyr": "^3.7.8",
|
||||||
"vue-virt-list": "^1.5.5"
|
"vue-virt-list": "^1.5.5"
|
||||||
@@ -82,33 +82,33 @@
|
|||||||
"@types/file-saver": "^2.0.7",
|
"@types/file-saver": "^2.0.7",
|
||||||
"@types/howler": "^2.2.12",
|
"@types/howler": "^2.2.12",
|
||||||
"@types/js-cookie": "^3.0.6",
|
"@types/js-cookie": "^3.0.6",
|
||||||
"@types/node": "^22.9.0",
|
"@types/node": "^22.10.1",
|
||||||
"@typescript-eslint/eslint-plugin": "^8.13.0",
|
"@typescript-eslint/eslint-plugin": "^8.16.0",
|
||||||
"@typescript-eslint/parser": "^8.13.0",
|
"@typescript-eslint/parser": "^8.16.0",
|
||||||
"@vitejs/plugin-vue": "^5.1.4",
|
"@vitejs/plugin-vue": "^5.2.1",
|
||||||
"ajv": "^8.17.1",
|
"ajv": "^8.17.1",
|
||||||
"crypto-js": "^4.2.0",
|
"crypto-js": "^4.2.0",
|
||||||
"electron": "^30.5.1",
|
"electron": "^30.5.1",
|
||||||
"electron-builder": "^25.1.8",
|
"electron-builder": "^25.1.8",
|
||||||
"electron-log": "^5.2.0",
|
"electron-log": "^5.2.3",
|
||||||
"electron-vite": "^2.3.0",
|
"electron-vite": "^2.3.0",
|
||||||
"eslint": "^9.14.0",
|
"eslint": "^9.16.0",
|
||||||
"eslint-plugin-vue": "^9.30.0",
|
"eslint-plugin-vue": "^9.32.0",
|
||||||
"fast-glob": "^3.3.2",
|
"fast-glob": "^3.3.2",
|
||||||
"fastify": "^4.28.1",
|
"fastify": "^4.28.1",
|
||||||
"naive-ui": "^2.40.1",
|
"naive-ui": "^2.40.3",
|
||||||
"node-taglib-sharp": "^5.2.3",
|
"node-taglib-sharp": "^5.2.3",
|
||||||
"prettier": "^3.3.3",
|
"prettier": "^3.4.1",
|
||||||
"sass": "^1.80.6",
|
"sass": "^1.81.0",
|
||||||
"terser": "^5.36.0",
|
"terser": "^5.36.0",
|
||||||
"typescript": "^5.6.3",
|
"typescript": "^5.7.2",
|
||||||
"unplugin-auto-import": "^0.18.3",
|
"unplugin-auto-import": "^0.18.6",
|
||||||
"unplugin-vue-components": "^0.27.4",
|
"unplugin-vue-components": "^0.27.5",
|
||||||
"vite": "^5.4.10",
|
"vite": "^5.4.11",
|
||||||
"vite-plugin-compression": "^0.5.1",
|
"vite-plugin-compression": "^0.5.1",
|
||||||
"vite-plugin-wasm": "^3.3.0",
|
"vite-plugin-wasm": "^3.3.0",
|
||||||
"vue": "^3.5.12",
|
"vue": "^3.5.13",
|
||||||
"vue-router": "^4.4.5",
|
"vue-router": "^4.5.0",
|
||||||
"vue-tsc": "^2.1.10"
|
"vue-tsc": "^2.1.10"
|
||||||
},
|
},
|
||||||
"pnpm": {
|
"pnpm": {
|
||||||
|
|||||||
1118
pnpm-lock.yaml
generated
1118
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -355,21 +355,24 @@ const handleLocalPlaylist = (id: number) => {
|
|||||||
|
|
||||||
// 获取在线歌单
|
// 获取在线歌单
|
||||||
const handleOnlinePlaylist = async (id: number, getList: boolean, refresh: boolean) => {
|
const handleOnlinePlaylist = async (id: number, getList: boolean, refresh: boolean) => {
|
||||||
|
console.log(id, getList, refresh);
|
||||||
|
|
||||||
// 获取歌单详情
|
// 获取歌单详情
|
||||||
const detail = await playlistDetail(id);
|
const detail = await playlistDetail(id);
|
||||||
playlistDetailData.value = formatCoverList(detail.playlist)[0];
|
playlistDetailData.value = formatCoverList(detail.playlist)[0];
|
||||||
|
const count = playlistDetailData.value?.count || 0;
|
||||||
// 不需要获取列表或无歌曲
|
// 不需要获取列表或无歌曲
|
||||||
if (!getList || playlistDetailData.value.count === 0) {
|
if (!getList || count === 0) {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 如果已登录且歌曲数量少于 800,直接加载所有歌曲
|
// 如果已登录且歌曲数量少于 800,直接加载所有歌曲
|
||||||
if (isLogin() === 1 && (playlistDetailData.value?.count as number) < 800) {
|
if (isLogin() === 1 && count === detail.privileges?.length && count < 800) {
|
||||||
const ids = detail.privileges.map((song: any) => song.id as number);
|
const ids = detail.privileges.map((song: any) => song.id as number);
|
||||||
const result = await songDetail(ids);
|
const result = await songDetail(ids);
|
||||||
playlistData.value = formatSongsList(result.songs);
|
playlistData.value = formatSongsList(result.songs);
|
||||||
} else {
|
} else {
|
||||||
await getPlaylistAllSongs(id, playlistDetailData.value.count || 0, refresh);
|
await getPlaylistAllSongs(id, count, refresh);
|
||||||
}
|
}
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
};
|
};
|
||||||
@@ -424,7 +427,6 @@ const loadingMsgShow = (show: boolean = true, count?: number) => {
|
|||||||
closable: true,
|
closable: true,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
loading.value = false;
|
|
||||||
loadingMsg.value?.destroy();
|
loadingMsg.value?.destroy();
|
||||||
loadingMsg.value = null;
|
loadingMsg.value = null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user