mirror of
https://github.com/truewhile/MeBox.git
synced 2026-10-09 06:46:37 +08:00
fix(classify): anime 无元数据时纯中文译名不再误判国漫
日本动画的中文译名几乎都是纯汉字(如「葬送的芙莉莲」),原先靠 containsHan 判中文会把日本动画误判成国漫。新增 isChineseAnime:仅在有 origin_country/ 语言元数据,或无元数据但有显式中文标记(国漫/国产/国创/华语)时才判国漫, 否则默认日番。有元数据时只认元数据,不受错误源目录名(如「国产剧」)误导。 未刮削的国漫刮出 origin_country=CN 后仍正确归类。补 4 个分类器测试用例。
This commit is contained in:
@@ -144,6 +144,43 @@ func TestClassifyMediaCategoryMatchesMoviePilotStyleRules(t *testing.T) {
|
||||
},
|
||||
want: "综艺",
|
||||
},
|
||||
{
|
||||
name: "japanese anime localized chinese title defaults to jp without metadata",
|
||||
input: mediaClassifyInput{
|
||||
MediaType: "anime",
|
||||
Title: "葬送的芙莉莲",
|
||||
},
|
||||
want: "日番",
|
||||
},
|
||||
{
|
||||
name: "chinese anime explicit marker without metadata",
|
||||
input: mediaClassifyInput{
|
||||
MediaType: "anime",
|
||||
Title: "斗破苍穹 国漫",
|
||||
},
|
||||
want: "国漫",
|
||||
},
|
||||
{
|
||||
name: "anime with JP country metadata is jp even from wrong source folder",
|
||||
input: mediaClassifyInput{
|
||||
MediaType: "anime",
|
||||
Title: "间谍过家家 SPY×FAMILY",
|
||||
Countries: []string{"JP"},
|
||||
Genres: []string{"16"},
|
||||
Category: "国产剧",
|
||||
},
|
||||
want: "日番",
|
||||
},
|
||||
{
|
||||
name: "anime with CN country metadata is cn",
|
||||
input: mediaClassifyInput{
|
||||
MediaType: "anime",
|
||||
Title: "某番",
|
||||
Countries: []string{"CN"},
|
||||
Genres: []string{"16"},
|
||||
},
|
||||
want: "国漫",
|
||||
},
|
||||
{
|
||||
name: "jav code is adult",
|
||||
input: mediaClassifyInput{
|
||||
|
||||
Reference in New Issue
Block a user