mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-20 13:23:18 -07:00
Streamline core.processor.nzbget._parse_health_status
This commit is contained in:
parent
bb3465040f
commit
dcf1a6d172
1 changed files with 9 additions and 14 deletions
|
@ -58,22 +58,17 @@ def _parse_unpack_status():
|
||||||
def _parse_health_status():
|
def _parse_health_status():
|
||||||
"""Parse nzbget download health from environment."""
|
"""Parse nzbget download health from environment."""
|
||||||
status = 0
|
status = 0
|
||||||
if os.environ['NZBPP_UNPACKSTATUS'] == '0' and os.environ[
|
unpack_status_value = os.environ['NZBPP_UNPACKSTATUS']
|
||||||
'NZBPP_PARSTATUS'] == '0':
|
par_status_value = os.environ['NZBPP_PARSTATUS']
|
||||||
# Unpack was skipped due to nzb-file properties or due to errors during par-check
|
if unpack_status_value == '0' and par_status_value == '0':
|
||||||
|
# Unpack was skipped due to nzb-file properties
|
||||||
if os.environ['NZBPP_HEALTH'] < 1000:
|
# or due to errors during par-check
|
||||||
logger.warning(
|
if int(os.environ['NZBPP_HEALTH']) < 1000:
|
||||||
'Download health is compromised and Par-check/repair disabled or no .par2 files found. Setting status \'failed\'')
|
logger.warning('Download health is compromised and Par-check/repair disabled or no .par2 files found. Setting status \'failed\'')
|
||||||
logger.info(
|
|
||||||
'Please check your Par-check/repair settings for future downloads.')
|
|
||||||
status = 1
|
status = 1
|
||||||
|
|
||||||
else:
|
else:
|
||||||
logger.info(
|
logger.info('Par-check/repair disabled or no .par2 files found, and Unpack not required. Health is ok so handle as though download successful')
|
||||||
'Par-check/repair disabled or no .par2 files found, and Unpack not required. Health is ok so handle as though download successful')
|
logger.info('Please check your Par-check/repair settings for future downloads.')
|
||||||
logger.info(
|
|
||||||
'Please check your Par-check/repair settings for future downloads.')
|
|
||||||
return status
|
return status
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue