made more verbose errors for TypeError
This commit is contained in:
parent
59bfb4a567
commit
743f35842e
3 changed files with 12 additions and 11 deletions
|
@ -34,7 +34,7 @@ class RadarrAPI(object):
|
|||
try:
|
||||
movies = [Movie(**movie) for movie in get]
|
||||
except TypeError as e:
|
||||
self.logger.error('TypeError has occurred : %s', e)
|
||||
self.logger.error('TypeError has occurred : %s while creating Movie structure', e)
|
||||
return
|
||||
|
||||
for movie in movies:
|
||||
|
@ -83,17 +83,18 @@ class RadarrAPI(object):
|
|||
try:
|
||||
movie['movie'] = Movie(**movie['movie'])
|
||||
except TypeError as e:
|
||||
self.logger.error('TypeError has occurred : %s', e)
|
||||
self.logger.error('TypeError has occurred : %s while creating Movie structure', e)
|
||||
return
|
||||
|
||||
try:
|
||||
download_queue = [Queue(**movie) for movie in get]
|
||||
except TypeError as e:
|
||||
self.logger.error('TypeError has occurred : %s', e)
|
||||
self.logger.error('TypeError has occurred : %s while creating Queue structure', e)
|
||||
return
|
||||
|
||||
for queue_item in download_queue:
|
||||
name = '{} ({})'.format(queue_item.movie.title, queue_item.movie.year)
|
||||
movie = queue_item.movie
|
||||
name = '{} ({})'.format(movie.title, movie.year)
|
||||
|
||||
if queue_item.protocol.upper() == 'USENET':
|
||||
protocol_id = 1
|
||||
|
@ -103,8 +104,8 @@ class RadarrAPI(object):
|
|||
queue.append((name, queue_item.quality['quality']['name'], queue_item.protocol.upper(),
|
||||
protocol_id, queue_item.id))
|
||||
|
||||
for movie, quality, protocol, protocol_id, qid in queue:
|
||||
hash_id = hashit('{}{}{}'.format(self.server.id, movie, quality))
|
||||
for name, quality, protocol, protocol_id, qid in queue:
|
||||
hash_id = hashit('{}{}{}'.format(self.server.id, name, quality))
|
||||
influx_payload.append(
|
||||
{
|
||||
"measurement": "Radarr",
|
||||
|
@ -112,7 +113,7 @@ class RadarrAPI(object):
|
|||
"type": "Queue",
|
||||
"tmdbId": qid,
|
||||
"server": self.server.id,
|
||||
"name": movie,
|
||||
"name": name,
|
||||
"quality": quality,
|
||||
"protocol": protocol,
|
||||
"protocol_id": protocol_id
|
||||
|
|
|
@ -40,7 +40,7 @@ class SonarrAPI(object):
|
|||
try:
|
||||
tv_shows = [TVShow(**show) for show in get]
|
||||
except TypeError as e:
|
||||
self.logger.error('TypeError has occurred : %s', e)
|
||||
self.logger.error('TypeError has occurred : %s while creating TVShow structure', e)
|
||||
return
|
||||
|
||||
# Add show to missing list if file does not exist
|
||||
|
@ -90,7 +90,7 @@ class SonarrAPI(object):
|
|||
try:
|
||||
tv_shows = [TVShow(**show) for show in get]
|
||||
except TypeError as e:
|
||||
self.logger.error('TypeError has occurred : %s', e)
|
||||
self.logger.error('TypeError has occurred : %s while creating TVShow structure', e)
|
||||
return
|
||||
|
||||
for show in tv_shows:
|
||||
|
@ -140,7 +140,7 @@ class SonarrAPI(object):
|
|||
try:
|
||||
download_queue = [Queue(**show) for show in get]
|
||||
except TypeError as e:
|
||||
self.logger.error('TypeError has occurred : %s', e)
|
||||
self.logger.error('TypeError has occurred : %s while creating Queue structure', e)
|
||||
return
|
||||
|
||||
for show in download_queue:
|
||||
|
|
|
@ -36,7 +36,7 @@ class TautulliAPI(object):
|
|||
try:
|
||||
sessions = [TautulliStream(**session) for session in get['sessions']]
|
||||
except TypeError as e:
|
||||
self.logger.error('TypeError has occurred : %s', e)
|
||||
self.logger.error('TypeError has occurred : %s while creating TautulliStream structure', e)
|
||||
return
|
||||
|
||||
for session in sessions:
|
||||
|
|
Loading…
Reference in a new issue