diff --git a/bin/groupfixrelnames.php b/bin/groupfixrelnames.php index 599013a84..f095954f1 100644 --- a/bin/groupfixrelnames.php +++ b/bin/groupfixrelnames.php @@ -10,6 +10,8 @@ require_once(dirname(__FILE__) . '/../lib/nzbcontents.php'); require_once(dirname(__FILE__) . '/../lib/MiscSorter.php'); $pdo = new DB(); +$s = new Sites(); +$site = $s->get(); if (!isset($argv[1])) { exit($pdo->log->error("This script is not intended to be run manually, it is called from groupfixrelnames_threaded.py.")); @@ -133,7 +135,7 @@ if (!isset($argv[1])) { if ($releases instanceof Traversable) { $nntp = new NNTP(['Settings' => $pdo]); - if (($pdo->getSetting('alternate_nntp') == '1' ? $nntp->doConnect(true, true) : $nntp->doConnect()) !== true) { + if (($site->alternate_nntp == '1' ? $nntp->doConnect(true, true) : $nntp->doConnect()) !== true) { exit($pdo->log->error("Unable to connect to usenet.")); } diff --git a/bin/postprocess_new.php b/bin/postprocess_new.php index 672db5092..9de78aa7d 100644 --- a/bin/postprocess_new.php +++ b/bin/postprocess_new.php @@ -13,6 +13,8 @@ require_once(dirname(__FILE__) . '/../lib/Pprocess.php'); require_once(dirname(__FILE__) . '/../lib/Info.php'); $pdo = new DB(); +$s = new Sites(); +$site = $s->get(); /** Array with possible arguments for run and whether or not those methods of operation require NNTP @@ -68,7 +70,7 @@ if (!isset($argv[1]) || !in_array($argv[1], $args) || !isset($argv[2]) || !in_ar $nntp = null; if ($args[$argv[1]] === true) { $nntp = new NNTP(['Settings' => $pdo]); - if (($pdo->getSetting('alternate_nntp') == 1 ? $nntp->doConnect(true, true) : $nntp->doConnect()) !== true) { + if (($site->alternate_nntp == 1 ? $nntp->doConnect(true, true) : $nntp->doConnect()) !== true) { exit($pdo->log->error("Unable to connect to usenet." . PHP_EOL)); } } diff --git a/lib/Info.php b/lib/Info.php index f3142e565..971c1a075 100644 --- a/lib/Info.php +++ b/lib/Info.php @@ -90,6 +90,8 @@ class Info $this->echo = ($options['Echo'] && NN_ECHOCLI); $this->pdo = ($options['Settings'] instanceof DB ? $options['Settings'] : new DB()); + $s = new Sites(); + $this->site = $s->get(); $this->nzbs = ($this->site->maxnfoprocessed != '') ? (int)$this->site->maxnfoprocessed : 100; $this->maxsize = ($this->site->maxsizetoprocessnfo != '') ? (int)$this->site->maxsizetoprocessnfo : 100; $this->maxsize = ($this->maxsize > 0 ? ('AND size < ' . ($this->maxsize * 1073741824)) : ''); @@ -257,9 +259,11 @@ class Info */ static public function NfoQueryString(Settings &$pdo) { - $maxSize = $pdo->getSetting('maxsizetoprocessnfo'); - $minSize = $pdo->getSetting('minsizetoprocessnfo'); - $maxRetries = (int)($pdo->getSetting('maxnforetries') >= 0 ? -((int)$pdo->getSetting('maxnforetries') + 1) : self::NFO_UNPROC); + $s = new Sites(); + $site = $s->get(); + $maxSize = $site->maxsizetoprocessnfo; + $minSize = $site->minsizetoprocessnfo; + $maxRetries = (int)($site->maxnforetries >= 0 ? -((int)$site->maxnforetries + 1) : self::NFO_UNPROC); return ( sprintf( 'AND r.nzbstatus = %d AND r.nfostatus BETWEEN %d AND %d %s %s', diff --git a/lib/Pprocess.php b/lib/Pprocess.php index 922bb06e2..29078c5b2 100644 --- a/lib/Pprocess.php +++ b/lib/Pprocess.php @@ -114,7 +114,7 @@ class PProcess $this->site = $s->get(); //\\ Class instances. $this->pdo = (($options['Settings'] instanceof DB) ? $options['Settings'] : new DB()); - $this->groups = (($options['Groups'] instanceof Groups) ? $options['Groups'] : new Groups(['Settings' => $this->pdo])); + $this->groups = (($options['Groups'] instanceof Groups) ? $options['Groups'] : new Groups()); $this->_par2Info = new Par2Info(); $this->debugging = ($options['Logger'] instanceof Logger ? $options['Logger'] : new Logger(['ColorCLI' => $this->pdo->log])); $this->nameFixer = (($options['NameFixer'] instanceof NameFixer) ? $options['NameFixer'] : new NameFixer(['Echo' => $this->echooutput, 'Settings' => $this->pdo, 'Groups' => $this->groups])); diff --git a/lib/TraktTv.php b/lib/TraktTv.php index 95a8bbc35..f0a0b25eb 100644 --- a/lib/TraktTv.php +++ b/lib/TraktTv.php @@ -26,7 +26,9 @@ Class TraktTv $options += $defaults; $settings = ($options['Settings'] instanceof DB ? $options['Settings'] : new DB()); - $this->APIKEY = $settings->getSetting('trakttvkey'); + $s = new Sites(); + $site = $s->get(); + $this->APIKEY = $site->trakttvkey; } /**