From 1a61aa24580785afe382d179c9f133a5b5861937 Mon Sep 17 00:00:00 2001 From: imsyy Date: Fri, 27 Dec 2024 10:25:01 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix:=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E7=BD=91=E9=A1=B5=E7=AB=AF=E8=B7=A8=E5=9F=9F=20#317?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- electron/main/ipcMain.ts | 3 ++- src/components/Setting/PlaySetting.vue | 8 +++++++- src/utils/player.ts | 7 +++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/electron/main/ipcMain.ts b/electron/main/ipcMain.ts index 34f9962d..12c6b8b8 100644 --- a/electron/main/ipcMain.ts +++ b/electron/main/ipcMain.ts @@ -174,7 +174,8 @@ const initWinIpcMain = ( ipcMain.handle("get-music-files", async (_, dirPath: string) => { try { // 规范化路径 - const filePath = resolve(dirPath); + const filePath = resolve(dirPath).replace(/\\/g, "/"); + console.info(`📂 Fetching music files from: ${filePath}`); // 查找指定目录下的所有音乐文件 const musicFiles = await fg("**/*.{mp3,wav,flac}", { cwd: filePath }); // 解析元信息 diff --git a/src/components/Setting/PlaySetting.vue b/src/components/Setting/PlaySetting.vue index 01bf8226..383bd7c5 100644 --- a/src/components/Setting/PlaySetting.vue +++ b/src/components/Setting/PlaySetting.vue @@ -189,7 +189,13 @@
音乐频谱 - 开启音乐频谱会极大影响性能,如遇问题请关闭 + + {{ + isElectron + ? "开启音乐频谱会影响性能或音频输出切换等功能,如遇问题请关闭" + : "开启可能会造成无法播放或其他问题,如遇任何问题请关闭" + }} +
{ // 允许跨域 - const audioDom = this.getAudioDom(); - audioDom.crossOrigin = "anonymous"; + if (settingStore.showSpectrums) { + const audioDom = this.getAudioDom(); + audioDom.crossOrigin = "anonymous"; + } // 恢复进度( 需距离本曲结束大于 2 秒 ) if (seek && statusStore.duration - statusStore.currentTime > 2) this.setSeek(seek); // 更新状态