Fix local adult metadata and watch history removal

This commit is contained in:
ShukeBta
2026-05-28 14:52:20 +08:00
parent 352edd86ed
commit 32ccb33fed
95 changed files with 6589 additions and 1307 deletions
+24
View File
@@ -0,0 +1,24 @@
package service
import "testing"
func TestBuildSubscribeKeyword(t *testing.T) {
if got := buildSubscribeKeyword("沙丘", 2024); got != "沙丘 2024" {
t.Fatalf("keyword = %q", got)
}
if got := buildSubscribeKeyword("沙丘", 0); got != "沙丘" {
t.Fatalf("keyword without year = %q", got)
}
}
func TestDedupeExternalMedia(t *testing.T) {
in := []ExternalMediaResult{
{Source: "tmdb", MediaType: "movie", TMDbID: 1, Title: "A"},
{Source: "tmdb", MediaType: "movie", TMDbID: 1, Title: "A duplicate"},
{Source: "douban", DoubanID: "2", Title: "B"},
}
got := dedupeExternalMedia(in)
if len(got) != 2 {
t.Fatalf("len = %d", len(got))
}
}