Handle exceptions in a differnt place
This commit is contained in:
parent
ace92991b3
commit
82b247d1c0
2 changed files with 13 additions and 17 deletions
|
@ -29,20 +29,20 @@ class INIParser(object):
|
|||
self.ciscoasa_enabled = False
|
||||
self.ciscoasa_firewalls = []
|
||||
|
||||
try:
|
||||
self.parse_opts()
|
||||
except configparser.NoOptionError as e:
|
||||
logger.error(e)
|
||||
self.parse_opts()
|
||||
|
||||
def enable_check(self, server_type=None):
|
||||
t = server_type
|
||||
global_server_ids = self.config.get('global', t)
|
||||
if global_server_ids.lower() in ['false', 'no', '0']:
|
||||
logger.info('%s disabled.', t.upper())
|
||||
return False
|
||||
else:
|
||||
sids = self.clean_check(global_server_ids, t)
|
||||
return sids
|
||||
try:
|
||||
global_server_ids = self.config.get('global', t)
|
||||
if global_server_ids.lower() in ['false', 'no', '0']:
|
||||
logger.info('%s disabled.', t.upper())
|
||||
return False
|
||||
else:
|
||||
sids = self.clean_check(global_server_ids, t)
|
||||
return sids
|
||||
except configparser.NoOptionError as e:
|
||||
logger.error(e)
|
||||
|
||||
@staticmethod
|
||||
def clean_check(server_id_list, server_type=None):
|
||||
|
|
|
@ -46,9 +46,7 @@ class RadarrAPI(object):
|
|||
|
||||
movie_name = '{} ({})'.format(movie.title, movie.year)
|
||||
|
||||
title_slug = movie.titleSlug
|
||||
|
||||
missing.append((movie_name, ma, movie.tmdbId, title_slug))
|
||||
missing.append((movie_name, ma, movie.tmdbId, movie.titleSlug))
|
||||
|
||||
|
||||
for title, ma, mid, title_slug in missing:
|
||||
|
@ -103,15 +101,13 @@ class RadarrAPI(object):
|
|||
|
||||
name = '{} ({})'.format(movie.title, movie.year)
|
||||
|
||||
title_slug = movie.titleSlug
|
||||
|
||||
if queue_item.protocol.upper() == 'USENET':
|
||||
protocol_id = 1
|
||||
else:
|
||||
protocol_id = 0
|
||||
|
||||
queue.append((name, queue_item.quality['quality']['name'], queue_item.protocol.upper(),
|
||||
protocol_id, queue_item.id, title_slug))
|
||||
protocol_id, queue_item.id, movie.titleSlug))
|
||||
|
||||
for name, quality, protocol, protocol_id, qid, title_slug in queue:
|
||||
hash_id = hashit('{}{}{}'.format(self.server.id, name, quality))
|
||||
|
|
Loading…
Reference in a new issue