Merge pull request #1230 from abeloin/patch-ical_empty_network

Fix if network is None for ical
This commit is contained in:
Alexandre Beloin 2015-02-15 18:15:51 -05:00
commit aad7e36966
1 changed files with 5 additions and 3 deletions

View File

@ -585,9 +585,11 @@ class CalendarHandler(BaseHandler):
ical = ical + 'UID:Sick-Beard-' + str(datetime.date.today().isoformat()) + '-' + show[
'show_name'].replace(" ", "-") + '-E' + str(episode['episode']) + 'S' + str(
episode['season']) + '\r\n'
if (episode['description'] is not None and episode['description'] != ''):
ical = ical + 'DESCRIPTION:' + show['airs'] + ' on ' + show['network'] + '\\n\\n' + \
episode['description'].splitlines()[0] + '\r\n'
if episode['description']:
ical = ical + 'DESCRIPTION: {0} on {1} \\n\\n {2}\r\n'.format(
(show['airs'] or '(Unknown airs)'),
(show['network'] or 'Unknown network'),
episode['description'].splitlines()[0])
else:
ical = ical + 'DESCRIPTION:' + (show['airs'] or '(Unknown airs)') + ' on ' + (
show['network'] or 'Unknown network') + '\r\n'