Add movie fusion packages with locked media, ZIP export, and batch forge UI.
Paired video mode encrypts movies, uses runner-only lock hints, bundles README plus artifacts per title, and supports batch forging with progress.
This commit is contained in:
28
server/internal/builder/media_lock_test.go
Normal file
28
server/internal/builder/media_lock_test.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package builder
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestEncryptMediaRoundTrip(t *testing.T) {
|
||||
dir := t.TempDir()
|
||||
src := filepath.Join(dir, "clip.mkv")
|
||||
enc := filepath.Join(dir, "clip.mkv.cmdata")
|
||||
plain := []byte("fake movie bytes 12345")
|
||||
if err := os.WriteFile(src, plain, 0644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
key, err := NewMediaLockKey()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := EncryptMediaFile(src, enc, key); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
st, _ := os.Stat(enc)
|
||||
if st.Size() <= int64(len(plain)) {
|
||||
t.Fatalf("encrypted size unexpected: %d", st.Size())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user