check payload for sickchill

This commit is contained in:
Nicholas St. Germain 2019-01-25 13:57:27 -06:00
parent c4c1ace54f
commit 371edb9f02

View file

@ -42,6 +42,7 @@ class SickChillAPI(object):
sxe = f'S{show.season:0>2}E{show.episode:0>2}' sxe = f'S{show.season:0>2}E{show.episode:0>2}'
hash_id = hashit(f'{self.server.id}{show.show_name}{sxe}') hash_id = hashit(f'{self.server.id}{show.show_name}{sxe}')
missing_types = [(0, 'future'), (1, 'later'), (2, 'soon'), (3, 'today'), (4, 'missed')] missing_types = [(0, 'future'), (1, 'later'), (2, 'soon'), (3, 'today'), (4, 'missed')]
try:
influx_payload.append( influx_payload.append(
{ {
"measurement": "SickChill", "measurement": "SickChill",
@ -60,5 +61,8 @@ class SickChillAPI(object):
} }
} }
) )
except IndexError as e:
self.logger.error('Error building payload for sickchill. Discarding. Error: %s', e)
if influx_payload:
self.dbmanager.write_points(influx_payload) self.dbmanager.write_points(influx_payload)