From 5eb98b67ef786b4aa10945d004552f8e0639f172 Mon Sep 17 00:00:00 2001 From: Brian Sheldon Date: Fri, 25 Nov 2022 10:25:43 -0500 Subject: [PATCH] Streamline `core.processor.nzbget._parse_total_status` --- core/processor/nzbget.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/core/processor/nzbget.py b/core/processor/nzbget.py index ac6e79cb..1d2dd635 100644 --- a/core/processor/nzbget.py +++ b/core/processor/nzbget.py @@ -30,13 +30,12 @@ def parse_failure_link(): 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 + status_summary = os.environ['NZBPP_TOTALSTATUS'] + if status_summary != 'SUCCESS': + status = os.environ['NZBPP_STATUS'] + logger.info('Download failed with status {0}.'.format(status)) + return 1 + return 0 def parse_status():