From 87342e4efd4258f52d2b34f0e5af0fcf7ca09f90 Mon Sep 17 00:00:00 2001 From: Samantaz Fox Date: Sun, 12 Feb 2023 17:57:07 +0100 Subject: [PATCH] Comments: Revert "isPinned" to a nil check "pinnedCommentBadge" is not a boolean, but a complex structure. This commit fixes a wrong assumption I had during the rewiew of https://github.com/iv-org/invidious/pull/3626 --- src/invidious/comments.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/invidious/comments.cr b/src/invidious/comments.cr index 41b0efa8..357a461c 100644 --- a/src/invidious/comments.cr +++ b/src/invidious/comments.cr @@ -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 "contentHtml", content_html - json.field "isPinned", (node_comment["pinnedCommentBadge"]?.try(&.as_bool) == true) + json.field "isPinned", (node_comment["pinnedCommentBadge"]? != nil) json.field "published", published.to_unix json.field "publishedText", translate(locale, "`x` ago", recode_date(published, locale))