From 25434c676c449ca4748baa06e75fa973f78cfd23 Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Mon, 5 Feb 2018 17:57:03 -0600 Subject: [PATCH] Run 'crystal tool format' --- src/helpers.cr | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/helpers.cr b/src/helpers.cr index 8106cb4f..23cab087 100644 --- a/src/helpers.cr +++ b/src/helpers.cr @@ -119,19 +119,19 @@ def fetch_video(id, client) published = published.lchop("Started streaming ") published = published.lchop("on ") published = published.lchop("Scheduled for ") - if !published.includes?("ago") - published = Time.parse(published, "%b %-d, %Y") - else - # Time matches format "20 hours ago", "40 minutes ago"... + if !published.includes?("ago") + published = Time.parse(published, "%b %-d, %Y") + else + # Time matches format "20 hours ago", "40 minutes ago"... delta = published.split(" ")[0].to_i case published when .includes? "minute" published = Time.now - delta.minutes when .includes? "hour" published = Time.now - delta.hours - else + else raise "Could not parse #{published}" - end + end end video = Video.new(id, info, html, Time.now, title, views, likes, dislikes, wilson_score, published)