mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-04-11.git
synced 2024-08-15 00:43:26 +00:00
Add code to calculate video rating
This commit is contained in:
parent
a37692cce4
commit
c3d8ca68b3
1 changed files with 2 additions and 0 deletions
|
@ -281,7 +281,9 @@ get "/watch" do |env|
|
||||||
rvs << HTTP::Params.parse(rv).to_h
|
rvs << HTTP::Params.parse(rv).to_h
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# rating = (video.likes.to_f/(video.likes.to_f + video.dislikes.to_f) * 4 + 1)
|
||||||
rating = video.info["avg_rating"].to_f64
|
rating = video.info["avg_rating"].to_f64
|
||||||
|
|
||||||
engagement = ((video.dislikes.to_f + video.likes.to_f)/video.views * 100)
|
engagement = ((video.dislikes.to_f + video.likes.to_f)/video.views * 100)
|
||||||
|
|
||||||
playability_status = video.player_response["playabilityStatus"]?
|
playability_status = video.player_response["playabilityStatus"]?
|
||||||
|
|
Loading…
Reference in a new issue