mirror of
https://codeberg.org/SafeTwitch/safetwitch-backend.git
synced 2024-12-22 05:02:58 -05:00
Add type
This commit is contained in:
parent
a9fe2eaaf3
commit
91aba7de42
2 changed files with 3 additions and 0 deletions
|
@ -99,6 +99,7 @@ type MinifiedStreamer struct {
|
|||
}
|
||||
|
||||
type Video struct {
|
||||
Type string `json:"type"`
|
||||
Preview string `json:"preview"`
|
||||
Game MinifiedCategory `json:"game"`
|
||||
Duration int `json:"duration"`
|
||||
|
|
|
@ -244,6 +244,7 @@ func ParseMinifiedStreamer(data gjson.Result) structs.MinifiedStreamer {
|
|||
|
||||
func ParseVideo(data gjson.Result, streamer structs.Streamer) structs.Video {
|
||||
return structs.Video{
|
||||
Type: "vod",
|
||||
Preview: extractor.ProxyUrl(data.Get("previewThumbnailURL").String()),
|
||||
Game: ParseMinifiedCategory(data.Get("game")),
|
||||
Duration: int(data.Get("lengthSeconds").Int()),
|
||||
|
@ -257,6 +258,7 @@ func ParseVideo(data gjson.Result, streamer structs.Streamer) structs.Video {
|
|||
|
||||
func ParseClip(data gjson.Result, streamer structs.Streamer) structs.Video {
|
||||
return structs.Video{
|
||||
Type: "clip",
|
||||
Preview: extractor.ProxyUrl(data.Get("thumbnailURL").String()),
|
||||
Game: ParseMinifiedCategory(data.Get("clipGame")),
|
||||
Duration: int(data.Get("lengthSeconds").Int()),
|
||||
|
|
Loading…
Reference in a new issue