Make sure pinnedCommentBadge isn't equal to false

Co-authored-by: Samantaz Fox <coding@samantaz.fr>
This commit is contained in:
ChunkyProgrammer 2023-02-09 17:13:21 -05:00 committed by GitHub
parent b893bdac0d
commit e0c70d34cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -181,7 +181,7 @@ def fetch_youtube_comments(id, cursor, format, locale, thin_mode, region, sort_b
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
json.field "isPinned", (node_comment["pinnedCommentBadge"]? != nil) json.field "isPinned", (node_comment["pinnedCommentBadge"]?.try(&.as_bool) == true)
json.field "published", published.to_unix json.field "published", published.to_unix
json.field "publishedText", translate(locale, "`x` ago", recode_date(published, locale)) json.field "publishedText", translate(locale, "`x` ago", recode_date(published, locale))