From 1b3319942e809d7f0860de27e9e209e4fc9aa1a2 Mon Sep 17 00:00:00 2001 From: syeopite Date: Mon, 26 Jul 2021 22:36:23 -0700 Subject: [PATCH] Add new attribute for publish date in com. threads --- src/invidious/helpers/extractors.cr | 2 +- src/invidious/views/community.ecr | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/invidious/helpers/extractors.cr b/src/invidious/helpers/extractors.cr index 654e0952..9bb80f6d 100644 --- a/src/invidious/helpers/extractors.cr +++ b/src/invidious/helpers/extractors.cr @@ -364,7 +364,7 @@ private module Parsers comments = item_contents.dig?("actionButtons", "commentActionButtonsRenderer", "replyButton", "buttonRenderer", "text", "simpleText").try { |t| short_text_to_number(t.as_s) } || 0 - published = item_contents["publishedTimeText"]?.try &.["simpleText"]?.try { |t| decode_date(t.as_s) } || Time.local + published = item_contents["publishedTimeText"]["runs"][0]["text"].try { |t| decode_date(t.as_s) } || Time.local YouTubeStructs::CommunityPost.new({ author: author_name, diff --git a/src/invidious/views/community.ecr b/src/invidious/views/community.ecr index 23042d56..7b133aa0 100644 --- a/src/invidious/views/community.ecr +++ b/src/invidious/views/community.ecr @@ -75,8 +75,8 @@
-

><%= thread.author %>

-

<%= thread.content_html -%>

+

><%= thread.author %>

+

<%= thread.content_html -%>

<% # Handles attachments: %> <% attachment = thread.attachment %>
@@ -91,11 +91,11 @@ <% end %>
-
  • <%= thread.likes %>
  • -
  • <%= thread.comments %>
  • +
  • <%= thread.comments %>
  • +
  • <%= translate(locale, "Shared `x` ago", recode_date(thread.published, locale)) %>