From 8846d7f669c1726e030ed5437a45702836dacd5e Mon Sep 17 00:00:00 2001 From: MoYingJi Date: Wed, 19 Nov 2025 21:36:48 +0800 Subject: [PATCH] =?UTF-8?q?fix(local-lyric):=20=E7=8E=B0=E5=9C=A8=E4=BC=9A?= =?UTF-8?q?=E5=8C=B9=E9=85=8D=E5=B8=A6=E5=89=8D=E7=BC=80=E7=9A=84=E6=AD=8C?= =?UTF-8?q?=E8=AF=8D=E6=96=87=E4=BB=B6=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 也添加了注释解释 `{,*.}` 的作用,避免被误删 --- electron/main/ipc/ipc-file.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/electron/main/ipc/ipc-file.ts b/electron/main/ipc/ipc-file.ts index 1ff5dfc41..33e6d10d3 100644 --- a/electron/main/ipc/ipc-file.ts +++ b/electron/main/ipc/ipc-file.ts @@ -204,9 +204,11 @@ const initFileIpc = (): void => { try { // 定义需要查找的模式 + // 此处的 `{,*.}` 表示这里可以取 `` (empty) 也可以取 `*.` + // 将歌词文件命名为 `歌曲ID.后缀名` 或者 `任意前缀.歌曲ID.后缀名` 均可 const patterns = { - ttml: `**/${id}.ttml`, - lrc: `**/${id}.lrc`, + ttml: `**/{,*.}${id}.ttml`, + lrc: `**/{,*.}${id}.lrc`, }; // 遍历每一个目录