Add note for livestreams that haven't started

This commit is contained in:
Omar Roth 2018-08-18 11:47:16 -05:00
parent 1611ee83a6
commit 55f8fd0b58
3 changed files with 19 additions and 2 deletions

View file

@ -279,6 +279,12 @@ get "/watch" do |env|
rating = video.info["avg_rating"].to_f64
engagement = ((video.dislikes.to_f + video.likes.to_f)/video.views * 100)
playability_status = video.player_response["playabilityStatus"]?
if playability_status && playability_status["status"] == "LIVE_STREAM_OFFLINE"
reason = playability_status["reason"]?.try &.as_s
end
reason ||= ""
templated "watch"
end