mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-04-11.git
synced 2024-08-15 00:43:26 +00:00
Fix reply count extraction
This commit is contained in:
parent
d9ea8e413e
commit
45ce301bd2
1 changed files with 6 additions and 2 deletions
|
@ -1785,9 +1785,13 @@ get "/api/v1/comments/:id" do |env|
|
||||||
json.field "commentId", node_comment["commentId"]
|
json.field "commentId", node_comment["commentId"]
|
||||||
|
|
||||||
if node_replies && !response["commentRepliesContinuation"]?
|
if node_replies && !response["commentRepliesContinuation"]?
|
||||||
reply_count = node_replies["moreText"]["simpleText"].as_s.match(/View all (?<count>\d+) replies/)
|
reply_count = node_replies["moreText"]["simpleText"].as_s.delete("View all reply replies,")
|
||||||
.try &.["count"].to_i?
|
if reply_count.empty?
|
||||||
|
reply_count = 1
|
||||||
|
else
|
||||||
|
reply_count = reply_count.try &.to_i?
|
||||||
reply_count ||= 1
|
reply_count ||= 1
|
||||||
|
end
|
||||||
|
|
||||||
continuation = node_replies["continuations"].as_a[0]["nextContinuationData"]["continuation"].as_s
|
continuation = node_replies["continuations"].as_a[0]["nextContinuationData"]["continuation"].as_s
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue