mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-31 20:24:27 -04:00
Add useless info fields for backward compatibility
This commit is contained in:
parent
fa6609eea9
commit
286f9f7ea8
@ -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.
|
/// Version of the metadata. This can be used to invalidate older metadata from db if the extraction code has changed.
|
||||||
Versions Versions `json:"versions"`
|
Versions Versions `json:"versions"`
|
||||||
|
|
||||||
|
// TODO: remove on next major
|
||||||
|
Video Video `json:"video"`
|
||||||
|
|
||||||
/// The list of videos if there are multiples.
|
/// The list of videos if there are multiples.
|
||||||
Videos []Video `json:"videos"`
|
Videos []Video `json:"videos"`
|
||||||
/// The list of audio tracks.
|
/// The list of audio tracks.
|
||||||
@ -96,6 +99,9 @@ type Audio struct {
|
|||||||
|
|
||||||
/// Keyframes of this video
|
/// Keyframes of this video
|
||||||
Keyframes *Keyframe `json:"-"`
|
Keyframes *Keyframe `json:"-"`
|
||||||
|
|
||||||
|
//TODO: remove this in next major
|
||||||
|
IsForced bool `json:"isForced"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Subtitle struct {
|
type Subtitle struct {
|
||||||
@ -318,5 +324,8 @@ func RetriveMediaInfo(path string, sha string) (*MediaInfo, error) {
|
|||||||
ret.MimeCodec = &container
|
ret.MimeCodec = &container
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if len(ret.Videos) > 0 {
|
||||||
|
ret.Video = ret.Videos[0]
|
||||||
|
}
|
||||||
return &ret, nil
|
return &ret, nil
|
||||||
}
|
}
|
||||||
|
@ -187,13 +187,16 @@ func (s *MetadataService) getMetadata(path string, sha string) (*MediaInfo, erro
|
|||||||
}
|
}
|
||||||
for rows.Next() {
|
for rows.Next() {
|
||||||
var c Chapter
|
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 {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
ret.Chapters = append(ret.Chapters, c)
|
ret.Chapters = append(ret.Chapters, c)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(ret.Videos) > 0 {
|
||||||
|
ret.Video = ret.Videos[0]
|
||||||
|
}
|
||||||
return &ret, nil
|
return &ret, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user