fix(web): up list search matches up name only, not video titles

This commit is contained in:
kairee committed 2026-11-01 17:57:34 +08:00
1 parent a6bd910d9d
commit 003e65086e
2 files changed
+26 -2

No files matched your search

+13
View File
@@ -203,6 +203,19 @@ def test_up_queries():
assert blacklisted["blacklisted"] is True
assert blacklisted["video_count"] == 1
assert q.up_detail(999999) is None
# UP 搜索只匹配 UP 名,不匹配视频标题
title_only = q.list_ups(q="视频")
assert title_only["total"] == 0
name_match = q.list_ups(q="UP A")
assert name_match["total"] == 1
assert name_match["items"][0]["up_mid"] == 1
assert name_match["items"][0]["video_count"] == 2
# 大小写不敏感
lower = q.list_ups(q="up b")
assert lower["total"] == 1 and lower["items"][0]["up_mid"] == 2
# 命中多个 UP
assert q.list_ups(q="UP")["total"] == 2
finally:
db.close()