change iteration to only drop the bad shows. Will get more specific after we get a data dump of a bad example

This commit is contained in:
Nicholas St. Germain 2019-04-18 21:25:23 -05:00
parent 95f348f1fe
commit 68b7542bcb

View file

@ -35,10 +35,14 @@ class SonarrAPI(object):
return return
# Iteratively create a list of SonarrTVShow Objects from response json # Iteratively create a list of SonarrTVShow Objects from response json
tv_shows = []
for show in get:
try: try:
tv_shows = [SonarrTVShow(**show) for show in get] show_tuple = SonarrTVShow(**show)
tv_shows.append(show_tuple)
except TypeError as e: except TypeError as e:
self.logger.error('TypeError has occurred : %s while creating SonarrTVShow structure', e) self.logger.error('TypeError has occurred : %s while creating SonarrTVShow structure for show', e)
if not tv_shows:
return return
# Add show to missing list if file does not exist # Add show to missing list if file does not exist