Skip to content

Commit

Permalink
Add missing "avg_rating"
Browse files Browse the repository at this point in the history
  • Loading branch information
omarroth committed Jan 10, 2019
1 parent c6ec831 commit 138a6b1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/invidious/videos.cr
Expand Up @@ -649,6 +649,8 @@ def fetch_video(id, proxies, region)
dislikes = dislikes.try &.content.delete(",").try &.to_i?
dislikes ||= 0

info["avg_rating"] = "#{(likes.to_f/(likes.to_f + dislikes.to_f) * 4 + 1)}"

description = html.xpath_node(%q(//p[@id="eow-description"]))
description = description ? description.to_xml : ""

Expand Down

0 comments on commit 138a6b1

Please sign in to comment.