Skip to content

Commit

Permalink
Workaround for stupid timedelta behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
kipe committed Mar 8, 2015
1 parent 0ac29c2 commit 8d1fb34
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pyfibot/modules/module_tvrage.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ def command_tvrage(bot, user, channel, args):
if next_episode is not None:
number = next_episode.find('number').text
title = next_episode.find('title').text
airtime = parse_dt(next_episode.find('airtime[@format="RFC3339"]').text)
if airtime < now:
return bot.say(channel, '%s - %s - "%s" aired %s ago <%s>' % (name, number, title, now - airtime, link))
return bot.say(channel, '%s - %s - "%s" airs in %s <%s>' % (name, number, title, airtime - now, link))

latest_episode = show.find('latestepisode')
Expand Down

0 comments on commit 8d1fb34

Please sign in to comment.