Skip to content

Commit

Permalink
Fix for Reddit timezone
Browse files Browse the repository at this point in the history
  • Loading branch information
omarroth committed Sep 20, 2018
1 parent 95e2d8f commit 6e09202
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/invidious.cr
Expand Up @@ -2055,7 +2055,7 @@ get "/api/v1/comments/:id" do |env|
end
elsif 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)"}
begin
comments, reddit_thread = get_reddit_comments(id, client, headers)
content_html = template_reddit_comments(comments)
Expand Down
14 changes: 7 additions & 7 deletions src/invidious/comments.cr
Expand Up @@ -17,12 +17,12 @@ class RedditComment
end

JSON.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,
},
Expand Down Expand Up @@ -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}
Expand Down

0 comments on commit 6e09202

Please sign in to comment.