fix download notification privacy

This commit is contained in:
ShukeBta
2026-06-27 18:08:04 +08:00
parent f386333b9c
commit 5455d4d2e4
4 changed files with 54 additions and 20 deletions
+4 -2
View File
@@ -58,8 +58,10 @@ func TestDownloadCompleteNotificationPayloadUsesTaskMetadata(t *testing.T) {
if !strings.Contains(body, "任务:正式标题") {
t.Fatalf("body should prefer task title, got %q", body)
}
if !strings.Contains(body, "保存路径:/downloads/show/Release.Name.S01E02.1080p.mkv") {
t.Fatalf("body should include content path, got %q", body)
for _, private := range []string{"保存路径", "/downloads/show", "Hash", "done123"} {
if strings.Contains(body, private) {
t.Fatalf("body should not expose %q, got %q", private, body)
}
}
for key, want := range map[string]interface{}{
"resource_title": "Release.Name.S01E02.1080p",