diff --git a/src/api/types.ts b/src/api/types.ts index 86c80ed5..afd0b1a5 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -1425,6 +1425,28 @@ export interface FilterRuleGroup { category?: string } +// 规则测试结果 +export interface RuleTestData { + // 原始标题 + title?: string + // 原始副标题 + subtitle?: string + // 规则组名称 + rulegroup_name?: string + // 规则组详情 + rulegroup?: FilterRuleGroup | null + // 识别元数据 + meta_info?: MetaInfo | null + // 媒体信息 + media_info?: MediaInfo | null + // 种子信息 + torrent_info?: TorrentInfo | null + // 优先级 + priority?: number | null + // 是否命中过滤规则 + matched?: boolean +} + // 订阅下载文件详情 export interface SubscribeDownloadFileInfo { // 种子名称 diff --git a/src/composables/useShortcutTools.ts b/src/composables/useShortcutTools.ts index 8cac5c6c..e709dfd5 100644 --- a/src/composables/useShortcutTools.ts +++ b/src/composables/useShortcutTools.ts @@ -49,7 +49,7 @@ export function useShortcutTools() { icon: 'mdi-text-recognition', dialog: 'nameTest', component: NameTestView, - maxWidth: '45rem', + maxWidth: '65rem', titleText: t('shortcut.recognition.title'), }, { @@ -58,6 +58,7 @@ export function useShortcutTools() { icon: 'mdi-filter-cog', dialog: 'ruleTest', component: RuleTestView, + maxWidth: '65rem', titleText: t('shortcut.rule.subtitle'), }, { diff --git a/src/locales/en-US.ts b/src/locales/en-US.ts index 5b091c92..50c31827 100644 --- a/src/locales/en-US.ts +++ b/src/locales/en-US.ts @@ -1536,6 +1536,39 @@ export default { recognizeAgain: 'Recognize Again', title: 'Title', subtitle: 'Subtitle', + requestFailed: 'Recognition request failed', + inputTitle: 'Test Input', + inputSubtitle: 'Enter a torrent or file name to inspect the recognition breakdown', + unrecognized: 'No media recognized', + waitingResult: 'Waiting for recognition result', + analysisTitle: 'Analysis Flow', + analysisSubtitle: 'Title preprocessing, meta info, and media match', + summary: { + year: 'Year', + episode: 'Episode', + type: 'Type', + source: 'Source', + }, + steps: { + original: { + title: 'Original Title', + caption: 'The raw string entering recognition', + }, + words: { + title: 'Custom Words', + caption: 'Applied custom recognition words', + value: '{count} matched', + none: 'No custom words applied', + }, + meta: { + title: 'Meta Info', + caption: 'Parsed name, episodes, and resource terms', + }, + media: { + title: 'Media Match', + caption: 'Final matched media source', + }, + }, }, netTest: { notTested: 'Not Tested', @@ -1549,8 +1582,46 @@ export default { title: 'Title', subtitle: 'Subtitle', ruleGroup: 'Rule Group', + ruleGroupPlaceholder: 'Please select', priority: 'Priority: {value}', noPriorityRule: 'No priority rule matched!', + requestFailed: 'Rule test request failed', + inputTitle: 'Rule Test', + inputSubtitle: 'Select a rule group to inspect filter matching and priority', + waitingResult: 'Waiting for rule test result', + matched: 'Filter rule matched', + priorityLabel: 'Priority', + analysisTitle: 'Filter Flow', + analysisSubtitle: 'Rule group, media recognition, filter match, and priority order', + ruleCount: '{count} rules', + summary: { + priority: 'Priority', + ruleGroup: 'Rule Group', + ruleCount: 'Rules', + media: 'Media', + }, + steps: { + group: { + title: 'Rule Group', + caption: 'Current group contains {count} priority rules', + empty: 'No rules in this group', + }, + media: { + title: 'Media Recognition', + caption: 'Recognize media context before filtering', + none: 'No media recognized', + }, + filter: { + title: 'Filter Match', + matched: 'Resource passes the filter rules', + pending: 'No match result returned', + }, + priority: { + title: 'Priority Result', + caption: 'Converted priority for the matched resource', + empty: 'No priority generated', + }, + }, }, setting: { about: { diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index 75a416a2..8ac6cca9 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -1529,6 +1529,39 @@ export default { recognizeAgain: '重新识别', title: '标题', subtitle: '副标题', + requestFailed: '识别请求失败', + inputTitle: '测试输入', + inputSubtitle: '输入种子名或文件名,查看媒体识别拆解结果', + unrecognized: '未识别到媒体', + waitingResult: '等待识别结果', + analysisTitle: '解析链路', + analysisSubtitle: '标题预处理、元信息和媒体匹配结果', + summary: { + year: '年份', + episode: '季集', + type: '类型', + source: '数据源', + }, + steps: { + original: { + title: '原始标题', + caption: '进入识别流程的原始字符串', + }, + words: { + title: '识别词', + caption: '自定义识别词应用情况', + value: '命中 {count} 条', + none: '未应用识别词', + }, + meta: { + title: '元信息', + caption: '解析出的名称、季集和资源信息', + }, + media: { + title: '媒体匹配', + caption: '最终匹配到的媒体数据源', + }, + }, }, netTest: { notTested: '未测试', @@ -1542,8 +1575,46 @@ export default { title: '标题', subtitle: '副标题', ruleGroup: '规则组', + ruleGroupPlaceholder: '请选择', priority: '优先级:{value}', noPriorityRule: '未命中任何优先级规则!', + requestFailed: '规则测试请求失败', + inputTitle: '规则测试', + inputSubtitle: '选择规则组后,查看过滤命中和优先级结果', + waitingResult: '等待规则测试结果', + matched: '命中过滤规则', + priorityLabel: '优先级', + analysisTitle: '过滤链路', + analysisSubtitle: '规则组、媒体识别、过滤命中和优先级排序', + ruleCount: '{count} 条', + summary: { + priority: '优先级', + ruleGroup: '规则组', + ruleCount: '规则数', + media: '媒体', + }, + steps: { + group: { + title: '规则组', + caption: '当前规则组包含 {count} 条优先级规则', + empty: '规则组暂无规则', + }, + media: { + title: '媒体识别', + caption: '过滤前先识别媒体上下文', + none: '未识别到媒体', + }, + filter: { + title: '过滤命中', + matched: '资源符合过滤规则', + pending: '未得到命中结果', + }, + priority: { + title: '排序结果', + caption: '命中资源换算后的优先级', + empty: '未生成优先级', + }, + }, }, setting: { about: { diff --git a/src/locales/zh-TW.ts b/src/locales/zh-TW.ts index 141c356e..73850a8b 100644 --- a/src/locales/zh-TW.ts +++ b/src/locales/zh-TW.ts @@ -1528,6 +1528,39 @@ export default { recognizeAgain: '重新識別', title: '標題', subtitle: '副標題', + requestFailed: '識別請求失敗', + inputTitle: '測試輸入', + inputSubtitle: '輸入種子名或檔案名,查看媒體識別拆解結果', + unrecognized: '未識別到媒體', + waitingResult: '等待識別結果', + analysisTitle: '解析鏈路', + analysisSubtitle: '標題預處理、元資訊和媒體匹配結果', + summary: { + year: '年份', + episode: '季集', + type: '類型', + source: '資料源', + }, + steps: { + original: { + title: '原始標題', + caption: '進入識別流程的原始字串', + }, + words: { + title: '識別詞', + caption: '自訂識別詞應用情況', + value: '命中 {count} 條', + none: '未套用識別詞', + }, + meta: { + title: '元資訊', + caption: '解析出的名稱、季集和資源資訊', + }, + media: { + title: '媒體匹配', + caption: '最終匹配到的媒體資料源', + }, + }, }, netTest: { notTested: '未測試', @@ -1541,8 +1574,46 @@ export default { title: '標題', subtitle: '副標題', ruleGroup: '規則組', + ruleGroupPlaceholder: '請選擇', priority: '優先級:{value}', noPriorityRule: '未命中任何優先級規則!', + requestFailed: '規則測試請求失敗', + inputTitle: '規則測試', + inputSubtitle: '選擇規則組後,查看過濾命中和優先級結果', + waitingResult: '等待規則測試結果', + matched: '命中過濾規則', + priorityLabel: '優先級', + analysisTitle: '過濾鏈路', + analysisSubtitle: '規則組、媒體識別、過濾命中和優先級排序', + ruleCount: '{count} 條', + summary: { + priority: '優先級', + ruleGroup: '規則組', + ruleCount: '規則數', + media: '媒體', + }, + steps: { + group: { + title: '規則組', + caption: '目前規則組包含 {count} 條優先級規則', + empty: '規則組暫無規則', + }, + media: { + title: '媒體識別', + caption: '過濾前先識別媒體上下文', + none: '未識別到媒體', + }, + filter: { + title: '過濾命中', + matched: '資源符合過濾規則', + pending: '未取得命中結果', + }, + priority: { + title: '排序結果', + caption: '命中資源換算後的優先級', + empty: '未產生優先級', + }, + }, }, setting: { about: { diff --git a/src/views/system/NameTestView.vue b/src/views/system/NameTestView.vue index d1b94e4b..b5fedd31 100644 --- a/src/views/system/NameTestView.vue +++ b/src/views/system/NameTestView.vue @@ -1,11 +1,22 @@ + + diff --git a/src/views/system/RuleTestView.vue b/src/views/system/RuleTestView.vue index 65f123f6..ae74496a 100644 --- a/src/views/system/RuleTestView.vue +++ b/src/views/system/RuleTestView.vue @@ -1,21 +1,44 @@ + +