Skip to content

Commit b57d685

Browse files
committed
🔧 build: 更新依赖
1 parent 16c8865 commit b57d685

File tree

9 files changed

+940
-967
lines changed

9 files changed

+940
-967
lines changed

auto-eslint.mjs

+3
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export default {
6363
"onBeforeUpdate": true,
6464
"onClickOutside": true,
6565
"onDeactivated": true,
66+
"onElementRemoval": true,
6667
"onErrorCaptured": true,
6768
"onKeyStroke": true,
6869
"onLongPress": true,
@@ -229,12 +230,14 @@ export default {
229230
"usePreferredDark": true,
230231
"usePreferredLanguages": true,
231232
"usePreferredReducedMotion": true,
233+
"usePreferredReducedTransparency": true,
232234
"usePrevious": true,
233235
"useRafFn": true,
234236
"useRefHistory": true,
235237
"useResizeObserver": true,
236238
"useRoute": true,
237239
"useRouter": true,
240+
"useSSRWidth": true,
238241
"useScreenOrientation": true,
239242
"useScreenSafeArea": true,
240243
"useScriptTag": true,

auto-imports.d.ts

+3
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ declare global {
5555
const onBeforeUpdate: typeof import('vue')['onBeforeUpdate']
5656
const onClickOutside: typeof import('@vueuse/core')['onClickOutside']
5757
const onDeactivated: typeof import('vue')['onDeactivated']
58+
const onElementRemoval: typeof import('@vueuse/core')['onElementRemoval']
5859
const onErrorCaptured: typeof import('vue')['onErrorCaptured']
5960
const onKeyStroke: typeof import('@vueuse/core')['onKeyStroke']
6061
const onLongPress: typeof import('@vueuse/core')['onLongPress']
@@ -221,12 +222,14 @@ declare global {
221222
const usePreferredDark: typeof import('@vueuse/core')['usePreferredDark']
222223
const usePreferredLanguages: typeof import('@vueuse/core')['usePreferredLanguages']
223224
const usePreferredReducedMotion: typeof import('@vueuse/core')['usePreferredReducedMotion']
225+
const usePreferredReducedTransparency: typeof import('@vueuse/core')['usePreferredReducedTransparency']
224226
const usePrevious: typeof import('@vueuse/core')['usePrevious']
225227
const useRafFn: typeof import('@vueuse/core')['useRafFn']
226228
const useRefHistory: typeof import('@vueuse/core')['useRefHistory']
227229
const useResizeObserver: typeof import('@vueuse/core')['useResizeObserver']
228230
const useRoute: typeof import('vue-router')['useRoute']
229231
const useRouter: typeof import('vue-router')['useRouter']
232+
const useSSRWidth: typeof import('@vueuse/core')['useSSRWidth']
230233
const useScreenOrientation: typeof import('@vueuse/core')['useScreenOrientation']
231234
const useScreenSafeArea: typeof import('@vueuse/core')['useScreenSafeArea']
232235
const useScriptTag: typeof import('@vueuse/core')['useScriptTag']

electron/main/index.ts

+2-9
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { app, shell, BrowserWindow, BrowserWindowConstructorOptions } from "electron";
2-
import { electronApp, optimizer } from "@electron-toolkit/utils";
2+
import { electronApp } from "@electron-toolkit/utils";
33
import { join } from "path";
44
import { release, type } from "os";
55
import { isDev, isMac, appName } from "./utils";
6-
import { registerAllShortcuts, unregisterShortcuts } from "./shortcut";
6+
import { unregisterShortcuts } from "./shortcut";
77
import { initTray, MainTray } from "./tray";
88
import { initThumbar, Thumbar } from "./thumbar";
99
import { type StoreType, initStore } from "./store";
@@ -75,8 +75,6 @@ class MainProcess {
7575
this.thumbar,
7676
this.store,
7777
);
78-
// 注册快捷键
79-
registerAllShortcuts(this.mainWindow!);
8078
});
8179
}
8280
// 创建窗口
@@ -218,11 +216,6 @@ class MainProcess {
218216
this.showWindow();
219217
});
220218

221-
// 开发环境控制台
222-
app.on("browser-window-created", (_, window) => {
223-
optimizer.watchWindowShortcuts(window);
224-
});
225-
226219
// 自定义协议
227220
app.on("open-url", (_, url) => {
228221
console.log("Received custom protocol URL:", url);

electron/main/ipcMain.ts

+15-19
Original file line numberDiff line numberDiff line change
@@ -217,18 +217,19 @@ const initWinIpcMain = (
217217
// 获取音乐元信息
218218
ipcMain.handle("get-music-metadata", async (_, path: string) => {
219219
try {
220-
const { common, format } = await parseFile(path);
220+
const filePath = resolve(path).replace(/\\/g, "/");
221+
const { common, format } = await parseFile(filePath);
221222
return {
222223
// 文件名称
223-
fileName: basename(path),
224+
fileName: basename(filePath),
224225
// 文件大小
225-
fileSize: (await fs.stat(path)).size / (1024 * 1024),
226+
fileSize: (await fs.stat(filePath)).size / (1024 * 1024),
226227
// 元信息
227228
common,
228229
// 音质信息
229230
format,
230231
// md5
231-
md5: await getFileMD5(path),
232+
md5: await getFileMD5(filePath),
232233
};
233234
} catch (error) {
234235
log.error("❌ Error fetching music metadata:", error);
@@ -239,24 +240,19 @@ const initWinIpcMain = (
239240
// 获取音乐歌词
240241
ipcMain.handle("get-music-lyric", async (_, path: string): Promise<string> => {
241242
try {
242-
const { common, native } = await parseFile(path);
243+
const filePath = resolve(path).replace(/\\/g, "/");
244+
const { common } = await parseFile(filePath);
243245
const lyric = common?.lyrics;
244246
if (lyric && lyric.length > 0) return String(lyric[0]);
247+
// 如果歌词数据不存在,尝试读取同名的 lrc 文件
245248
else {
246-
// 尝试读取 UNSYNCEDLYRICS
247-
const nativeTags = native["ID3v2.3"] || native["ID3v2.4"];
248-
const usltTag = nativeTags?.find((tag) => tag.id === "USLT");
249-
if (usltTag) return String(usltTag.value.text);
250-
// 如果歌词数据不存在,尝试读取同名的 lrc 文件
251-
else {
252-
const lrcFilePath = path.replace(/\.[^.]+$/, ".lrc");
253-
try {
254-
await fs.access(lrcFilePath);
255-
const lrcData = await fs.readFile(lrcFilePath, "utf-8");
256-
return lrcData || "";
257-
} catch {
258-
return "";
259-
}
249+
const lrcFilePath = filePath.replace(/\.[^.]+$/, ".lrc");
250+
try {
251+
await fs.access(lrcFilePath);
252+
const lrcData = await fs.readFile(lrcFilePath, "utf-8");
253+
return lrcData || "";
254+
} catch {
255+
return "";
260256
}
261257
}
262258
} catch (error) {

electron/main/shortcut.ts

+1-14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { BrowserWindow, globalShortcut } from "electron";
2-
import { isDev } from "./utils";
1+
import { globalShortcut } from "electron";
32
import log from "../main/logger";
43

54
// 注册快捷键并检查
@@ -29,15 +28,3 @@ export const unregisterShortcuts = () => {
2928
globalShortcut.unregisterAll();
3029
log.info("🚫 All shortcuts unregistered.");
3130
};
32-
33-
// 注册所有快捷键
34-
export const registerAllShortcuts = (win: BrowserWindow) => {
35-
// 开启控制台
36-
registerShortcut("CmdOrCtrl+Shift+I", () => {
37-
win.webContents.openDevTools({
38-
title: "SPlayer DevTools",
39-
// 客户端分离
40-
mode: isDev ? "right" : "detach",
41-
});
42-
});
43-
};

package.json

+21-21
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"@pixi/filter-bulge-pinch": "^5.1.1",
4848
"@pixi/filter-color-matrix": "^7.4.2",
4949
"@pixi/sprite": "^7.4.2",
50-
"@vueuse/core": "^12.0.0",
50+
"@vueuse/core": "^12.4.0",
5151
"NeteaseCloudMusicApi": "^4.25.0",
5252
"axios": "^1.7.9",
5353
"change-case": "^5.4.4",
@@ -65,51 +65,51 @@
6565
"jss-preset-default": "^10.10.0",
6666
"localforage": "^1.10.0",
6767
"lodash-es": "^4.17.21",
68-
"marked": "^14.1.4",
68+
"marked": "^15.0.6",
6969
"md5": "^2.3.0",
70-
"music-metadata": "7.14.0",
70+
"music-metadata": "10.5.1",
7171
"pinia": "^2.3.0",
72-
"pinia-plugin-persistedstate": "^4.1.3",
72+
"pinia-plugin-persistedstate": "^4.2.0",
7373
"plyr": "^3.7.8",
74-
"vue-virt-list": "^1.5.5"
74+
"vue-virt-list": "^1.5.9"
7575
},
7676
"devDependencies": {
7777
"@electron-toolkit/preload": "^3.0.1",
7878
"@electron-toolkit/tsconfig": "^1.0.1",
7979
"@electron-toolkit/utils": "^3.0.0",
80-
"@fastify/cookie": "^9.4.0",
81-
"@fastify/http-proxy": "^9.5.0",
82-
"@fastify/multipart": "^8.3.0",
83-
"@fastify/static": "^7.0.4",
80+
"@fastify/cookie": "^11.0.2",
81+
"@fastify/http-proxy": "^11.0.1",
82+
"@fastify/multipart": "^9.0.2",
83+
"@fastify/static": "^8.0.4",
8484
"@types/file-saver": "^2.0.7",
8585
"@types/howler": "^2.2.12",
8686
"@types/js-cookie": "^3.0.6",
8787
"@types/md5": "^2.3.5",
88-
"@types/node": "^22.10.1",
89-
"@typescript-eslint/eslint-plugin": "^8.18.0",
90-
"@typescript-eslint/parser": "^8.18.0",
88+
"@types/node": "^22.10.7",
89+
"@typescript-eslint/eslint-plugin": "^8.20.0",
90+
"@typescript-eslint/parser": "^8.20.0",
9191
"@vitejs/plugin-vue": "^5.2.1",
9292
"ajv": "^8.17.1",
9393
"crypto-js": "^4.2.0",
9494
"electron": "^30.5.1",
9595
"electron-builder": "^25.1.8",
9696
"electron-log": "^5.2.4",
9797
"electron-vite": "^2.3.0",
98-
"eslint": "^9.16.0",
98+
"eslint": "^9.18.0",
9999
"eslint-plugin-vue": "^9.32.0",
100-
"fast-glob": "^3.3.2",
101-
"fastify": "^4.29.0",
102-
"naive-ui": "^2.40.3",
103-
"node-taglib-sharp": "^5.2.3",
100+
"fast-glob": "^3.3.3",
101+
"fastify": "^5.2.1",
102+
"naive-ui": "^2.41.0",
103+
"node-taglib-sharp": "^6.0.1",
104104
"prettier": "^3.4.2",
105-
"sass": "^1.82.0",
105+
"sass": "^1.83.4",
106106
"terser": "^5.37.0",
107107
"typescript": "5.6.2",
108-
"unplugin-auto-import": "^0.18.6",
109-
"unplugin-vue-components": "^0.27.5",
108+
"unplugin-auto-import": "^0.19.0",
109+
"unplugin-vue-components": "^28.0.0",
110110
"vite": "^5.4.11",
111111
"vite-plugin-compression": "^0.5.1",
112-
"vite-plugin-wasm": "^3.3.0",
112+
"vite-plugin-wasm": "^3.4.1",
113113
"vue": "^3.5.13",
114114
"vue-router": "^4.5.0",
115115
"vue-tsc": "2.0.29"

0 commit comments

Comments
 (0)