diff options
| author | TheFrenchGhosty <47571719+TheFrenchGhosty@users.noreply.github.com> | 2021-02-25 17:53:51 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-25 17:53:51 +0100 |
| commit | c8cdc50d29a7a6684314bc5e53fc328c7d3f85c3 (patch) | |
| tree | 5d4089d52274a84f7be838b5eb4e32a870f698fd /src | |
| parent | b29e60a97aaef1d513208e177ecae8ffc671a3d9 (diff) | |
| parent | 295e5c9731f3adfd96d900d13e7fce4fd0d5078a (diff) | |
| download | invidious-c8cdc50d29a7a6684314bc5e53fc328c7d3f85c3.tar.gz invidious-c8cdc50d29a7a6684314bc5e53fc328c7d3f85c3.tar.bz2 invidious-c8cdc50d29a7a6684314bc5e53fc328c7d3f85c3.zip | |
Merge pull request #1808 from tenpura-shrimp/showstreamstart
show how long ago stream started
Diffstat (limited to 'src')
| -rw-r--r-- | src/invidious/videos.cr | 3 | ||||
| -rw-r--r-- | src/invidious/views/watch.ecr | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/invidious/videos.cr b/src/invidious/videos.cr index 74edc156..d0b7d6db 100644 --- a/src/invidious/videos.cr +++ b/src/invidious/videos.cr @@ -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 diff --git a/src/invidious/views/watch.ecr b/src/invidious/views/watch.ecr index 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> |
