Fix default value for empty description

This commit is contained in:
Omar Roth 2019-10-04 17:04:43 -04:00
parent e61c8046f4
commit 2d59fdd178
No known key found for this signature in database
GPG Key ID: B8254FB7EC3D37F2

View File

@ -1228,7 +1228,7 @@ def fetch_video(id, region)
avg_rating = avg_rating.nan? ? 0.0 : avg_rating
info["avg_rating"] = "#{avg_rating}"
description_html = html.xpath_node(%q(//p[@id="eow-description"])).try &.to_xml(options: XML::SaveOptions::NO_DECL) || ""
description_html = html.xpath_node(%q(//p[@id="eow-description"])).try &.to_xml(options: XML::SaveOptions::NO_DECL) || "<p></p>"
wilson_score = ci_lower_bound(likes, likes + dislikes)
published = html.xpath_node(%q(//meta[@itemprop="datePublished"])).try &.["content"]