File tree Expand file tree Collapse file tree
internal/infrastructure/search Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ package search
2+
3+ import "testing"
4+
5+ func TestMetadataJSONScanIncludesVideoPlaybackFields (t * testing.T ) {
6+ var meta metadataJSON
7+ if err := meta .Scan ([]byte (`{
8+ "width": 1920,
9+ "height": 1080,
10+ "duration": "12m34s",
11+ "mime": "video/x-matroska",
12+ "thumb": "thumbs/video.jpg",
13+ "playback": "playback/video.mp4",
14+ "playbackMime": "video/mp4",
15+ "hls": "hls/video/index.m3u8",
16+ "processing": true
17+ }` )); err != nil {
18+ t .Fatalf ("Scan(): %v" , err )
19+ }
20+
21+ got := meta .toDomain ()
22+ if got .Playback != "playback/video.mp4" {
23+ t .Fatalf ("Playback = %q" , got .Playback )
24+ }
25+ if got .PlaybackMIME != "video/mp4" {
26+ t .Fatalf ("PlaybackMIME = %q" , got .PlaybackMIME )
27+ }
28+ if got .HLS != "hls/video/index.m3u8" {
29+ t .Fatalf ("HLS = %q" , got .HLS )
30+ }
31+ if ! got .Processing {
32+ t .Fatal ("Processing = false, want true" )
33+ }
34+ }
You can’t perform that action at this time.
0 commit comments