summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSamantaz Fox <coding@samantaz.fr>2023-02-12 17:57:07 +0100
committerSamantaz Fox <coding@samantaz.fr>2023-02-12 17:57:32 +0100
commit87342e4efd4258f52d2b34f0e5af0fcf7ca09f90 (patch)
tree642f0414ffbd4519c6a4ff814d8ecee50e051656 /src
parent27ff8d7c33fd3612066d894cfd0eb6ee945d7b47 (diff)
downloadinvidious-87342e4efd4258f52d2b34f0e5af0fcf7ca09f90.tar.gz
invidious-87342e4efd4258f52d2b34f0e5af0fcf7ca09f90.tar.bz2
invidious-87342e4efd4258f52d2b34f0e5af0fcf7ca09f90.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/invidious/comments.cr2
1 files changed, 1 insertions, 1 deletions
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))