mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-14 02:26:53 -07:00
Extract total status parsing from core.processor.nzbget.parse_status
-> _parse_total_status
This commit is contained in:
parent
d7c6a8e1cc
commit
fc2ebeb245
1 changed files with 11 additions and 5 deletions
|
@ -29,15 +29,21 @@ def parse_failure_link():
|
|||
return os.environ.get('NZBPR__DNZB_FAILURE')
|
||||
|
||||
|
||||
def _parse_total_status():
|
||||
status = 0
|
||||
if not os.environ['NZBPP_TOTALSTATUS'] == 'SUCCESS':
|
||||
logger.info('Download failed with status {0}.'.format(
|
||||
os.environ['NZBPP_STATUS']))
|
||||
status = 1
|
||||
return status
|
||||
return status
|
||||
|
||||
|
||||
def parse_status():
|
||||
status = 0
|
||||
# Check if the script is called from nzbget 13.0 or later
|
||||
if 'NZBPP_TOTALSTATUS' in os.environ:
|
||||
if not os.environ['NZBPP_TOTALSTATUS'] == 'SUCCESS':
|
||||
logger.info('Download failed with status {0}.'.format(
|
||||
os.environ['NZBPP_STATUS']))
|
||||
status = 1
|
||||
|
||||
status = _parse_total_status()
|
||||
else:
|
||||
# Check par status
|
||||
if os.environ['NZBPP_PARSTATUS'] == '1' or os.environ[
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue