From 138a6b11362257efc770f3d533c894ecf46802b3 Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Thu, 10 Jan 2019 08:06:54 -0600 Subject: [PATCH] Add missing "avg_rating" --- src/invidious/videos.cr | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/invidious/videos.cr b/src/invidious/videos.cr index ab9b49e6..b7955eb4 100644 --- a/src/invidious/videos.cr +++ b/src/invidious/videos.cr @@ -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 : ""