diff options
| author | Omar Roth <omarroth@hotmail.com> | 2019-01-10 08:06:54 -0600 |
|---|---|---|
| committer | Omar Roth <omarroth@hotmail.com> | 2019-01-10 08:06:54 -0600 |
| commit | 138a6b11362257efc770f3d533c894ecf46802b3 (patch) | |
| tree | 162d3ec6d390d585290e80d14282e22ba96c4c52 | |
| parent | c6ec8317acd1ade048809c110fee2703be541134 (diff) | |
| download | invidious-138a6b11362257efc770f3d533c894ecf46802b3.tar.gz invidious-138a6b11362257efc770f3d533c894ecf46802b3.tar.bz2 invidious-138a6b11362257efc770f3d533c894ecf46802b3.zip | |
Add missing "avg_rating"0.13.1
| -rw-r--r-- | src/invidious/videos.cr | 2 |
1 files changed, 2 insertions, 0 deletions
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 : "" |
