init: hgmj server initial commit

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-10-08 16:50:13 +08:00
co-authored by Claude Opus 4.7
commit 625e89c15d
1870 changed files with 254090 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
package vidmod
import (
"testing"
"time"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
)
func TestPendingH265SuccessFilterBindsAttemptState(t *testing.T) {
id := primitive.NewObjectID()
source := " /sp/movie/index.m3u8 "
pendingAt := time.Date(2026, 7, 25, 12, 30, 0, 0, time.UTC)
filter := pendingH265AttemptFilter(id, source, pendingAt)
if filter["_id"] != id {
t.Fatalf("filter id = %v, want %v", filter["_id"], id)
}
if filter["sourceURL"] != source {
t.Fatalf("filter sourceURL = %q, want exact stored source %q", filter["sourceURL"], source)
}
if filter["h265Status"] != H265StatusPending {
t.Fatalf("filter status = %v, want pending", filter["h265Status"])
}
if filter["h265PendingAt"] != pendingAt {
t.Fatalf("filter pendingAt = %v, want %v", filter["h265PendingAt"], pendingAt)
}
missing, ok := filter["$or"].(bson.A)
if !ok || len(missing) != 3 {
t.Fatalf("filter must require a missing H265 URL: %#v", filter["$or"])
}
}