fix: keep explicit source category after rejected scrape

This commit is contained in:
ShukeBta
2026-06-25 04:24:35 +08:00
parent 4e00c4c14d
commit 8a57410626
3 changed files with 190 additions and 5 deletions
+36
View File
@@ -117,6 +117,33 @@ func TestClassifyMediaCategoryMatchesSmartRules(t *testing.T) {
},
want: "未分类",
},
{
name: "latin tv keeps explicit western source category",
input: mediaClassifyInput{
MediaType: "tv",
Title: "Blades.of.the.Guardians.S02E01.1080p",
Category: "downloads 欧美剧 Blades.of.the.Guardians",
},
want: "欧美剧",
},
{
name: "generic tv folder is not treated as chinese category",
input: mediaClassifyInput{
MediaType: "tv",
Title: "The Last of Us S01E01 1080p",
Category: "downloads 电视剧",
},
want: "未分类",
},
{
name: "gala title overrides wrong western source category",
input: mediaClassifyInput{
MediaType: "tv",
Title: "HNTV Spring Festival Gala 2026 2160p WEB-DL",
Category: "欧美剧",
},
want: "综艺",
},
{
name: "platform token alone does not classify romanized drama",
input: mediaClassifyInput{
@@ -179,6 +206,15 @@ func TestClassifyMediaCategoryMatchesSmartRules(t *testing.T) {
},
want: "国漫",
},
{
name: "western movie source category remains western movie",
input: mediaClassifyInput{
MediaType: "movie",
Title: "Dune 2021 2160p",
Category: "downloads 欧美电影",
},
want: "欧美电影",
},
{
name: "jav code is adult",
input: mediaClassifyInput{