summaryrefslogtreecommitdiffstats
path: root/src/invidious.cr
diff options
context:
space:
mode:
authorOmar Roth <omarroth@hotmail.com>2019-03-22 11:06:58 -0500
committerOmar Roth <omarroth@hotmail.com>2019-03-22 14:53:19 -0500
commit88b70973ccbb0f0e7c7ddc623e47a6c3f02a6917 (patch)
treeff7227da465f0f034a240f520f305fc404f3b5ec /src/invidious.cr
parentf0658bbd092af23e097ac52a1587688ec9ee17df (diff)
downloadinvidious-88b70973ccbb0f0e7c7ddc623e47a6c3f02a6917.tar.gz
invidious-88b70973ccbb0f0e7c7ddc623e47a6c3f02a6917.tar.bz2
invidious-88b70973ccbb0f0e7c7ddc623e47a6c3f02a6917.zip
Add 'premiereTimestamp' to /api/v1/videos
Diffstat (limited to 'src/invidious.cr')
-rw-r--r--src/invidious.cr5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/invidious.cr b/src/invidious.cr
index 8707461e..0ff28e11 100644
--- a/src/invidious.cr
+++ b/src/invidious.cr
@@ -2899,6 +2899,11 @@ get "/api/v1/videos/:id" do |env|
json.field "rating", video.info["avg_rating"].to_f32
json.field "isListed", video.is_listed
json.field "liveNow", video.live_now
+ json.field "isUpcoming", video.is_upcoming
+
+ if video.is_upcoming
+ json.field "premiereTimestamp", video.premiere_timestamp
+ end
if video.player_response["streamingData"]?.try &.["hlsManifestUrl"]?
host_url = make_host_url(config, Kemal.config)