diff --git a/transcoder/src/info.go b/transcoder/src/info.go index 98cfedb9..2a648cd4 100644 --- a/transcoder/src/info.go +++ b/transcoder/src/info.go @@ -42,6 +42,9 @@ type MediaInfo struct { /// Version of the metadata. This can be used to invalidate older metadata from db if the extraction code has changed. Versions Versions `json:"versions"` + // TODO: remove on next major + Video Video `json:"video"` + /// The list of videos if there are multiples. Videos []Video `json:"videos"` /// The list of audio tracks. @@ -96,6 +99,9 @@ type Audio struct { /// Keyframes of this video Keyframes *Keyframe `json:"-"` + + //TODO: remove this in next major + IsForced bool `json:"isForced"` } type Subtitle struct { @@ -318,5 +324,8 @@ func RetriveMediaInfo(path string, sha string) (*MediaInfo, error) { ret.MimeCodec = &container } } + if len(ret.Videos) > 0 { + ret.Video = ret.Videos[0] + } return &ret, nil } diff --git a/transcoder/src/metadata.go b/transcoder/src/metadata.go index 61bb4214..43ccaa20 100644 --- a/transcoder/src/metadata.go +++ b/transcoder/src/metadata.go @@ -187,13 +187,16 @@ func (s *MetadataService) getMetadata(path string, sha string) (*MediaInfo, erro } for rows.Next() { var c Chapter - err := rows.Scan(&c.StartTime, c.EndTime, c.Name, c.Type) + err := rows.Scan(&c.StartTime, &c.EndTime, &c.Name, &c.Type) if err != nil { return nil, err } ret.Chapters = append(ret.Chapters, c) } + if len(ret.Videos) > 0 { + ret.Video = ret.Videos[0] + } return &ret, nil }