mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-21 05:43:16 -07:00
Streamline core.processor.nzbget.parse_download_id
This commit is contained in:
parent
3e6a97e133
commit
39919f59d0
1 changed files with 15 additions and 13 deletions
|
@ -7,19 +7,21 @@ from core.processor import nzb
|
||||||
|
|
||||||
|
|
||||||
def parse_download_id():
|
def parse_download_id():
|
||||||
# Check for download_id to pass to CouchPotato
|
"""Parse nzbget download_id from environment."""
|
||||||
download_id = ''
|
download_id_keys = [
|
||||||
if 'NZBPR_COUCHPOTATO' in os.environ:
|
'NZBPR_COUCHPOTATO',
|
||||||
download_id = os.environ['NZBPR_COUCHPOTATO']
|
'NZBPR_DRONE',
|
||||||
elif 'NZBPR_DRONE' in os.environ:
|
'NZBPR_SONARR',
|
||||||
download_id = os.environ['NZBPR_DRONE']
|
'NZBPR_RADARR',
|
||||||
elif 'NZBPR_SONARR' in os.environ:
|
'NZBPR_LIDARR',
|
||||||
download_id = os.environ['NZBPR_SONARR']
|
]
|
||||||
elif 'NZBPR_RADARR' in os.environ:
|
for download_id_key in download_id_keys:
|
||||||
download_id = os.environ['NZBPR_RADARR']
|
try:
|
||||||
elif 'NZBPR_LIDARR' in os.environ:
|
return os.environ[download_id_key]
|
||||||
download_id = os.environ['NZBPR_LIDARR']
|
except KeyError:
|
||||||
return download_id
|
pass
|
||||||
|
else:
|
||||||
|
return ''
|
||||||
|
|
||||||
|
|
||||||
def parse_failure_link():
|
def parse_failure_link():
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue