mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-08-14.git
synced 2024-08-15 00:53:20 +00:00
show how long ago stream started
This commit is contained in:
parent
cbc7603248
commit
295e5c9731
2 changed files with 6 additions and 1 deletions
|
@ -534,7 +534,8 @@ struct Video
|
|||
end
|
||||
|
||||
def live_now
|
||||
info["videoDetails"]["isLiveContent"]?.try &.as_bool || false
|
||||
info["microformat"]?.try &.["playerMicroformatRenderer"]?
|
||||
.try &.["liveBroadcastDetails"]?.try &.["isLiveNow"]?.try &.as_bool || false
|
||||
end
|
||||
|
||||
def is_listed
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
Loading…
Reference in a new issue