From dfe0b98b2e8995921321a6c9d416e831ebebedb5 Mon Sep 17 00:00:00 2001 From: Brian Sheldon Date: Fri, 25 Nov 2022 10:31:19 -0500 Subject: [PATCH] Streamline `core.processor.nzbget._parse_par_status` --- core/processor/nzbget.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/core/processor/nzbget.py b/core/processor/nzbget.py index 5a9e60fb..26a65f4e 100644 --- a/core/processor/nzbget.py +++ b/core/processor/nzbget.py @@ -40,12 +40,11 @@ def _parse_total_status(): def _parse_par_status(): """Parse nzbget par status from environment.""" - status = 0 - if os.environ['NZBPP_PARSTATUS'] == '1' or os.environ[ - 'NZBPP_PARSTATUS'] == '4': + par_status = os.environ['NZBPP_PARSTATUS'] + if par_status == '1' or par_status == '4': logger.warning('Par-repair failed, setting status \'failed\'') - status = 1 - return status + return 1 + return 0 def parse_status():