From a83b48ce54ab5cc2bd37a81b183eebfdbb84ea81 Mon Sep 17 00:00:00 2001 From: DariusIII Date: Sun, 3 Nov 2024 10:09:51 +0100 Subject: [PATCH] Update settings changes handling --- Blacklight/NNTP.php | 8 ++++---- Blacklight/TmuxRun.php | 38 -------------------------------------- 2 files changed, 4 insertions(+), 42 deletions(-) diff --git a/Blacklight/NNTP.php b/Blacklight/NNTP.php index b15a7a40a..c1219e1ff 100755 --- a/Blacklight/NNTP.php +++ b/Blacklight/NNTP.php @@ -1274,18 +1274,18 @@ class NNTP extends \Net_NNTP_Client /** * Connect to a NNTP server. * - * @param string $host (optional) The address of the NNTP-server to connect to, defaults to 'localhost'. + * @param string|null $host (optional) The address of the NNTP-server to connect to, defaults to 'localhost'. * @param mixed $encryption (optional) Use TLS/SSL on the connection? * (string) 'tcp' => Use no encryption. * 'ssl', 'sslv3', 'tls' => Use encryption. * (null)|(false) Use no encryption. - * @param int $port (optional) The port number to connect to, defaults to 119. - * @param int $timeout (optional) How many seconds to wait before giving up when connecting. + * @param int|null $port (optional) The port number to connect to, defaults to 119. + * @param int|null $timeout (optional) How many seconds to wait before giving up when connecting. * @param int $socketTimeout (optional) How many seconds to wait before timing out the (blocked) socket. * @return mixed (bool) On success: True when posting allowed, otherwise false. * (object) On failure: pear_error */ - public function connect(?string $host = null, $encryption = null, ?int $port = null, int $timeout = 15, int $socketTimeout = 120) + public function connect(?string $host = null, $encryption = null, ?int $port = null, ?int $timeout = 15, int $socketTimeout = 120): mixed { if ($this->_isConnected()) { return $this->throwError('Already connected, disconnect first!', null); diff --git a/Blacklight/TmuxRun.php b/Blacklight/TmuxRun.php index fe3442c6a..c0126d249 100755 --- a/Blacklight/TmuxRun.php +++ b/Blacklight/TmuxRun.php @@ -51,9 +51,6 @@ class TmuxRun extends Tmux case 'fixnames': $this->_runFixReleaseNames($runVar); break; - case 'import': - $this->_runNZBImport($runVar); - break; case 'main': $this->_runMainNon($runVar); break; @@ -91,9 +88,6 @@ class TmuxRun extends Tmux case 'fixnames': $this->_runFixReleaseNames($runVar); break; - case 'import': - $this->_runNZBImport($runVar); - break; case 'main': $this->_runMainBasic($runVar); break; @@ -387,38 +381,6 @@ class TmuxRun extends Tmux } } - /** - * @throws \Exception - */ - protected function _runNZBImport(&$runVar): void - { - switch ($runVar['settings']['import']) { - case 1: - $useFilenames = 'false'; - break; - case 2: - $useFilenames = 'true'; - break; - default: - $useFilenames = 'false'; - } - - if (((int) $runVar['settings']['import'] !== 0) && ($runVar['killswitch']['pp'] === false)) { - $log = $this->writelog($runVar['panes']['zero'][1]); - shell_exec( - "tmux respawnp -t{$runVar['constants']['tmux_session']}:0.1 ' \ - {$runVar['commands']['_phpn']} {$runVar['paths']['misc']}update/multiprocessing/import.php {$runVar['settings']['nzbs']} {$runVar['settings']['nzbthreads']} true true {$useFilenames} {$runVar['settings']['import_count']} $log; \ - date +\"{$this->_dateFormat}\"; {$runVar['commands']['_sleep']} {$runVar['settings']['import_timer']}' 2>&1 1> /dev/null" - ); - } elseif ($runVar['killswitch']['pp'] === true) { - $color = $this->get_color($runVar['settings']['colors_start'], $runVar['settings']['colors_end'], $runVar['settings']['colors_exc']); - shell_exec("tmux respawnp -k -t{$runVar['constants']['tmux_session']}:0.1 'echo \"\033[38;5;{$color}m\n{$runVar['panes']['zero'][1]} has been disabled/terminated by Exceeding Limits\"'"); - } else { - $color = $this->get_color($runVar['settings']['colors_start'], $runVar['settings']['colors_end'], $runVar['settings']['colors_exc']); - shell_exec("tmux respawnp -k -t{$runVar['constants']['tmux_session']}:0.1 'echo \"\033[38;5;{$color}m\n{$runVar['panes']['zero'][1]} has been disabled/terminated by Import\"'"); - } - } - /** * Run postprocess_releases additional. *