From f8ed778a2746e26c04718fc9348ac84113decc23 Mon Sep 17 00:00:00 2001 From: x1ao4 Date: Fri, 25 Apr 2025 23:02:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=9B=86=E7=BC=96=E5=8F=B7?= =?UTF-8?q?=E8=AF=86=E5=88=AB=E8=A7=84=E5=88=99=E7=9A=84=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/templates/index.html | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/app/templates/index.html b/app/templates/index.html index b2117f9..b39735b 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -185,7 +185,7 @@
集编号识别规则
- + @@ -607,11 +607,11 @@ return this.formData.episode_patterns.map(p => p.regex || '').join('|'); }, set(value) { - // 将文本拆分为竖线分隔的表达式,每个创建一个正则对象 - const patterns = value.split('|').filter(pattern => pattern.trim() !== ''); - this.formData.episode_patterns = patterns.map(pattern => ({ - regex: pattern.trim() - })); + // 允许直接输入正则表达式,当用户按下Enter键或失焦时再处理 + // 这里我们创建一个单一的正则表达式对象,而不是拆分 + this.formData.episode_patterns = [{ + regex: value.trim() + }]; } } }, @@ -681,17 +681,7 @@ // 如果没有剧集识别模式,添加默认模式 if (!this.formData.episode_patterns || this.formData.episode_patterns.length === 0) { this.formData.episode_patterns = [ - { name: 'EP_DIJI', description: '第[]集', regex: '第(\\d+)集' }, - { name: 'EP_DIQI', description: '第[]期', regex: '第(\\d+)期' }, - { name: 'EP_DIHUA', description: '第[]话', regex: '第(\\d+)话' }, - { name: 'EP_JI', description: '[]集', regex: '(\\d+)集' }, - { name: 'EP_QI', description: '[]期', regex: '(\\d+)期' }, - { name: 'EP_HUA', description: '[]话', regex: '(\\d+)话' }, - { name: 'EP_E_EP', description: 'E/EP[]', regex: '[Ee][Pp]?(\\d+)' }, - { name: 'EP_4K', description: '[]-4K', regex: '(\\d+)[-_\\s]*4[Kk]' }, - { name: 'EP_SQUAREBRACKET', description: '方括号数字', regex: '\\[(\\d+)\\]' }, - { name: 'EP_BRACKET', description: '【[]】', regex: '【(\\d+)】' }, - { name: 'EP_UNDERSCORE', description: '_[]_', regex: '_?(\\d+)_?' } + { regex: '第(\\d+)集|第(\\d+)期|第(\\d+)话|(\\d+)集|(\\d+)期|(\\d+)话|[Ee][Pp]?(\\d+)|(\\d+)[-_\\s]*4[Kk]|\\[(\\d+)\\]|【(\\d+)】|_?(\\d+)_?' } ]; } }, 500);