Fix for /comments/ where there is only one comment

pull/51/head
Omar Roth 2018-07-29 10:49:46 -05:00
rodzic 4cc2cf46aa
commit 6aeb508f29
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -568,7 +568,7 @@ get "/api/v1/comments/:id" do |env|
comments = JSON.build do |json|
json.object do
if body["header"]?
comment_count = body["header"]["commentsHeaderRenderer"]["countText"]["simpleText"].as_s.rchop(" Comments").delete(',').to_i
comment_count = body["header"]["commentsHeaderRenderer"]["countText"]["simpleText"].as_s.rchop(" Comment").delete("s,").to_i
json.field "commentCount", comment_count
end