From 68b7542bcbcd8acd950e053c9ca005b24155cdc9 Mon Sep 17 00:00:00 2001 From: "Nicholas St. Germain" Date: Thu, 18 Apr 2019 21:25:23 -0500 Subject: [PATCH] change iteration to only drop the bad shows. Will get more specific after we get a data dump of a bad example --- varken/sonarr.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/varken/sonarr.py b/varken/sonarr.py index 48ef4c8..0e010f4 100644 --- a/varken/sonarr.py +++ b/varken/sonarr.py @@ -35,10 +35,14 @@ class SonarrAPI(object): return # Iteratively create a list of SonarrTVShow Objects from response json - try: - tv_shows = [SonarrTVShow(**show) for show in get] - except TypeError as e: - self.logger.error('TypeError has occurred : %s while creating SonarrTVShow structure', e) + tv_shows = [] + for show in get: + try: + show_tuple = SonarrTVShow(**show) + tv_shows.append(show_tuple) + except TypeError as 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