Skip to content

Commit

Permalink
fix(anitomy): add 特別篇
Browse files Browse the repository at this point in the history
  • Loading branch information
yjl9903 committed Sep 3, 2023
1 parent 4b6c12b commit accdfc5
Show file tree
Hide file tree
Showing 4 changed files with 227 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/anitomy/src/keyword.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -68,6 +68,7 @@ export class KeywordManager {
'SPECIALS',
'TV',
'特别篇',
'特別篇',
'特別編',
'番外篇',
'番外編'
Expand Down
37 changes: 37 additions & 0 deletions packages/anitomy/test/__snapshots__/index.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
`;
186 changes: 186 additions & 0 deletions packages/anitomy/test/__snapshots__/tokenizer.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
],
}
`;
3 changes: 2 additions & 1 deletion packages/anitomy/test/testcase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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];

0 comments on commit accdfc5

Please sign in to comment.