Fix Radarr result handling

This commit is contained in:
Clinton Hall 2024-02-27 20:33:26 +13:00 committed by GitHub
commit 06a43de5e2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -260,7 +260,10 @@ def process(section, dir_name, input_name=None, status=0, client_agent='manual',
)
elif section == 'Radarr':
try:
scan_id = int(result['id'])
if isinstance(result, list):
scan_id = int(result[0]['id'])
else:
scan_id = int(result['id'])
logger.debug('Scan started with id: {0}'.format(scan_id), section)
except Exception as e:
logger.warning('No scan id was returned due to: {0}'.format(e), section)