mirror of
https://github.com/iv-org/invidious.git
synced 2024-12-15 06:40:34 +05:30
Fix for /comments/ where there is only one comment
This commit is contained in:
parent
4cc2cf46aa
commit
6aeb508f29
@ -568,7 +568,7 @@ get "/api/v1/comments/:id" do |env|
|
|||||||
comments = JSON.build do |json|
|
comments = JSON.build do |json|
|
||||||
json.object do
|
json.object do
|
||||||
if body["header"]?
|
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
|
json.field "commentCount", comment_count
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user