Files
thamanyah/cms/internal/models/video.go
T
FahdShalhoub 6f9e04ee97
Build, Push and Deploy CMS / build-push-deploy (push) Successful in 2m35s
Build, Push and Deploy Discovery / build-push-deploy (push) Successful in 1m55s
Deploy Infrastructure / pulumi-up (push) Successful in 2s
FEAT: Discovery Video Service Subscription
2026-08-29 16:50:58 +03:00

46 lines
1.5 KiB
Go

package models
import "time"
type Video struct {
ID string
Title string
Description string
CategoryIDs []int16
// CategoryNames is the same filing read by name rather than id. It is
// filled only where a caller needs categories to be self-describing —
// the catalogue announcement — and is empty elsewhere.
CategoryNames []string
Tags string
FileName string
StorageKey string
MediaConvertJobID string
Status VideoStatus
PlaybackURL string
SizeBytes int64
CreatedAt time.Time
UpdatedAt time.Time
}
// VideoStatus is the transcoding lifecycle state of a video, stored verbatim
// in videos.status. The set is closed on both sides: the database rejects
// anything outside it via the videos_status_check constraint. Adding a state
// means adding a constant here, widening that constraint in a new migration,
// and extending the `enums` annotation on api.CompleteResponse.Status.
type VideoStatus string
const (
// VideoStatusProcessing is set when the MediaConvert job is queued. Every
// video starts here, and nothing moves it on yet — see Known gaps.
VideoStatusProcessing VideoStatus = "processing"
// VideoStatusReady means transcoding finished and the output is in the
// encoded bucket, reachable through CloudFront.
VideoStatusReady VideoStatus = "ready"
// VideoStatusFailed means the MediaConvert job ended in an error.
VideoStatusFailed VideoStatus = "failed"
)
func (s VideoStatus) String() string {
return string(s)
}