mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-03-16.git
synced 2024-08-15 00:53:18 +00:00
Run 'crystal tool format'
This commit is contained in:
parent
a9cea62d5b
commit
25434c676c
1 changed files with 6 additions and 6 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue