Invidious is an alternative front-end to YouTube
Fix for Reddit timezone
Omar Roth6e092026d29e
diff --git a/src/invidious.cr b/src/invidious.crindex 789ce332..b151a090 100644--- a/src/invidious.cr+++ b/src/invidious.cr@@ -2055,7 +2055,7 @@ get "/api/v1/comments/:id" do |env|endelsif source == "reddit"client = make_client(REDDIT_URL)- headers = HTTP::Headers{"User-Agent" => "web:invidio.us:v0.2.0 (by /u/omarroth)"}+ headers = HTTP::Headers{"User-Agent" => "web:invidio.us:v0.6.0 (by /u/omarroth)"}begincomments, reddit_thread = get_reddit_comments(id, client, headers)content_html = template_reddit_comments(comments)diff --git a/src/invidious/comments.cr b/src/invidious/comments.crindex 028fdeb8..44fb291a 100644--- a/src/invidious/comments.cr+++ b/src/invidious/comments.cr@@ -17,12 +17,12 @@ class RedditCommentendJSON.mapping({- author: String,- body_html: String,- replies: RedditThing | String,- score: Int32,- depth: Int32,- created: {+ author: String,+ body_html: String,+ replies: RedditThing | String,+ score: Int32,+ depth: Int32,+ created_utc: {type: Time,converter: RedditComment::TimeConverter,},@@ -159,7 +159,7 @@ def template_reddit_comments(root)<a href="javascript:void(0)" onclick="toggle(this)">[ - ]</a><i class="icon ion-ios-thumbs-up"></i> #{score}<b><a href="https://www.reddit.com/user/#{author}">#{author}</a></b>- - #{recode_date(child.created)} ago+ - #{recode_date(child.created_utc)} ago</p><div>#{body_html}