mirror of
https://github.com/imsyy/SPlayer.git
synced 2025-11-25 03:14:57 +08:00
🔧 build: 更新依赖
This commit is contained in:
@@ -63,6 +63,7 @@ export default {
|
||||
"onBeforeUpdate": true,
|
||||
"onClickOutside": true,
|
||||
"onDeactivated": true,
|
||||
"onElementRemoval": true,
|
||||
"onErrorCaptured": true,
|
||||
"onKeyStroke": true,
|
||||
"onLongPress": true,
|
||||
@@ -229,12 +230,14 @@ export default {
|
||||
"usePreferredDark": true,
|
||||
"usePreferredLanguages": true,
|
||||
"usePreferredReducedMotion": true,
|
||||
"usePreferredReducedTransparency": true,
|
||||
"usePrevious": true,
|
||||
"useRafFn": true,
|
||||
"useRefHistory": true,
|
||||
"useResizeObserver": true,
|
||||
"useRoute": true,
|
||||
"useRouter": true,
|
||||
"useSSRWidth": true,
|
||||
"useScreenOrientation": true,
|
||||
"useScreenSafeArea": true,
|
||||
"useScriptTag": true,
|
||||
|
||||
3
auto-imports.d.ts
vendored
3
auto-imports.d.ts
vendored
@@ -55,6 +55,7 @@ declare global {
|
||||
const onBeforeUpdate: typeof import('vue')['onBeforeUpdate']
|
||||
const onClickOutside: typeof import('@vueuse/core')['onClickOutside']
|
||||
const onDeactivated: typeof import('vue')['onDeactivated']
|
||||
const onElementRemoval: typeof import('@vueuse/core')['onElementRemoval']
|
||||
const onErrorCaptured: typeof import('vue')['onErrorCaptured']
|
||||
const onKeyStroke: typeof import('@vueuse/core')['onKeyStroke']
|
||||
const onLongPress: typeof import('@vueuse/core')['onLongPress']
|
||||
@@ -221,12 +222,14 @@ declare global {
|
||||
const usePreferredDark: typeof import('@vueuse/core')['usePreferredDark']
|
||||
const usePreferredLanguages: typeof import('@vueuse/core')['usePreferredLanguages']
|
||||
const usePreferredReducedMotion: typeof import('@vueuse/core')['usePreferredReducedMotion']
|
||||
const usePreferredReducedTransparency: typeof import('@vueuse/core')['usePreferredReducedTransparency']
|
||||
const usePrevious: typeof import('@vueuse/core')['usePrevious']
|
||||
const useRafFn: typeof import('@vueuse/core')['useRafFn']
|
||||
const useRefHistory: typeof import('@vueuse/core')['useRefHistory']
|
||||
const useResizeObserver: typeof import('@vueuse/core')['useResizeObserver']
|
||||
const useRoute: typeof import('vue-router')['useRoute']
|
||||
const useRouter: typeof import('vue-router')['useRouter']
|
||||
const useSSRWidth: typeof import('@vueuse/core')['useSSRWidth']
|
||||
const useScreenOrientation: typeof import('@vueuse/core')['useScreenOrientation']
|
||||
const useScreenSafeArea: typeof import('@vueuse/core')['useScreenSafeArea']
|
||||
const useScriptTag: typeof import('@vueuse/core')['useScriptTag']
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { app, shell, BrowserWindow, BrowserWindowConstructorOptions } from "electron";
|
||||
import { electronApp, optimizer } from "@electron-toolkit/utils";
|
||||
import { electronApp } from "@electron-toolkit/utils";
|
||||
import { join } from "path";
|
||||
import { release, type } from "os";
|
||||
import { isDev, isMac, appName } from "./utils";
|
||||
import { registerAllShortcuts, unregisterShortcuts } from "./shortcut";
|
||||
import { unregisterShortcuts } from "./shortcut";
|
||||
import { initTray, MainTray } from "./tray";
|
||||
import { initThumbar, Thumbar } from "./thumbar";
|
||||
import { type StoreType, initStore } from "./store";
|
||||
@@ -75,8 +75,6 @@ class MainProcess {
|
||||
this.thumbar,
|
||||
this.store,
|
||||
);
|
||||
// 注册快捷键
|
||||
registerAllShortcuts(this.mainWindow!);
|
||||
});
|
||||
}
|
||||
// 创建窗口
|
||||
@@ -218,11 +216,6 @@ class MainProcess {
|
||||
this.showWindow();
|
||||
});
|
||||
|
||||
// 开发环境控制台
|
||||
app.on("browser-window-created", (_, window) => {
|
||||
optimizer.watchWindowShortcuts(window);
|
||||
});
|
||||
|
||||
// 自定义协议
|
||||
app.on("open-url", (_, url) => {
|
||||
console.log("Received custom protocol URL:", url);
|
||||
|
||||
@@ -217,18 +217,19 @@ const initWinIpcMain = (
|
||||
// 获取音乐元信息
|
||||
ipcMain.handle("get-music-metadata", async (_, path: string) => {
|
||||
try {
|
||||
const { common, format } = await parseFile(path);
|
||||
const filePath = resolve(path).replace(/\\/g, "/");
|
||||
const { common, format } = await parseFile(filePath);
|
||||
return {
|
||||
// 文件名称
|
||||
fileName: basename(path),
|
||||
fileName: basename(filePath),
|
||||
// 文件大小
|
||||
fileSize: (await fs.stat(path)).size / (1024 * 1024),
|
||||
fileSize: (await fs.stat(filePath)).size / (1024 * 1024),
|
||||
// 元信息
|
||||
common,
|
||||
// 音质信息
|
||||
format,
|
||||
// md5
|
||||
md5: await getFileMD5(path),
|
||||
md5: await getFileMD5(filePath),
|
||||
};
|
||||
} catch (error) {
|
||||
log.error("❌ Error fetching music metadata:", error);
|
||||
@@ -239,24 +240,19 @@ const initWinIpcMain = (
|
||||
// 获取音乐歌词
|
||||
ipcMain.handle("get-music-lyric", async (_, path: string): Promise<string> => {
|
||||
try {
|
||||
const { common, native } = await parseFile(path);
|
||||
const filePath = resolve(path).replace(/\\/g, "/");
|
||||
const { common } = await parseFile(filePath);
|
||||
const lyric = common?.lyrics;
|
||||
if (lyric && lyric.length > 0) return String(lyric[0]);
|
||||
// 如果歌词数据不存在,尝试读取同名的 lrc 文件
|
||||
else {
|
||||
// 尝试读取 UNSYNCEDLYRICS
|
||||
const nativeTags = native["ID3v2.3"] || native["ID3v2.4"];
|
||||
const usltTag = nativeTags?.find((tag) => tag.id === "USLT");
|
||||
if (usltTag) return String(usltTag.value.text);
|
||||
// 如果歌词数据不存在,尝试读取同名的 lrc 文件
|
||||
else {
|
||||
const lrcFilePath = path.replace(/\.[^.]+$/, ".lrc");
|
||||
try {
|
||||
await fs.access(lrcFilePath);
|
||||
const lrcData = await fs.readFile(lrcFilePath, "utf-8");
|
||||
return lrcData || "";
|
||||
} catch {
|
||||
return "";
|
||||
}
|
||||
const lrcFilePath = filePath.replace(/\.[^.]+$/, ".lrc");
|
||||
try {
|
||||
await fs.access(lrcFilePath);
|
||||
const lrcData = await fs.readFile(lrcFilePath, "utf-8");
|
||||
return lrcData || "";
|
||||
} catch {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { BrowserWindow, globalShortcut } from "electron";
|
||||
import { isDev } from "./utils";
|
||||
import { globalShortcut } from "electron";
|
||||
import log from "../main/logger";
|
||||
|
||||
// 注册快捷键并检查
|
||||
@@ -29,15 +28,3 @@ export const unregisterShortcuts = () => {
|
||||
globalShortcut.unregisterAll();
|
||||
log.info("🚫 All shortcuts unregistered.");
|
||||
};
|
||||
|
||||
// 注册所有快捷键
|
||||
export const registerAllShortcuts = (win: BrowserWindow) => {
|
||||
// 开启控制台
|
||||
registerShortcut("CmdOrCtrl+Shift+I", () => {
|
||||
win.webContents.openDevTools({
|
||||
title: "SPlayer DevTools",
|
||||
// 客户端分离
|
||||
mode: isDev ? "right" : "detach",
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
42
package.json
42
package.json
@@ -47,7 +47,7 @@
|
||||
"@pixi/filter-bulge-pinch": "^5.1.1",
|
||||
"@pixi/filter-color-matrix": "^7.4.2",
|
||||
"@pixi/sprite": "^7.4.2",
|
||||
"@vueuse/core": "^12.0.0",
|
||||
"@vueuse/core": "^12.4.0",
|
||||
"NeteaseCloudMusicApi": "^4.25.0",
|
||||
"axios": "^1.7.9",
|
||||
"change-case": "^5.4.4",
|
||||
@@ -65,29 +65,29 @@
|
||||
"jss-preset-default": "^10.10.0",
|
||||
"localforage": "^1.10.0",
|
||||
"lodash-es": "^4.17.21",
|
||||
"marked": "^14.1.4",
|
||||
"marked": "^15.0.6",
|
||||
"md5": "^2.3.0",
|
||||
"music-metadata": "7.14.0",
|
||||
"music-metadata": "10.5.1",
|
||||
"pinia": "^2.3.0",
|
||||
"pinia-plugin-persistedstate": "^4.1.3",
|
||||
"pinia-plugin-persistedstate": "^4.2.0",
|
||||
"plyr": "^3.7.8",
|
||||
"vue-virt-list": "^1.5.5"
|
||||
"vue-virt-list": "^1.5.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@electron-toolkit/preload": "^3.0.1",
|
||||
"@electron-toolkit/tsconfig": "^1.0.1",
|
||||
"@electron-toolkit/utils": "^3.0.0",
|
||||
"@fastify/cookie": "^9.4.0",
|
||||
"@fastify/http-proxy": "^9.5.0",
|
||||
"@fastify/multipart": "^8.3.0",
|
||||
"@fastify/static": "^7.0.4",
|
||||
"@fastify/cookie": "^11.0.2",
|
||||
"@fastify/http-proxy": "^11.0.1",
|
||||
"@fastify/multipart": "^9.0.2",
|
||||
"@fastify/static": "^8.0.4",
|
||||
"@types/file-saver": "^2.0.7",
|
||||
"@types/howler": "^2.2.12",
|
||||
"@types/js-cookie": "^3.0.6",
|
||||
"@types/md5": "^2.3.5",
|
||||
"@types/node": "^22.10.1",
|
||||
"@typescript-eslint/eslint-plugin": "^8.18.0",
|
||||
"@typescript-eslint/parser": "^8.18.0",
|
||||
"@types/node": "^22.10.7",
|
||||
"@typescript-eslint/eslint-plugin": "^8.20.0",
|
||||
"@typescript-eslint/parser": "^8.20.0",
|
||||
"@vitejs/plugin-vue": "^5.2.1",
|
||||
"ajv": "^8.17.1",
|
||||
"crypto-js": "^4.2.0",
|
||||
@@ -95,21 +95,21 @@
|
||||
"electron-builder": "^25.1.8",
|
||||
"electron-log": "^5.2.4",
|
||||
"electron-vite": "^2.3.0",
|
||||
"eslint": "^9.16.0",
|
||||
"eslint": "^9.18.0",
|
||||
"eslint-plugin-vue": "^9.32.0",
|
||||
"fast-glob": "^3.3.2",
|
||||
"fastify": "^4.29.0",
|
||||
"naive-ui": "^2.40.3",
|
||||
"node-taglib-sharp": "^5.2.3",
|
||||
"fast-glob": "^3.3.3",
|
||||
"fastify": "^5.2.1",
|
||||
"naive-ui": "^2.41.0",
|
||||
"node-taglib-sharp": "^6.0.1",
|
||||
"prettier": "^3.4.2",
|
||||
"sass": "^1.82.0",
|
||||
"sass": "^1.83.4",
|
||||
"terser": "^5.37.0",
|
||||
"typescript": "5.6.2",
|
||||
"unplugin-auto-import": "^0.18.6",
|
||||
"unplugin-vue-components": "^0.27.5",
|
||||
"unplugin-auto-import": "^0.19.0",
|
||||
"unplugin-vue-components": "^28.0.0",
|
||||
"vite": "^5.4.11",
|
||||
"vite-plugin-compression": "^0.5.1",
|
||||
"vite-plugin-wasm": "^3.3.0",
|
||||
"vite-plugin-wasm": "^3.4.1",
|
||||
"vue": "^3.5.13",
|
||||
"vue-router": "^4.5.0",
|
||||
"vue-tsc": "2.0.29"
|
||||
|
||||
1792
pnpm-lock.yaml
generated
1792
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -200,8 +200,8 @@ const getSongInfo = async () => {
|
||||
name: common.title || "",
|
||||
artist: common.artist || "",
|
||||
album: common.album || "",
|
||||
alia: common.comment?.[0] || "",
|
||||
lyric: common.lyrics?.[0] || "",
|
||||
alia: (common.comment?.[0] as string) || "",
|
||||
lyric: (common.lyrics?.[0] as unknown as string) || "",
|
||||
type: format.codec,
|
||||
duration: format.duration ? Number(format.duration.toFixed(2)) : 0,
|
||||
size: fileSize,
|
||||
@@ -212,7 +212,7 @@ const getSongInfo = async () => {
|
||||
// 获取封面
|
||||
const coverBuff = common.picture?.[0]?.data || "";
|
||||
const coverType = common.picture?.[0]?.format || "";
|
||||
if (coverBuff) coverData.value = blob.createBlobURL(coverBuff, coverType, path);
|
||||
if (coverBuff) coverData.value = blob.createBlobURL(coverBuff as Buffer, coverType, path);
|
||||
};
|
||||
|
||||
// 在线匹配
|
||||
|
||||
@@ -60,6 +60,7 @@ const { start: dynamicCoverStart, stop: dynamicCoverStop } = useTimeoutFn(
|
||||
const getDynamicCover = async () => {
|
||||
if (
|
||||
isLogin() !== 1 ||
|
||||
musicStore.playSong.path ||
|
||||
!musicStore.playSong.id ||
|
||||
!settingStore.dynamicCover ||
|
||||
settingStore.playerType !== "cover"
|
||||
|
||||
Reference in New Issue
Block a user