diff --git a/packages/anitomy/src/keyword.ts b/packages/anitomy/src/keyword.ts index 686fe8fc..e8c952a4 100644 --- a/packages/anitomy/src/keyword.ts +++ b/packages/anitomy/src/keyword.ts @@ -1,7 +1,7 @@ -import { ElementCategory } from './element'; import type { ParsedResult } from './types'; import { TextRange } from './token'; +import { ElementCategory } from './element'; export interface KeywordOptions { identifiable: boolean; @@ -68,6 +68,7 @@ export class KeywordManager { 'SPECIALS', 'TV', '特别篇', + '特別篇', '特別編', '番外篇', '番外編' diff --git a/packages/anitomy/test/__snapshots__/index.test.ts.snap b/packages/anitomy/test/__snapshots__/index.test.ts.snap index 9b77e7d2..1938f9cc 100644 --- a/packages/anitomy/test/__snapshots__/index.test.ts.snap +++ b/packages/anitomy/test/__snapshots__/index.test.ts.snap @@ -406,3 +406,40 @@ exports[`Other filenames > should parse 11`] = ` "year": undefined, } `; + +exports[`Other filenames > should parse 12`] = ` +{ + "audio": { + "term": "AAC", + }, + "episode": { + "number": undefined, + "numberAlt": undefined, + "title": undefined, + }, + "file": { + "checksum": undefined, + "extension": "MP4", + "name": "[ANi] 無職轉生~到了異世界就拿出真本事 第二季 - 特別篇 [1080P][Baha][WEB-DL][AAC AVC][CHT][V2][MP4]", + }, + "language": "CHT", + "month": undefined, + "release": { + "group": "ANi", + "version": 2, + }, + "season": "2", + "source": "WEB-DL", + "subtitles": undefined, + "title": "無職轉生~到了異世界就拿出真本事 第二季 - 特別篇", + "type": "特別篇", + "video": { + "resolution": "1080P", + "term": "AVC", + }, + "volume": { + "number": undefined, + }, + "year": undefined, +} +`; diff --git a/packages/anitomy/test/__snapshots__/tokenizer.test.ts.snap b/packages/anitomy/test/__snapshots__/tokenizer.test.ts.snap index 700a5d60..09836184 100644 --- a/packages/anitomy/test/__snapshots__/tokenizer.test.ts.snap +++ b/packages/anitomy/test/__snapshots__/tokenizer.test.ts.snap @@ -14233,3 +14233,189 @@ exports[`tokenize > should work 71`] = ` ], } `; + +exports[`tokenize > should work 72`] = ` +{ + "ok": true, + "result": { + "video.resolution": "1080P", + }, + "tokens": [ + { + "category": "Bracket", + "content": "[", + "enclosed": true, + }, + { + "category": "Unknown", + "content": "ANi", + "enclosed": true, + }, + { + "category": "Bracket", + "content": "]", + "enclosed": true, + }, + { + "category": "Delimiter", + "content": " ", + "enclosed": false, + }, + { + "category": "Unknown", + "content": "無職轉生~到了異世界就拿出真本事", + "enclosed": false, + }, + { + "category": "Delimiter", + "content": " ", + "enclosed": false, + }, + { + "category": "Unknown", + "content": "第二季", + "enclosed": false, + }, + { + "category": "Delimiter", + "content": " ", + "enclosed": false, + }, + { + "category": "Unknown", + "content": "-", + "enclosed": false, + }, + { + "category": "Delimiter", + "content": " ", + "enclosed": false, + }, + { + "category": "Unknown", + "content": "特別篇", + "enclosed": false, + }, + { + "category": "Delimiter", + "content": " ", + "enclosed": false, + }, + { + "category": "Bracket", + "content": "[", + "enclosed": true, + }, + { + "category": "Identifier", + "content": "1080P", + "enclosed": true, + }, + { + "category": "Bracket", + "content": "]", + "enclosed": true, + }, + { + "category": "Bracket", + "content": "[", + "enclosed": true, + }, + { + "category": "Unknown", + "content": "Baha", + "enclosed": true, + }, + { + "category": "Bracket", + "content": "]", + "enclosed": true, + }, + { + "category": "Bracket", + "content": "[", + "enclosed": true, + }, + { + "category": "Unknown", + "content": "WEB-DL", + "enclosed": true, + }, + { + "category": "Bracket", + "content": "]", + "enclosed": true, + }, + { + "category": "Bracket", + "content": "[", + "enclosed": true, + }, + { + "category": "Unknown", + "content": "AAC", + "enclosed": true, + }, + { + "category": "Delimiter", + "content": " ", + "enclosed": true, + }, + { + "category": "Unknown", + "content": "AVC", + "enclosed": true, + }, + { + "category": "Bracket", + "content": "]", + "enclosed": true, + }, + { + "category": "Bracket", + "content": "[", + "enclosed": true, + }, + { + "category": "Unknown", + "content": "CHT", + "enclosed": true, + }, + { + "category": "Bracket", + "content": "]", + "enclosed": true, + }, + { + "category": "Bracket", + "content": "[", + "enclosed": true, + }, + { + "category": "Unknown", + "content": "V2", + "enclosed": true, + }, + { + "category": "Bracket", + "content": "]", + "enclosed": true, + }, + { + "category": "Bracket", + "content": "[", + "enclosed": true, + }, + { + "category": "Unknown", + "content": "MP4", + "enclosed": true, + }, + { + "category": "Bracket", + "content": "]", + "enclosed": true, + }, + ], +} +`; diff --git a/packages/anitomy/test/testcase.ts b/packages/anitomy/test/testcase.ts index 7820ac00..dbe9255d 100644 --- a/packages/anitomy/test/testcase.ts +++ b/packages/anitomy/test/testcase.ts @@ -78,7 +78,8 @@ export const other = [ `[爱恋字幕社&漫猫字幕社][4月新番][和山田进行LV999 的恋爱][Yamada-kun to Lv999 no Koi wo Suru][13Fin][1080p][MP4][简中]`, `[爱恋字幕社&漫猫字幕社] 和山田进行LV999 的恋爱/Yamada-kun to Lv999 no Koi wo Suru (01-13Fin WEBRIP 720p AVC AAC MP4 2023年4月 简中)`, `[DMG&RoxyLib] 無職転生 [BDRip][1080P][CHS][MP4]/[DMG&RoxyLib] 無職転生 番外編「エリスのゴブリン討伐」[BDRip][AVC_AAC][1080P][CHS](08FF8DBF).mp4`, - `【极影字幕社】★7月新番 白圣女与黑牧师 Shiro Seijo to Kuro Bokushi 第01v2话 GB 1080P MP4(字幕社招人内详)` + `【极影字幕社】★7月新番 白圣女与黑牧师 Shiro Seijo to Kuro Bokushi 第01v2话 GB 1080P MP4(字幕社招人内详)`, + `[ANi] 無職轉生~到了異世界就拿出真本事 第二季 - 特別篇 [1080P][Baha][WEB-DL][AAC AVC][CHT][V2][MP4]` ]; export const filesnames = [...LoliHouse, ...LilithRaws, ...KitaujiSub, ...other];