enhancement: moved logger to class as it should be.

also fixed a typo
This commit is contained in:
Nicholas St. Germain 2018-12-06 11:17:57 -06:00
parent fa07879b11
commit b27066a213
2 changed files with 8 additions and 4 deletions

View file

@ -4,6 +4,7 @@ from datetime import datetime, timezone, date, timedelta
from varken.helpers import hashit, connection_handler
from varken.structures import Queue, TVShow
class SonarrAPI(object):
def __init__(self, server, dbmanager):
# Set Time of initialization
@ -34,7 +35,11 @@ class SonarrAPI(object):
return
# Iteratively create a list of TVShow Objects from response json
tv_shows = [TVShow(**show) for show in get]
try:
tv_shows = [TVShow(**show) for show in get]
except TypeError as e:
logger.error('TypeError has occurred : %s', e)
return
# Add show to missing list if file does not exist
for show in tv_shows: