From 739e58053328c7e68e43d4b15aa2fdea054748ed Mon Sep 17 00:00:00 2001 From: DariusIII Date: Fri, 12 Jan 2024 20:39:24 +0100 Subject: [PATCH] Show messages only if echoing to cli is enabled --- Blacklight/processing/post/ProcessAdditional.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Blacklight/processing/post/ProcessAdditional.php b/Blacklight/processing/post/ProcessAdditional.php index 1fb406c01..b0cec6eb4 100755 --- a/Blacklight/processing/post/ProcessAdditional.php +++ b/Blacklight/processing/post/ProcessAdditional.php @@ -635,7 +635,9 @@ class ProcessAdditional if ($nzbPath !== false) { $nzbContents = Utility::unzipGzipFile($nzbPath); if (! $nzbContents) { - $this->_echo('NZB is empty or broken for GUID: '.$this->_release->guid, 'warning'); + if ($this->_echoCLI) { + $this->_echo('NZB is empty or broken for GUID: '.$this->_release->guid, 'warning'); + } $this->_deleteRelease(); return false; @@ -643,7 +645,9 @@ class ProcessAdditional // Get a list of files in the nzb. $this->_nzbContents = $this->_nzb->nzbFileList($nzbContents, ['no-file-key' => false, 'strip-count' => true]); if (\count($this->_nzbContents) === 0) { - $this->_echo('NZB is potentially broken for GUID: '.$this->_release->guid, 'warning'); + if ($this->_echoCLI) { + $this->_echo('NZB is potentially broken for GUID: '.$this->_release->guid, 'warning'); + } $this->_deleteRelease(); return false; @@ -653,7 +657,9 @@ class ProcessAdditional return true; } - $this->_echo('NZB not found for GUID: '.$this->_release->guid, 'warning'); + if ($this->_echoCLI) { + $this->_echo('NZB not found for GUID: '.$this->_release->guid, 'warning'); + } $this->_deleteRelease(); return false;