Invidious is an alternative front-end to YouTube
show how long ago stream started
Andrew Zhao295e5c9731f3
diff --git a/src/invidious/videos.cr b/src/invidious/videos.crindex 74edc156..d0b7d6db 100644--- a/src/invidious/videos.cr+++ b/src/invidious/videos.cr@@ -534,7 +534,8 @@ struct Videoenddef live_now- info["videoDetails"]["isLiveContent"]?.try &.as_bool || false+ info["microformat"]?.try &.["playerMicroformatRenderer"]?+ .try &.["liveBroadcastDetails"]?.try &.["isLiveNow"]?.try &.as_bool || falseenddef is_listeddiff --git a/src/invidious/views/watch.ecr b/src/invidious/views/watch.ecrindex 924914a5..a86e23b2 100644--- a/src/invidious/views/watch.ecr+++ b/src/invidious/views/watch.ecr@@ -81,6 +81,10 @@<h3><%= video.premiere_timestamp.try { |t| translate(locale, "Premieres in `x`", recode_date((t - Time.utc).ago, locale)) } %></h3>+ <% elsif video.live_now %>+ <h3>+ <%= video.premiere_timestamp.try { |t| translate(locale, "Started streaming `x` ago", recode_date((Time.utc - t).ago, locale)) } %>+ </h3><% end %></div>