From 506658e2def147ca79df9de5f4af9b3d8bc142fd Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Wed, 9 Jun 2010 12:32:33 +0200 Subject: tvrage: Handle data without the RFC3339 field. --- modules/tvrage.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'modules') diff --git a/modules/tvrage.py b/modules/tvrage.py index 51263dd..cb31700 100644 --- a/modules/tvrage.py +++ b/modules/tvrage.py @@ -37,6 +37,15 @@ class Module: if 'Ended' in status or 'Canceled' in status: return '\002%s\002 does not currently air.' % data['Show Name'][0] + if not 'RFC3339' in data: + if 'Next Episode' in data: + return '\002%s\002 %s airs in %s, on %s' % (data['Show Name'][0], + data['Next Episode'][1], + data['Next Episode'][2], + data['Airtime'][0]) + else: + return 'Can''t find airing date for \002%s\002.' + # TODO: Fetch this from somewhere user-configurable local_tz = pytz.timezone('Europe/Oslo') -- cgit v1.2.3