fix: fix comments html rendering (#5862)

Now the structure no longer has an array of author thumbnails, is a
single URL:

```json
"author": {
    "channelId": "UCiLGHgWdQvfl1G8BPgcO55w",
    "displayName": "@uber_nerd-l7r",
    "avatarThumbnailUrl": "https://yt3.ggpht.com/ee1_iFgiBvgKHUr3r0_qUVqUpGKhDZaePYq8Q4tIsyVS9L1oRHHJLcHtXrSxyS63AmvldKicbw=s88-c-k-c0x00ffffff-no-rj",
    "isVerified": false,
    "isCurrentUser": false,
    "isCreator": false,
```
This commit is contained in:
Fijxu
2026-08-02 03:48:25 -04:00
committed by GitHub
parent 1a0fd8287d
commit 51dd4fefd0
2 changed files with 2 additions and 12 deletions
+1 -11
View File
@@ -155,17 +155,7 @@ module Invidious::Comments
json.field "authorUrl", "/channel/#{comment_author["channelId"].as_s}"
json.field "author", comment_author["displayName"].as_s
json.field "verified", comment_author["isVerified"].as_bool
json.field "authorThumbnails" do
json.array do
comment_mutation.dig?("payload", "commentEntityPayload", "avatar", "image", "sources").try &.as_a.each do |thumbnail|
json.object do
json.field "url", thumbnail["url"]
json.field "width", thumbnail["width"]
json.field "height", thumbnail["height"]
end
end
end
end
json.field "authorThumbnail", comment_author["avatarThumbnailUrl"].as_s
json.field "authorIsChannelOwner", comment_author["isCreator"].as_bool
json.field "isSponsor", (comment_author["sponsorBadgeUrl"]? != nil)
+1 -1
View File
@@ -44,7 +44,7 @@ module Invidious::Frontend::Comments
end
if !thin_mode
author_thumbnail = "/ggpht#{URI.parse(child["authorThumbnails"][-1]["url"].as_s).request_target}"
author_thumbnail = "/ggpht#{URI.parse(child["authorThumbnail"].as_s).request_target}"
else
author_thumbnail = ""
end