mirror of
https://github.com/iv-org/invidious.git
synced 2024-12-22 21:43:38 +00:00
Community: parse replyCount
This commit is contained in:
parent
8384fa94c2
commit
aecbafbc7b
@ -108,6 +108,8 @@ def fetch_channel_community(ucid, continuation, locale, format, thin_mode)
|
|||||||
like_count = post["actionButtons"]["commentActionButtonsRenderer"]["likeButton"]["toggleButtonRenderer"]["accessibilityData"]["accessibilityData"]["label"]
|
like_count = post["actionButtons"]["commentActionButtonsRenderer"]["likeButton"]["toggleButtonRenderer"]["accessibilityData"]["accessibilityData"]["label"]
|
||||||
.try &.as_s.gsub(/\D/, "").to_i? || 0
|
.try &.as_s.gsub(/\D/, "").to_i? || 0
|
||||||
|
|
||||||
|
reply_count = short_text_to_number(post.dig?("actionButtons", "commentActionButtonsRenderer", "replyButton", "buttonRenderer", "text", "simpleText").try &.as_s || "0")
|
||||||
|
|
||||||
json.field "content", html_to_content(content_html)
|
json.field "content", html_to_content(content_html)
|
||||||
json.field "contentHtml", content_html
|
json.field "contentHtml", content_html
|
||||||
|
|
||||||
@ -115,6 +117,7 @@ def fetch_channel_community(ucid, continuation, locale, format, thin_mode)
|
|||||||
json.field "publishedText", translate(locale, "`x` ago", recode_date(published, locale))
|
json.field "publishedText", translate(locale, "`x` ago", recode_date(published, locale))
|
||||||
|
|
||||||
json.field "likeCount", like_count
|
json.field "likeCount", like_count
|
||||||
|
json.field "replyCount", reply_count
|
||||||
json.field "commentId", post["postId"]? || post["commentId"]? || ""
|
json.field "commentId", post["postId"]? || post["commentId"]? || ""
|
||||||
json.field "authorIsChannelOwner", post["authorEndpoint"]["browseEndpoint"]["browseId"] == ucid
|
json.field "authorIsChannelOwner", post["authorEndpoint"]["browseEndpoint"]["browseId"] == ucid
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user