Add code to calculate video rating

pull/143/head
Omar Roth 2018-08-25 21:34:11 -05:00
rodzic a37692cce4
commit c3d8ca68b3
1 zmienionych plików z 2 dodań i 0 usunięć

Wyświetl plik

@ -281,7 +281,9 @@ get "/watch" do |env|
rvs << HTTP::Params.parse(rv).to_h
end
# rating = (video.likes.to_f/(video.likes.to_f + video.dislikes.to_f) * 4 + 1)
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"]?