Show messages only if echoing to cli is enabled

This commit is contained in:
DariusIII
2024-01-12 20:39:24 +01:00
parent f54e72f3cf
commit 739e580533
@@ -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;