Skip to content

Commit 26f9954

Browse files
committed
fix: 修正正则匹配规则
1 parent 22ffcec commit 26f9954

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

ui/utils/detect.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ export async function detectFiles(paths, fileList, archiveList) {
8383

8484
// 构建排除指定视频和字幕文件名的正则
8585
// eslint-disable-next-line @stylistic/max-statements-per-line
86-
const excludeVideoRegex = (() => { try { return new RegExp(config.subtitle.exclude_video, "i") } catch { return null } })()
86+
const excludeVideoRegex = (() => { try { const pattern = config.subtitle.exclude_video?.trim(); return pattern ? new RegExp(pattern, "i") : null } catch { return null } })()
8787
// eslint-disable-next-line @stylistic/max-statements-per-line
88-
const excludeSubtitleRegex = (() => { try { return new RegExp(config.subtitle.exclude_subtitle, "i") } catch { return null } })()
88+
const excludeSubtitleRegex = (() => { try { const pattern = config.subtitle.exclude_subtitle?.trim(); return pattern ? new RegExp(pattern, "i") : null } catch { return null } })()
8989

9090
// 分类文件
9191
await Promise.all(allFiles.map(async (path) => {

0 commit comments

Comments
 (0)