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:
parent
95f348f1fe
commit
68b7542bcb
1 changed files with 8 additions and 4 deletions
|
@ -35,10 +35,14 @@ class SonarrAPI(object):
|
|||
return
|
||||
|
||||
# Iteratively create a list of SonarrTVShow Objects from response json
|
||||
tv_shows = []
|
||||
for show in get:
|
||||
try:
|
||||
tv_shows = [SonarrTVShow(**show) for show in get]
|
||||
show_tuple = SonarrTVShow(**show)
|
||||
tv_shows.append(show_tuple)
|
||||
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
|
||||
|
||||
# Add show to missing list if file does not exist
|
||||
|
|
Loading…
Reference in a new issue