mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-28 17:01:16 +00:00
Rename Models/Settings value function into settingValue to prevent collision with query builder value response
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
2017-09-01 DariusIII
|
||||
* Chg: Rename Models/Settings value function into settingValue to prevent collision with query builder value response
|
||||
* Chg: Update laravel/framework to version 5.5.1
|
||||
* Chg: Trim leading/trailing whitespace in DB->settingsUpdate function
|
||||
* Chg: Use array in where clause of query in value function of Settings model
|
||||
@@ -232,7 +233,7 @@
|
||||
* Chg: Move tmux starting tmux-ui script to root of the NNTmux install
|
||||
* Chg: Rename misc/update/nix/tmux/tmux-ui.php to just tmux-ui
|
||||
* Chg: Use strict comparisons and cast int where needed in TmuxRun class
|
||||
* Chg: Cast int type to all Settings::value lines, as that function returns string
|
||||
* Chg: Cast int type to all Settings::settingValue lines, as that function returns string
|
||||
* Chg: Change error message with no group selected in Backfill class
|
||||
* Chg: Use ColorCLI in update_binaries script
|
||||
* Chg: Slightly improve misc/update/backfill.php script
|
||||
@@ -820,7 +821,7 @@
|
||||
* Chg: Add user notes to themes and fix notes in admin area
|
||||
2016-09-07 DariusIII
|
||||
* Chg: Use PHP own decodeIgnore in yenc
|
||||
* Chg: Make Settings::value more robust
|
||||
* Chg: Make Settings::settingValue more robust
|
||||
2016-09-05 DariusIII
|
||||
* Chg: Update XSS vulnerability protection in themes.
|
||||
* Chg: Update composer installer to version 1.2.0
|
||||
|
||||
@@ -207,7 +207,7 @@ class Versions extends Collection
|
||||
|
||||
public function getSQLPatchFromDB()
|
||||
{
|
||||
$dbVersion = Settings::value('..sqlpatch', true);
|
||||
$dbVersion = Settings::settingValue('..sqlpatch', true);
|
||||
|
||||
if (! is_numeric($dbVersion)) {
|
||||
throw new \RuntimeException('Bad sqlpatch value');
|
||||
|
||||
@@ -204,15 +204,15 @@ class Settings extends Model
|
||||
* so it will be slower: Explicitly use the array format if speed it paramount.
|
||||
* Be aware that this method only returns the first of any values found, so make sure your
|
||||
* $setting produces a unique result.
|
||||
* @param $setting
|
||||
* @param bool|array $setting
|
||||
* @param bool $returnAlways Indicates if the method should throw an exception (false) or return
|
||||
* null on failure. Defaults to throwing an exception.
|
||||
*
|
||||
* @return string|null The setting's value, or null on failure IF 'returnAlways' is true.
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function value($setting, $returnAlways = false)
|
||||
{
|
||||
public static function settingValue($setting, $returnAlways = false): ?string
|
||||
{
|
||||
$setting = self::settingToArray($setting);
|
||||
$result = self::query()->where([
|
||||
'section' => $setting['section'],
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ if (defined('NN_INSTALLER') && NN_INSTALLER !== false) {
|
||||
ignored. Please update it to use the extension.', E_USER_WARNING
|
||||
);
|
||||
}
|
||||
case ! empty(Settings::value('apps..yydecoderpath')):
|
||||
case ! empty(Settings::settingValue('apps..yydecoderpath')):
|
||||
$adapter = 'Ydecode';
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -11,7 +11,7 @@ $debug = false;
|
||||
$pdo = new DB();
|
||||
$groups = new Groups(['Settings' => $pdo]);
|
||||
$consoletools = new ConsoleTools(['ColorCLI' => $pdo->log]);
|
||||
$DoPartRepair = (Settings::value('..partrepair') == '0') ? false : true;
|
||||
$DoPartRepair = (Settings::settingValue('..partrepair') == '0') ? false : true;
|
||||
|
||||
if ((! isset($argv[1])) || $argv[1] != 'true') {
|
||||
exit($pdo->log->error("\nMandatory argument missing\n\n"
|
||||
|
||||
@@ -61,7 +61,7 @@ $pdo->optimise(false, 'full');
|
||||
|
||||
echo ColorCLI::header('Deleting nzbfiles subfolders.');
|
||||
try {
|
||||
$files = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator(Settings::value('..nzbpath'), \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::CHILD_FIRST);
|
||||
$files = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator(Settings::settingValue('..nzbpath'), \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::CHILD_FIRST);
|
||||
foreach ($files as $file) {
|
||||
if (basename($file) !== '.gitignore' && basename($file) !== 'tmpunrar') {
|
||||
$todo = ($file->isDir() ? 'rmdir' : 'unlink');
|
||||
|
||||
@@ -34,7 +34,7 @@ $couldbe = ($argv[1] === 'true') ? 'could be ' : '';
|
||||
echo $pdo->log->header('Getting List of nzbs to check against db.');
|
||||
echo $pdo->log->header("Checked / {$couldbe}moved\n");
|
||||
|
||||
$dirItr = new \RecursiveDirectoryIterator(Settings::value('..nzbpath'));
|
||||
$dirItr = new \RecursiveDirectoryIterator(Settings::settingValue('..nzbpath'));
|
||||
$itr = new \RecursiveIteratorIterator($dirItr, \RecursiveIteratorIterator::LEAVES_ONLY);
|
||||
|
||||
foreach ($itr as $filePath) {
|
||||
|
||||
@@ -35,7 +35,7 @@ if (isset($argv[1], $argv[2], $argv[3], $argv[4])) {
|
||||
$nntp = null;
|
||||
if ($argv[1] === 7 || $argv[1] === 8) {
|
||||
$nntp = new NNTP(['Settings' => $pdo]);
|
||||
if ((Settings::value('..alternate_nntp') === 1 ? $nntp->doConnect(true, true) : $nntp->doConnect()) !== true) {
|
||||
if ((Settings::settingValue('..alternate_nntp') === 1 ? $nntp->doConnect(true, true) : $nntp->doConnect()) !== true) {
|
||||
echo ColorCLI::error('Unable to connect to usenet.'.PHP_EOL);
|
||||
|
||||
return;
|
||||
|
||||
@@ -7,9 +7,9 @@ use App\Models\Settings;
|
||||
use ApaiIO\Operations\Search;
|
||||
use ApaiIO\Configuration\GenericConfiguration;
|
||||
|
||||
$pubkey = Settings::value('APIs..amazonpubkey');
|
||||
$privkey = Settings::value('APIs..amazonprivkey');
|
||||
$asstag = Settings::value('APIs..amazonassociatetag');
|
||||
$pubkey = Settings::settingValue('APIs..amazonpubkey');
|
||||
$privkey = Settings::settingValue('APIs..amazonprivkey');
|
||||
$asstag = Settings::settingValue('APIs..amazonassociatetag');
|
||||
|
||||
$conf = new GenericConfiguration();
|
||||
$client = new \GuzzleHttp\Client();
|
||||
|
||||
@@ -6,7 +6,7 @@ use nntmux\ColorCLI;
|
||||
use App\Models\Settings;
|
||||
use nntmux\libraries\FanartTV;
|
||||
|
||||
$fanart = new FanartTV(Settings::value('APIs..fanarttvkey'));
|
||||
$fanart = new FanartTV(Settings::settingValue('APIs..fanarttvkey'));
|
||||
|
||||
if (! empty($argv[1])) {
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ use App\Models\Settings;
|
||||
|
||||
$pdo = new DB();
|
||||
|
||||
if (! Settings::value('..tablepergroup')) {
|
||||
if (! Settings::settingValue('..tablepergroup')) {
|
||||
exit('Tables per groups is not enabled, quitting!');
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ use App\Models\Settings;
|
||||
|
||||
$pdo = new DB();
|
||||
|
||||
if (! Settings::value('..tablepergroup')) {
|
||||
if (! Settings::settingValue('..tablepergroup')) {
|
||||
exit('Tables per groups is not enabled, quitting!');
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ use App\Models\Settings;
|
||||
|
||||
$pdo = new DB();
|
||||
|
||||
if (! Settings::value('..tablepergroup')) {
|
||||
if (! Settings::settingValue('..tablepergroup')) {
|
||||
exit('Tables per groups is not enabled, quitting!');
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ $compl = 0;
|
||||
echo 'Updating file size for '.count($items).' release(s)'.PHP_EOL;
|
||||
|
||||
while ($item = array_pop($items)) {
|
||||
$nzbpath = $nzb->getNZBPath($item['guid'], Settings::value('..nzbpath'));
|
||||
$nzbpath = $nzb->getNZBPath($item['guid'], Settings::settingValue('..nzbpath'));
|
||||
|
||||
ob_start();
|
||||
@readgzfile($nzbpath);
|
||||
|
||||
@@ -77,7 +77,7 @@ switch ($options[1]) {
|
||||
}
|
||||
}
|
||||
$binaries = new Binaries(['NNTP' => $nntp, 'Settings' => $pdo, 'Groups' => $groups]);
|
||||
$return = $binaries->scan($groupMySQL, $options[4], $options[5], (Settings::value('..safepartrepair') == 1 ? 'update' : 'backfill'));
|
||||
$return = $binaries->scan($groupMySQL, $options[4], $options[5], (Settings::settingValue('..safepartrepair') == 1 ? 'update' : 'backfill'));
|
||||
if (empty($return)) {
|
||||
exit();
|
||||
}
|
||||
@@ -286,7 +286,7 @@ switch ($options[1]) {
|
||||
*/
|
||||
function processReleases($releases, $groupID)
|
||||
{
|
||||
$releaseCreationLimit = (Settings::value('..maxnzbsprocessed') != '' ? (int)Settings::value('..maxnzbsprocessed') : 1000);
|
||||
$releaseCreationLimit = (Settings::settingValue('..maxnzbsprocessed') != '' ? (int)Settings::settingValue('..maxnzbsprocessed') : 1000);
|
||||
$releases->processIncompleteCollections($groupID);
|
||||
$releases->processCollectionSizes($groupID);
|
||||
$releases->deleteUnwantedCollections($groupID);
|
||||
@@ -343,7 +343,7 @@ function collectionCheck(&$pdo, $groupID)
|
||||
function &nntp(&$pdo, $alternate = false)
|
||||
{
|
||||
$nntp = new NNTP(['Settings' => $pdo]);
|
||||
if (($alternate && (int)Settings::value('..alternate_nntp') === 1 ? $nntp->doConnect(true, true) : $nntp->doConnect()) !== true) {
|
||||
if (($alternate && (int)Settings::settingValue('..alternate_nntp') === 1 ? $nntp->doConnect(true, true) : $nntp->doConnect()) !== true) {
|
||||
exit('ERROR: Unable to connect to usenet.' . PHP_EOL);
|
||||
}
|
||||
|
||||
|
||||
@@ -205,7 +205,7 @@ switch (true) {
|
||||
echo ColorCLI::primaryOver('p');
|
||||
if (! isset($nzbcontents)) {
|
||||
$nntp = new NNTP(['Settings' => $pdo]);
|
||||
if (((int) Settings::value('..alternate_nntp') === 1 ? $nntp->doConnect(true, true) : $nntp->doConnect()) !== true) {
|
||||
if (((int) Settings::settingValue('..alternate_nntp') === 1 ? $nntp->doConnect(true, true) : $nntp->doConnect()) !== true) {
|
||||
ColorCLI::error('Unable to connect to usenet.');
|
||||
}
|
||||
$Nfo = new Nfo(['Settings' => $pdo, 'Echo' => true]);
|
||||
|
||||
@@ -364,7 +364,7 @@ while ($runVar['counts']['iterations'] > 0) {
|
||||
$tRun->runPane('notrunning', $runVar);
|
||||
}
|
||||
|
||||
$exit = Settings::value('tmux.running.exit');
|
||||
$exit = Settings::settingValue('tmux.running.exit');
|
||||
if ($exit == 0) {
|
||||
$runVar['counts']['iterations']++;
|
||||
sleep(10);
|
||||
|
||||
@@ -12,13 +12,13 @@ $pdo = new DB();
|
||||
$DIR = NN_TMUX;
|
||||
$t = new Tmux();
|
||||
$tmux = $t->get();
|
||||
$patch = Settings::value('..sqlpatch');
|
||||
$patch = Settings::settingValue('..sqlpatch');
|
||||
$import = $tmux->import ?? 0;
|
||||
$tmux_session = $tmux->tmux_session ?? 0;
|
||||
$seq = $tmux->sequential ?? 0;
|
||||
$powerline = $tmux->powerline ?? 0;
|
||||
$colors = $tmux->colors ?? 0;
|
||||
$delaytimet = Settings::value('..delaytime');
|
||||
$delaytimet = Settings::settingValue('..delaytime');
|
||||
$delaytimet = $delaytimet ? (int) $delaytimet : 2;
|
||||
|
||||
Utility::isPatched();
|
||||
|
||||
@@ -65,7 +65,7 @@ if (! isset($argv[1]) || ! in_array($argv[1], $args, false) || ! isset($argv[2])
|
||||
$nntp = null;
|
||||
if ($args[$argv[1]] === true) {
|
||||
$nntp = new NNTP(['Settings' => $pdo]);
|
||||
if ((Settings::value('..alternate_nntp') === 1 ? $nntp->doConnect(true, true) : $nntp->doConnect()) !== true) {
|
||||
if ((Settings::settingValue('..alternate_nntp') === 1 ? $nntp->doConnect(true, true) : $nntp->doConnect()) !== true) {
|
||||
exit($pdo->log->error('Unable to connect to usenet.'.PHP_EOL));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ use App\Models\Settings;
|
||||
|
||||
$pdo = new DB();
|
||||
|
||||
$maxHeaders = (int) Settings::value('max.headers.iteration') ?: 1000000;
|
||||
$maxHeaders = (int) Settings::settingValue('max.headers.iteration') ?: 1000000;
|
||||
|
||||
// Create the connection here and pass
|
||||
$nntp = new NNTP(['Settings' => $pdo]);
|
||||
|
||||
+4
-4
@@ -114,10 +114,10 @@ class Backfill
|
||||
}
|
||||
}
|
||||
|
||||
$this->_compressedHeaders = (int) Settings::value('..compressedheaders') === 1;
|
||||
$this->_safeBackFillDate = Settings::value('..safebackfilldate') !== '' ? (string) Settings::value('safebackfilldate') : '2008-08-14';
|
||||
$this->_safePartRepair = (int) Settings::value('..safepartrepair') === 1 ? 'update' : 'backfill';
|
||||
$this->_disableBackfillGroup = (int) Settings::value('..disablebackfillgroup') === 1;
|
||||
$this->_compressedHeaders = (int) Settings::settingValue('..compressedheaders') === 1;
|
||||
$this->_safeBackFillDate = Settings::settingValue('..safebackfilldate') !== '' ? (string) Settings::settingValue('safebackfilldate') : '2008-08-14';
|
||||
$this->_safePartRepair = (int) Settings::settingValue('..safepartrepair') === 1 ? 'update' : 'backfill';
|
||||
$this->_disableBackfillGroup = (int) Settings::settingValue('..disablebackfillgroup') === 1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+10
-10
@@ -273,16 +273,16 @@ class Binaries
|
||||
}
|
||||
}
|
||||
|
||||
$this->messageBuffer = Settings::value('..maxmssgs') !== '' ?
|
||||
(int) Settings::value('..maxmssgs') : 20000;
|
||||
$this->_compressedHeaders = Settings::value('..compressedheaders') === 1;
|
||||
$this->_partRepair = Settings::value('..partrepair') === 1;
|
||||
$this->_newGroupScanByDays = Settings::value('..newgroupscanmethod') === 1;
|
||||
$this->_newGroupMessagesToScan = Settings::value('..newgroupmsgstoscan') !== '' ? (int) Settings::value('..newgroupmsgstoscan') : 50000;
|
||||
$this->_newGroupDaysToScan = Settings::value('..newgroupdaystoscan') !== '' ? (int) Settings::value('..newgroupdaystoscan') : 3;
|
||||
$this->_partRepairLimit = Settings::value('..maxpartrepair') !== '' ? (int) Settings::value('..maxpartrepair') : 15000;
|
||||
$this->_partRepairMaxTries = (Settings::value('..partrepairmaxtries') !== '' ? (int) Settings::value('..partrepairmaxtries') : 3);
|
||||
$this->_showDroppedYEncParts = Settings::value('..showdroppedyencparts') === 1;
|
||||
$this->messageBuffer = Settings::settingValue('..maxmssgs') !== '' ?
|
||||
(int) Settings::settingValue('..maxmssgs') : 20000;
|
||||
$this->_compressedHeaders = Settings::settingValue('..compressedheaders') === 1;
|
||||
$this->_partRepair = Settings::settingValue('..partrepair') === 1;
|
||||
$this->_newGroupScanByDays = Settings::settingValue('..newgroupscanmethod') === 1;
|
||||
$this->_newGroupMessagesToScan = Settings::settingValue('..newgroupmsgstoscan') !== '' ? (int) Settings::settingValue('..newgroupmsgstoscan') : 50000;
|
||||
$this->_newGroupDaysToScan = Settings::settingValue('..newgroupdaystoscan') !== '' ? (int) Settings::settingValue('..newgroupdaystoscan') : 3;
|
||||
$this->_partRepairLimit = Settings::settingValue('..maxpartrepair') !== '' ? (int) Settings::settingValue('..maxpartrepair') : 15000;
|
||||
$this->_partRepairMaxTries = (Settings::settingValue('..partrepairmaxtries') !== '' ? (int) Settings::settingValue('..partrepairmaxtries') : 3);
|
||||
$this->_showDroppedYEncParts = Settings::settingValue('..showdroppedyencparts') === 1;
|
||||
|
||||
$this->blackList = $this->whiteList = [];
|
||||
}
|
||||
|
||||
+7
-7
@@ -89,16 +89,16 @@ class Books
|
||||
$this->echooutput = ($options['Echo'] && NN_ECHOCLI);
|
||||
$this->pdo = ($options['Settings'] instanceof DB ? $options['Settings'] : new DB());
|
||||
|
||||
$this->pubkey = Settings::value('APIs..amazonpubkey');
|
||||
$this->privkey = Settings::value('APIs..amazonprivkey');
|
||||
$this->asstag = Settings::value('APIs..amazonassociatetag');
|
||||
$this->bookqty = Settings::value('..maxbooksprocessed') !== '' ? Settings::value('..maxbooksprocessed') : 300;
|
||||
$this->sleeptime = Settings::value('..amazonsleep') !== '' ? Settings::value('..amazonsleep') : 1000;
|
||||
$this->pubkey = Settings::settingValue('APIs..amazonpubkey');
|
||||
$this->privkey = Settings::settingValue('APIs..amazonprivkey');
|
||||
$this->asstag = Settings::settingValue('APIs..amazonassociatetag');
|
||||
$this->bookqty = Settings::settingValue('..maxbooksprocessed') !== '' ? Settings::settingValue('..maxbooksprocessed') : 300;
|
||||
$this->sleeptime = Settings::settingValue('..amazonsleep') !== '' ? Settings::settingValue('..amazonsleep') : 1000;
|
||||
$this->imgSavePath = NN_COVERS.'book'.DS;
|
||||
$result = Settings::value('..book_reqids');
|
||||
$result = Settings::settingValue('..book_reqids');
|
||||
$this->bookreqids = empty($result) ? Category::BOOKS_EBOOK : $result;
|
||||
$this->renamed = '';
|
||||
if ((int) Settings::value('..lookupbooks') === 2) {
|
||||
if ((int) Settings::settingValue('..lookupbooks') === 2) {
|
||||
$this->renamed = 'AND isrenamed = 1';
|
||||
}
|
||||
|
||||
|
||||
@@ -60,8 +60,8 @@ class Categorize extends Category
|
||||
public function __construct(array $options = [])
|
||||
{
|
||||
parent::__construct($options);
|
||||
$this->categorizeForeign = (int) Settings::value('indexer.categorise.categorizeforeign');
|
||||
$this->catWebDL = (int) Settings::value('indexer.categorise.catwebdl');
|
||||
$this->categorizeForeign = (int) Settings::settingValue('indexer.categorise.categorizeforeign');
|
||||
$this->catWebDL = (int) Settings::settingValue('indexer.categorise.catwebdl');
|
||||
$this->regexes = new Regexes(['Settings' => $this->pdo, 'Table_Name' => 'category_regexes']);
|
||||
}
|
||||
|
||||
|
||||
+6
-6
@@ -89,13 +89,13 @@ class Console
|
||||
$this->echooutput = ($options['Echo'] && NN_ECHOCLI);
|
||||
$this->pdo = ($options['Settings'] instanceof DB ? $options['Settings'] : new DB());
|
||||
|
||||
$this->pubkey = Settings::value('APIs..amazonpubkey');
|
||||
$this->privkey = Settings::value('APIs..amazonprivkey');
|
||||
$this->asstag = Settings::value('APIs..amazonassociatetag');
|
||||
$this->gameqty = (Settings::value('..maxgamesprocessed') != '') ? Settings::value('..maxgamesprocessed') : 150;
|
||||
$this->sleeptime = (Settings::value('..amazonsleep') != '') ? Settings::value('..amazonsleep') : 1000;
|
||||
$this->pubkey = Settings::settingValue('APIs..amazonpubkey');
|
||||
$this->privkey = Settings::settingValue('APIs..amazonprivkey');
|
||||
$this->asstag = Settings::settingValue('APIs..amazonassociatetag');
|
||||
$this->gameqty = (Settings::settingValue('..maxgamesprocessed') != '') ? Settings::settingValue('..maxgamesprocessed') : 150;
|
||||
$this->sleeptime = (Settings::settingValue('..amazonsleep') != '') ? Settings::settingValue('..amazonsleep') : 1000;
|
||||
$this->imgSavePath = NN_COVERS.'console'.DS;
|
||||
$this->renamed = Settings::value('..lookupgames') == 2 ? 'AND isrenamed = 1' : '';
|
||||
$this->renamed = Settings::settingValue('..lookupgames') == 2 ? 'AND isrenamed = 1' : '';
|
||||
$this->catWhere = 'PARTITION (console)';
|
||||
|
||||
$this->failCache = [];
|
||||
|
||||
+3
-3
@@ -117,10 +117,10 @@ class Games
|
||||
|
||||
$this->pdo = ($options['Settings'] instanceof DB ? $options['Settings'] : new DB());
|
||||
|
||||
$this->publicKey = Settings::value('APIs..giantbombkey');
|
||||
$this->gameQty = Settings::value('..maxgamesprocessed') !== '' ? Settings::value('..maxgamesprocessed') : 150;
|
||||
$this->publicKey = Settings::settingValue('APIs..giantbombkey');
|
||||
$this->gameQty = Settings::settingValue('..maxgamesprocessed') !== '' ? Settings::settingValue('..maxgamesprocessed') : 150;
|
||||
$this->imgSavePath = NN_COVERS.'games'.DS;
|
||||
$this->renamed = Settings::value('..lookupgames') === 2 ? 'AND isrenamed = 1' : '';
|
||||
$this->renamed = Settings::settingValue('..lookupgames') === 2 ? 'AND isrenamed = 1' : '';
|
||||
$this->matchPercentage = 60;
|
||||
$this->maxHitRequest = false;
|
||||
$this->catWhere = 'AND categories_id = '.Category::PC_GAMES.' ';
|
||||
|
||||
+2
-2
@@ -64,8 +64,8 @@ class Logging
|
||||
public function LogBadPasswd($username = '', $host = ''): void
|
||||
{
|
||||
// If logggingopt is = 0, then we do nothing, 0 = logging off.
|
||||
$loggingOpt = Settings::value('site.main.loggingopt');
|
||||
$logFile = Settings::value('site.main.logfile');
|
||||
$loggingOpt = Settings::settingValue('site.main.loggingopt');
|
||||
$logFile = Settings::settingValue('site.main.logfile');
|
||||
if ((int) $loggingOpt === 1) {
|
||||
$this->pdo->queryInsert(sprintf('INSERT INTO logging (time, username, host) VALUES (NOW(), %s, %s)',
|
||||
$this->pdo->escapeString($username), $this->pdo->escapeString($host)));
|
||||
|
||||
@@ -81,9 +81,9 @@ class MiscSorter
|
||||
$this->movie = new Movie(['Echo' => $this->echooutput, 'Settings' => $this->pdo]);
|
||||
$this->music = new Music(['Echo' => $this->echooutput, 'Settings' => $this->pdo]);
|
||||
$this->book = new Books(['Echo' => $this->echooutput, 'Settings' => $this->pdo]);
|
||||
$this->pubkey = Settings::value('APIs..amazonpubkey');
|
||||
$this->privkey = Settings::value('APIs..amazonprivkey');
|
||||
$this->asstag = Settings::value('APIs..amazonassociatetag');
|
||||
$this->pubkey = Settings::settingValue('APIs..amazonpubkey');
|
||||
$this->privkey = Settings::settingValue('APIs..amazonprivkey');
|
||||
$this->asstag = Settings::settingValue('APIs..amazonassociatetag');
|
||||
}
|
||||
|
||||
// Main function that determines which operation(s) should be run based on the releases NFO file
|
||||
|
||||
+7
-7
@@ -174,21 +174,21 @@ class Movie
|
||||
$this->pdo = ($options['Settings'] instanceof DB ? $options['Settings'] : new DB());
|
||||
$this->releaseImage = ($options['ReleaseImage'] instanceof ReleaseImage ? $options['ReleaseImage'] : new ReleaseImage($this->pdo));
|
||||
$this->client = new Client();
|
||||
$this->tmdbtoken = new ApiToken(Settings::value('APIs..tmdbkey'));
|
||||
$this->tmdbtoken = new ApiToken(Settings::settingValue('APIs..tmdbkey'));
|
||||
$this->tmdbclient = new TmdbClient($this->tmdbtoken, [
|
||||
'cache' => [
|
||||
'enabled' => false,
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->fanartapikey = Settings::value('APIs..fanarttvkey');
|
||||
$this->fanartapikey = Settings::settingValue('APIs..fanarttvkey');
|
||||
$this->fanart = new FanartTV($this->fanartapikey);
|
||||
$this->omdbapikey = Settings::value('APIs..omdbkey');
|
||||
$this->omdbapikey = Settings::settingValue('APIs..omdbkey');
|
||||
|
||||
$this->lookuplanguage = Settings::value('indexer.categorise.imdblanguage') !== '' ? (string) Settings::value('indexer.categorise.imdblanguage') : 'en';
|
||||
$this->lookuplanguage = Settings::settingValue('indexer.categorise.imdblanguage') !== '' ? (string) Settings::settingValue('indexer.categorise.imdblanguage') : 'en';
|
||||
|
||||
$this->imdburl = Settings::value('indexer.categorise.imdburl') === 0 ? false : true;
|
||||
$this->movieqty = Settings::value('..maximdbprocessed') !== '' ? Settings::value('..maximdbprocessed') : 100;
|
||||
$this->imdburl = Settings::settingValue('indexer.categorise.imdburl') === 0 ? false : true;
|
||||
$this->movieqty = Settings::settingValue('..maximdbprocessed') !== '' ? Settings::settingValue('..maximdbprocessed') : 100;
|
||||
$this->searchEngines = true;
|
||||
$this->showPasswords = Releases::showPasswords();
|
||||
|
||||
@@ -955,7 +955,7 @@ class Movie
|
||||
$this->client->get(
|
||||
'http://'.($this->imdburl === false ? 'www' : 'akas').'.imdb.com/title/tt'.$imdbId.'/',
|
||||
['headers' => [
|
||||
'Accept-Language' => ((Settings::value('indexer.categorise.imdblanguage') != '') ? Settings::value('indexer.categorise.imdblanguage') : 'en'),
|
||||
'Accept-Language' => ((Settings::settingValue('indexer.categorise.imdblanguage') != '') ? Settings::settingValue('indexer.categorise.imdblanguage') : 'en'),
|
||||
'useragent' => 'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) '.
|
||||
'Version/4.0.4 Mobile/7B334b Safari/531.21.102011-10-16 20:23:10', 'foo=bar',
|
||||
],
|
||||
|
||||
+6
-6
@@ -81,14 +81,14 @@ class Music
|
||||
$this->echooutput = ($options['Echo'] && NN_ECHOCLI);
|
||||
|
||||
$this->pdo = ($options['Settings'] instanceof DB ? $options['Settings'] : new DB());
|
||||
$this->pubkey = Settings::value('APIs..amazonpubkey');
|
||||
$this->privkey = Settings::value('APIs..amazonprivkey');
|
||||
$this->asstag = Settings::value('APIs..amazonassociatetag');
|
||||
$this->musicqty = Settings::value('..maxmusicprocessed') != '' ? Settings::value('..maxmusicprocessed') : 150;
|
||||
$this->sleeptime = Settings::value('..amazonsleep') != '' ? Settings::value('..amazonsleep') : 1000;
|
||||
$this->pubkey = Settings::settingValue('APIs..amazonpubkey');
|
||||
$this->privkey = Settings::settingValue('APIs..amazonprivkey');
|
||||
$this->asstag = Settings::settingValue('APIs..amazonassociatetag');
|
||||
$this->musicqty = Settings::settingValue('..maxmusicprocessed') != '' ? Settings::settingValue('..maxmusicprocessed') : 150;
|
||||
$this->sleeptime = Settings::settingValue('..amazonsleep') != '' ? Settings::settingValue('..amazonsleep') : 1000;
|
||||
$this->imgSavePath = NN_COVERS.'music'.DS;
|
||||
$this->renamed = '';
|
||||
if (Settings::value('..lookupmusic') == 2) {
|
||||
if (Settings::settingValue('..lookupmusic') == 2) {
|
||||
$this->renamed = 'AND isrenamed = 1';
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -110,7 +110,7 @@ class NNTP extends \Net_NNTP_Client
|
||||
}
|
||||
}
|
||||
|
||||
$this->_nntpRetries = Settings::value('..nntpretries') !== '' ? (int) Settings::value('..nntpretries') : 0 + 1;
|
||||
$this->_nntpRetries = Settings::settingValue('..nntpretries') !== '' ? (int) Settings::settingValue('..nntpretries') : 0 + 1;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -262,7 +262,7 @@ class NNTP extends \Net_NNTP_Client
|
||||
// If we are connected and authenticated, try enabling compression if we have it enabled.
|
||||
if ($connected === true && $authenticated === true) {
|
||||
// Check if we should use compression on the connection.
|
||||
if ($compression === false || (int) Settings::value('..compressedheaders') === 0) {
|
||||
if ($compression === false || (int) Settings::settingValue('..compressedheaders') === 0) {
|
||||
$this->_compressionSupported = false;
|
||||
}
|
||||
if ($this->_debugBool) {
|
||||
@@ -335,7 +335,7 @@ class NNTP extends \Net_NNTP_Client
|
||||
*/
|
||||
public function enableCompression(): void
|
||||
{
|
||||
if ((int) Settings::value('..compressedheaders') !== 1) {
|
||||
if ((int) Settings::settingValue('..compressedheaders') !== 1) {
|
||||
return;
|
||||
}
|
||||
$this->_enableCompression();
|
||||
|
||||
+2
-2
@@ -103,9 +103,9 @@ class NZB
|
||||
{
|
||||
$this->pdo = ($pdo instanceof DB ? $pdo : new DB());
|
||||
|
||||
$nzbSplitLevel = Settings::value('..nzbsplitlevel');
|
||||
$nzbSplitLevel = Settings::settingValue('..nzbsplitlevel');
|
||||
$this->nzbSplitLevel = (empty($nzbSplitLevel) ? 1 : $nzbSplitLevel);
|
||||
$this->siteNzbPath = (string) Settings::value('..nzbpath');
|
||||
$this->siteNzbPath = (string) Settings::settingValue('..nzbpath');
|
||||
if (substr($this->siteNzbPath, -1) !== DS) {
|
||||
$this->siteNzbPath .= DS;
|
||||
}
|
||||
|
||||
@@ -92,8 +92,8 @@ class NZBContents
|
||||
: new PostProcess(['Echo' => $this->echooutput, 'Nfo' => $this->nfo, 'Settings' => $this->pdo])
|
||||
);
|
||||
$this->nzb = ($options['NZB'] instanceof NZB ? $options['NZB'] : new NZB($this->pdo));
|
||||
$this->lookuppar2 = (int) Settings::value('..lookuppar2') === 1 ? true : false;
|
||||
$this->alternateNNTP = (int) Settings::value('..alternate_nntp') === 1 ? true : false;
|
||||
$this->lookuppar2 = (int) Settings::settingValue('..lookuppar2') === 1 ? true : false;
|
||||
$this->alternateNNTP = (int) Settings::settingValue('..alternate_nntp') === 1 ? true : false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -116,7 +116,7 @@ class NZBImport
|
||||
$this->releases = ($options['Releases'] instanceof Releases ? $options['Releases'] : new Releases(['settings' => $this->pdo]));
|
||||
$this->groups = new Groups(['Settings' => $this->pdo]);
|
||||
|
||||
$this->crossPostt = Settings::value('..crossposttime') !== '' ? Settings::value('..crossposttime') : 2;
|
||||
$this->crossPostt = Settings::settingValue('..crossposttime') !== '' ? Settings::settingValue('..crossposttime') : 2;
|
||||
$this->browser = $options['Browser'];
|
||||
$this->retVal = '';
|
||||
}
|
||||
|
||||
+8
-8
@@ -78,14 +78,14 @@ class Nfo
|
||||
$options += $defaults;
|
||||
$this->echo = ($options['Echo'] && NN_ECHOCLI);
|
||||
$this->pdo = ($options['Settings'] instanceof DB ? $options['Settings'] : new DB());
|
||||
$this->nzbs = Settings::value('..maxnfoprocessed') !== '' ? (int) Settings::value('..maxnfoprocessed') : 100;
|
||||
$this->maxsize = Settings::value('..maxsizetoprocessnfo') !== '' ? (int) Settings::value('..maxsizetoprocessnfo') : 100;
|
||||
$this->nzbs = Settings::settingValue('..maxnfoprocessed') !== '' ? (int) Settings::settingValue('..maxnfoprocessed') : 100;
|
||||
$this->maxsize = Settings::settingValue('..maxsizetoprocessnfo') !== '' ? (int) Settings::settingValue('..maxsizetoprocessnfo') : 100;
|
||||
$this->maxsize = $this->maxsize > 0 ? ('AND size < '.($this->maxsize * 1073741824)) : '';
|
||||
$this->minsize = Settings::value('..minsizetoprocessnfo') !== '' ? (int) Settings::value('..minsizetoprocessnfo') : 100;
|
||||
$this->minsize = Settings::settingValue('..minsizetoprocessnfo') !== '' ? (int) Settings::settingValue('..minsizetoprocessnfo') : 100;
|
||||
$this->minsize = $this->minsize > 0 ? ('AND size > '.($this->minsize * 1048576)) : '';
|
||||
$this->maxRetries = (int) Settings::value('..maxnforetries') >= 0 ? -((int) Settings::value('..maxnforetries') + 1) : self::NFO_UNPROC;
|
||||
$this->maxRetries = (int) Settings::settingValue('..maxnforetries') >= 0 ? -((int) Settings::settingValue('..maxnforetries') + 1) : self::NFO_UNPROC;
|
||||
$this->maxRetries = $this->maxRetries < -8 ? -8 : $this->maxRetries;
|
||||
$this->tmpPath = (string) Settings::value('..tmpunrarpath');
|
||||
$this->tmpPath = (string) Settings::settingValue('..tmpunrarpath');
|
||||
if (! preg_match('/[\/\\\\]$/', $this->tmpPath)) {
|
||||
$this->tmpPath .= DS;
|
||||
}
|
||||
@@ -256,9 +256,9 @@ class Nfo
|
||||
*/
|
||||
public static function NfoQueryString()
|
||||
{
|
||||
$maxSize = (int) Settings::value('..maxsizetoprocessnfo');
|
||||
$minSize = (int) Settings::value('..minsizetoprocessnfo');
|
||||
$dummy = (int) Settings::value('..maxnforetries');
|
||||
$maxSize = (int) Settings::settingValue('..maxsizetoprocessnfo');
|
||||
$minSize = (int) Settings::settingValue('..minsizetoprocessnfo');
|
||||
$dummy = (int) Settings::settingValue('..maxnforetries');
|
||||
$maxRetries = ($dummy >= 0 ? -($dummy + 1) : self::NFO_UNPROC);
|
||||
|
||||
return sprintf(
|
||||
|
||||
@@ -160,7 +160,7 @@ class ReleaseComments
|
||||
*/
|
||||
public function addComment($id, $gid, $text, $userid, $host)
|
||||
{
|
||||
if ((int) Settings::value('..storeuserips') !== 1) {
|
||||
if ((int) Settings::settingValue('..storeuserips') !== 1) {
|
||||
$host = '';
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -71,8 +71,8 @@ class Releases
|
||||
|
||||
$this->pdo = ($options['Settings'] instanceof DB ? $options['Settings'] : new DB());
|
||||
$this->groups = ($options['Groups'] instanceof Groups ? $options['Groups'] : new Groups(['Settings' => $this->pdo]));
|
||||
$this->updateGrabs = ((int) Settings::value('..grabstatus') !== 0);
|
||||
$this->passwordStatus = ((int) Settings::value('..checkpasswordedrar') === 1 ? -1 : 0);
|
||||
$this->updateGrabs = ((int) Settings::settingValue('..grabstatus') !== 0);
|
||||
$this->passwordStatus = ((int) Settings::settingValue('..checkpasswordedrar') === 1 ? -1 : 0);
|
||||
$this->sphinxSearch = new SphinxSearch();
|
||||
$this->releaseSearch = new ReleaseSearch($this->pdo);
|
||||
$this->category = new Category(['Settings' => $this->pdo]);
|
||||
@@ -277,7 +277,7 @@ class Releases
|
||||
*/
|
||||
public static function showPasswords(): ?string
|
||||
{
|
||||
$setting = Settings::value('..showpasswordedrelease', true);
|
||||
$setting = Settings::settingValue('..showpasswordedrelease', true);
|
||||
$setting = (isset($setting) && is_numeric($setting)) ? $setting : 10;
|
||||
|
||||
switch ($setting) {
|
||||
|
||||
@@ -34,7 +34,7 @@ class RequestIDWeb extends RequestID
|
||||
public function __construct(array $options = [])
|
||||
{
|
||||
parent::__construct($options);
|
||||
$this->_request_hours = (Settings::value('..request_hours') != '') ? (int) Settings::value('..request_hours') : 1;
|
||||
$this->_request_hours = (Settings::settingValue('..request_hours') != '') ? (int) Settings::settingValue('..request_hours') : 1;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -152,7 +152,7 @@ class RequestIDWeb extends RequestID
|
||||
|
||||
// Do a web lookup.
|
||||
try {
|
||||
$returnXml = $this->client->request('POST', Settings::value('..request_url'),
|
||||
$returnXml = $this->client->request('POST', Settings::settingValue('..request_url'),
|
||||
['Link' => 'data='.serialize($requestArray)]
|
||||
)->getBody();
|
||||
} catch (RequestException $e) {
|
||||
|
||||
+6
-6
@@ -97,7 +97,7 @@ class SABnzbd
|
||||
$this->client = new Client(['verify' => false]);
|
||||
|
||||
// Set up properties.
|
||||
switch (Settings::value('apps.sabnzbplus.integrationtype')) {
|
||||
switch (Settings::settingValue('apps.sabnzbplus.integrationtype')) {
|
||||
case self::INTEGRATION_TYPE_USER:
|
||||
if (! empty($_COOKIE['sabnzbd_'.$this->uid.'__apikey']) && ! empty($_COOKIE['sabnzbd_'.$this->uid.'__host'])) {
|
||||
$this->url = $_COOKIE['sabnzbd_'.$this->uid.'__host'];
|
||||
@@ -123,12 +123,12 @@ class SABnzbd
|
||||
break;
|
||||
|
||||
case self::INTEGRATION_TYPE_SITEWIDE:
|
||||
if ((Settings::value('apps.sabnzbplus.apikey') !== '') && (Settings::value('apps.sabnzbplus.url')
|
||||
if ((Settings::settingValue('apps.sabnzbplus.apikey') !== '') && (Settings::settingValue('apps.sabnzbplus.url')
|
||||
!== '')) {
|
||||
$this->url = Settings::value('apps.sabnzbplus.url');
|
||||
$this->apikey = Settings::value('apps.sabnzbplus.apikey');
|
||||
$this->priority = Settings::value('apps.sabnzbplus.priority');
|
||||
$this->apikeytype = Settings::value('apps.sabnzbplus.apikeytype');
|
||||
$this->url = Settings::settingValue('apps.sabnzbplus.url');
|
||||
$this->apikey = Settings::settingValue('apps.sabnzbplus.apikey');
|
||||
$this->priority = Settings::settingValue('apps.sabnzbplus.priority');
|
||||
$this->apikeytype = Settings::settingValue('apps.sabnzbplus.apikeytype');
|
||||
}
|
||||
$this->integrated = self::INTEGRATION_TYPE_SITEWIDE;
|
||||
$this->integratedBool = true;
|
||||
|
||||
+1
-1
@@ -153,7 +153,7 @@ class Steam
|
||||
*/
|
||||
public function populateSteamAppsTable(): void
|
||||
{
|
||||
$lastUpdate = Settings::value('APIs.Steam.last_update');
|
||||
$lastUpdate = Settings::settingValue('APIs.Steam.last_update');
|
||||
$this->lastUpdate = $lastUpdate > 0 ? $lastUpdate : 0;
|
||||
if ((time() - (int) $this->lastUpdate) > 86400) {
|
||||
// Set time we updated steam_apps table
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ class TmuxRun extends Tmux
|
||||
public function __construct(DB $pdo = null)
|
||||
{
|
||||
parent::__construct($pdo);
|
||||
$dateFormat = Settings::value(
|
||||
$dateFormat = Settings::settingValue(
|
||||
[
|
||||
'section' => 'shell',
|
||||
'subsection' => 'date',
|
||||
|
||||
+8
-8
@@ -460,7 +460,7 @@ class Users
|
||||
$data = User::query()->whereDate('rolechangedate', '<', (new \DateTime())->format('Y-m-d H:i:s'))->select(['id', 'email'])->get();
|
||||
|
||||
foreach ($data as $u) {
|
||||
Utility::sendEmail($u['email'], $msgsubject, $msgbody, Settings::value('site.main.email'));
|
||||
Utility::sendEmail($u['email'], $msgsubject, $msgbody, Settings::settingValue('site.main.email'));
|
||||
User::query()->where('id', $u['id'])->update(['role' => self::ROLE_USER, 'rolechangedate' => null]);
|
||||
}
|
||||
|
||||
@@ -693,7 +693,7 @@ class Users
|
||||
|
||||
// Make sure this is the last check, as if a further validation check failed, the invite would still have been used up.
|
||||
$invitedBy = 0;
|
||||
if (! $forceInviteMode && (int) Settings::value('..registerstatus') === Settings::REGISTER_STATUS_INVITE) {
|
||||
if (! $forceInviteMode && (int) Settings::settingValue('..registerstatus') === Settings::REGISTER_STATUS_INVITE) {
|
||||
if ($inviteCode === '') {
|
||||
return self::ERR_SIGNUP_BADINVITECODE;
|
||||
}
|
||||
@@ -793,7 +793,7 @@ class Users
|
||||
'email' => $email,
|
||||
'role' => $role,
|
||||
'createddate' => new \DateTime('NOW'),
|
||||
'host' => (int) Settings::value('..storeuserips') === 1 ? $host : '',
|
||||
'host' => (int) Settings::settingValue('..storeuserips') === 1 ? $host : '',
|
||||
'rsstoken' => md5(Password::getRepository()->createNewToken()),
|
||||
'invites' => $invites,
|
||||
'invitedby' => (int) $invitedBy === 0 ? 'NULL' : $invitedBy,
|
||||
@@ -838,7 +838,7 @@ class Users
|
||||
{
|
||||
$_SESSION['uid'] = $userID;
|
||||
|
||||
if ((int) Settings::value('..storeuserips') !== 1) {
|
||||
if ((int) Settings::settingValue('..storeuserips') !== 1) {
|
||||
$host = '';
|
||||
}
|
||||
|
||||
@@ -1155,11 +1155,11 @@ class Users
|
||||
{
|
||||
$ipsql = "('-1')";
|
||||
|
||||
if (Settings::value('..userhostexclusion') !== '') {
|
||||
if (Settings::settingValue('..userhostexclusion') !== '') {
|
||||
$ipsql = '';
|
||||
$ips = explode(',', Settings::value('..userhostexclusion'));
|
||||
$ips = explode(',', Settings::settingValue('..userhostexclusion'));
|
||||
foreach ($ips as $ip) {
|
||||
$ipsql .= $this->pdo->escapeString($this->getHostHash($ip, Settings::value('..siteseed'))).',';
|
||||
$ipsql .= $this->pdo->escapeString($this->getHostHash($ip, Settings::settingValue('..siteseed'))).',';
|
||||
}
|
||||
$ipsql = '('.$ipsql." '-1')";
|
||||
}
|
||||
@@ -1190,7 +1190,7 @@ class Users
|
||||
public function getHostHash($host, string $siteseed = ''): string
|
||||
{
|
||||
if ($siteseed === '') {
|
||||
$siteseed = Settings::value('..siteseed');
|
||||
$siteseed = Settings::settingValue('..siteseed');
|
||||
}
|
||||
|
||||
return self::hashSHA1($siteseed.$host.$siteseed);
|
||||
|
||||
+1
-1
@@ -92,7 +92,7 @@ class XXX
|
||||
$this->pdo = ($options['Settings'] instanceof DB ? $options['Settings'] : new DB());
|
||||
$this->releaseImage = ($options['ReleaseImage'] instanceof ReleaseImage ? $options['ReleaseImage'] : new ReleaseImage($this->pdo));
|
||||
|
||||
$this->movieqty = (Settings::value('..maxxxxprocessed') !== '') ? Settings::value('..maxxxxprocessed') : 100;
|
||||
$this->movieqty = (Settings::settingValue('..maxxxxprocessed') !== '') ? Settings::settingValue('..maxxxxprocessed') : 100;
|
||||
$this->showPasswords = Releases::showPasswords();
|
||||
$this->debug = NN_DEBUG;
|
||||
$this->echooutput = ($options['Echo'] && NN_ECHOCLI);
|
||||
|
||||
+1
-1
@@ -1051,7 +1051,7 @@ class DB extends \PDO
|
||||
|
||||
public function setCovers()
|
||||
{
|
||||
$path = Settings::value([
|
||||
$path = Settings::settingValue([
|
||||
'section' => 'site',
|
||||
'subsection' => 'main',
|
||||
'name' => 'coverspath',
|
||||
|
||||
@@ -199,7 +199,7 @@ class DbUpdate
|
||||
} else {
|
||||
echo $this->log->header('Processing patch file: '.$file);
|
||||
$this->splitSQL($file, ['local' => $local, 'data' => $options['data']]);
|
||||
$current = Settings::value('..sqlpatch');
|
||||
$current = Settings::settingValue('..sqlpatch');
|
||||
$current++;
|
||||
Settings::query()->where('setting', '=', 'sqlpatch')->update(['value' => $current]);
|
||||
$newName = $matches['drive'].$matches['path'].
|
||||
@@ -233,7 +233,7 @@ class DbUpdate
|
||||
];
|
||||
$options += $defaults;
|
||||
|
||||
$currentVersion = Settings::value('..sqlpatch');
|
||||
$currentVersion = Settings::settingValue('..sqlpatch');
|
||||
if (! is_numeric($currentVersion)) {
|
||||
exit("Bad sqlpatch value: '$currentVersion'\n");
|
||||
}
|
||||
|
||||
@@ -74,11 +74,11 @@ class AniDB
|
||||
$this->echooutput = ($options['Echo'] && NN_ECHOCLI);
|
||||
$this->pdo = ($options['Settings'] instanceof DB ? $options['Settings'] : new DB());
|
||||
|
||||
$anidbupdint = Settings::value('APIs.AniDB.max_update_frequency');
|
||||
$lastupdated = Settings::value('APIs.AniDB.last_full_update');
|
||||
$anidbupdint = Settings::settingValue('APIs.AniDB.max_update_frequency');
|
||||
$lastupdated = Settings::settingValue('APIs.AniDB.last_full_update');
|
||||
|
||||
$this->imgSavePath = NN_COVERS.'anime'.DS;
|
||||
$this->apiKey = Settings::value('APIs..anidbkey');
|
||||
$this->apiKey = Settings::settingValue('APIs..anidbkey');
|
||||
|
||||
$this->updateInterval = $anidbupdint ?? '7';
|
||||
$this->lastUpdate = $lastupdated ?? '0';
|
||||
@@ -143,7 +143,7 @@ class AniDB
|
||||
*/
|
||||
private function getAniDbAPI($anidbId)
|
||||
{
|
||||
$timestamp = Settings::value('APIs.AniDB.banned') + 90000;
|
||||
$timestamp = Settings::settingValue('APIs.AniDB.banned') + 90000;
|
||||
if ($timestamp > time()) {
|
||||
echo 'Banned from AniDB lookups until '.date('Y-m-d H:i:s', $timestamp).PHP_EOL;
|
||||
|
||||
|
||||
@@ -134,10 +134,10 @@ abstract class Capabilities
|
||||
'server' => [
|
||||
'appversion' => (new Versions())->getGitTagInFile(),
|
||||
'version' => (new Versions())->getGitTagInRepo(),
|
||||
'title' => Settings::value('site.main.title'),
|
||||
'strapline' => Settings::value('site.main.strapline'),
|
||||
'email' => Settings::value('site.main.email'),
|
||||
'meta' => Settings::value('site.main.metakeywords'),
|
||||
'title' => Settings::settingValue('site.main.title'),
|
||||
'strapline' => Settings::settingValue('site.main.strapline'),
|
||||
'email' => Settings::settingValue('site.main.email'),
|
||||
'meta' => Settings::settingValue('site.main.metakeywords'),
|
||||
'url' => $serverroot,
|
||||
'image' => $serverroot.'themes/shared/images/tmux_logo.png',
|
||||
],
|
||||
@@ -147,7 +147,7 @@ abstract class Capabilities
|
||||
],
|
||||
'registration' => [
|
||||
'available' => 'yes',
|
||||
'open' => (int) Settings::value('..registerstatus') === 0 ? 'yes' : 'no',
|
||||
'open' => (int) Settings::settingValue('..registerstatus') === 0 ? 'yes' : 'no',
|
||||
],
|
||||
'searching' => [
|
||||
'search' => ['available' => 'yes', 'supportedParams' => 'q'],
|
||||
|
||||
@@ -282,7 +282,7 @@ class Forking extends \fork_daemon
|
||||
)
|
||||
);
|
||||
|
||||
return (int) Settings::value('..backfillthreads');
|
||||
return (int) Settings::settingValue('..backfillthreads');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -308,7 +308,7 @@ class Forking extends \fork_daemon
|
||||
$this->register_child_run([0 => $this, 1 => 'safeBackfillChildWorker']);
|
||||
|
||||
$run = $this->pdo->query("SELECT (SELECT value FROM tmux WHERE setting = 'backfill_qty') AS qty, (SELECT value FROM tmux WHERE setting = 'backfill') AS backfill, (SELECT value FROM tmux WHERE setting = 'backfill_order') AS orderby, (SELECT value FROM tmux WHERE setting = 'backfill_days') AS days, (SELECT value FROM settings WHERE setting = 'maxmssgs') AS maxmsgs");
|
||||
$threads = Settings::value('..backfillthreads');
|
||||
$threads = Settings::settingValue('..backfillthreads');
|
||||
|
||||
$orderby = 'ORDER BY a.last_record ASC';
|
||||
switch ((int) $run[0]['orderby']) {
|
||||
@@ -337,7 +337,7 @@ class Forking extends \fork_daemon
|
||||
if ($run[0]['days'] == 1) {
|
||||
$backfilldays = 'backfill_target';
|
||||
} elseif ($run[0]['days'] == 2) {
|
||||
$backfilldays = round(abs(strtotime(date('Y-m-d')) - strtotime(Settings::value('..safebackfilldate'))) / 86400);
|
||||
$backfilldays = round(abs(strtotime(date('Y-m-d')) - strtotime(Settings::settingValue('..safebackfilldate'))) / 86400);
|
||||
}
|
||||
|
||||
$data = $this->pdo->queryOneRow(
|
||||
@@ -414,7 +414,7 @@ class Forking extends \fork_daemon
|
||||
)
|
||||
);
|
||||
|
||||
return Settings::value('..binarythreads');
|
||||
return Settings::settingValue('..binarythreads');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -438,9 +438,9 @@ class Forking extends \fork_daemon
|
||||
{
|
||||
$this->register_child_run([0 => $this, 1 => 'safeBinariesChildWorker']);
|
||||
|
||||
$maxheaders = Settings::value('max.headers.iteration') ?: 1000000;
|
||||
$maxmssgs = Settings::value('..maxmssgs');
|
||||
$threads = Settings::value('..binarythreads');
|
||||
$maxheaders = Settings::settingValue('max.headers.iteration') ?: 1000000;
|
||||
$maxmssgs = Settings::settingValue('..maxmssgs');
|
||||
$threads = Settings::settingValue('..binarythreads');
|
||||
|
||||
$groups = $this->pdo->query('
|
||||
SELECT g.name AS groupname, g.last_record AS our_last,
|
||||
@@ -512,8 +512,8 @@ class Forking extends \fork_daemon
|
||||
{
|
||||
$this->register_child_run([0 => $this, 1 => 'fixRelNamesChildWorker']);
|
||||
|
||||
$threads = (int) Settings::value('..fixnamethreads');
|
||||
$maxperrun = (int) Settings::value('..fixnamesperrun');
|
||||
$threads = (int) Settings::settingValue('..fixnamethreads');
|
||||
$maxperrun = (int) Settings::settingValue('..fixnamesperrun');
|
||||
|
||||
if ($threads > 16) {
|
||||
$threads = 16;
|
||||
@@ -594,7 +594,7 @@ class Forking extends \fork_daemon
|
||||
}
|
||||
}
|
||||
|
||||
return (int) Settings::value('..releasethreads');
|
||||
return (int) Settings::settingValue('..releasethreads');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -651,10 +651,10 @@ class Forking extends \fork_daemon
|
||||
private function checkProcessAdditional()
|
||||
{
|
||||
$this->ppAddMinSize =
|
||||
(Settings::value('..minsizetopostprocess') !== '') ? (int) Settings::value('..minsizetopostprocess') : 1;
|
||||
(Settings::settingValue('..minsizetopostprocess') !== '') ? (int) Settings::settingValue('..minsizetopostprocess') : 1;
|
||||
$this->ppAddMinSize = ($this->ppAddMinSize > 0 ? ('AND r.size > '.($this->ppAddMinSize * 1048576)) : '');
|
||||
$this->ppAddMaxSize =
|
||||
(Settings::value('..maxsizetopostprocess') !== '') ? (int) Settings::value('..maxsizetopostprocess') : 100;
|
||||
(Settings::settingValue('..maxsizetopostprocess') !== '') ? (int) Settings::settingValue('..maxsizetopostprocess') : 100;
|
||||
$this->ppAddMaxSize = ($this->ppAddMaxSize > 0 ? ('AND r.size < '.($this->ppAddMaxSize * 1073741824)) : '');
|
||||
|
||||
return
|
||||
@@ -703,7 +703,7 @@ class Forking extends \fork_daemon
|
||||
$this->ppAddMinSize
|
||||
)
|
||||
);
|
||||
$maxProcesses = (int) Settings::value('..postthreads');
|
||||
$maxProcesses = (int) Settings::settingValue('..postthreads');
|
||||
}
|
||||
|
||||
return $maxProcesses;
|
||||
@@ -718,7 +718,7 @@ class Forking extends \fork_daemon
|
||||
*/
|
||||
private function checkProcessNfo()
|
||||
{
|
||||
if (Settings::value('..lookupnfo') == 1) {
|
||||
if (Settings::settingValue('..lookupnfo') == 1) {
|
||||
$this->nfoQueryString = Nfo::NfoQueryString($this->pdo);
|
||||
|
||||
return
|
||||
@@ -753,7 +753,7 @@ class Forking extends \fork_daemon
|
||||
$this->nfoQueryString
|
||||
)
|
||||
);
|
||||
$maxProcesses = (int) Settings::value('..nfothreads');
|
||||
$maxProcesses = (int) Settings::settingValue('..nfothreads');
|
||||
}
|
||||
|
||||
return $maxProcesses;
|
||||
@@ -766,7 +766,7 @@ class Forking extends \fork_daemon
|
||||
*/
|
||||
private function checkProcessMovies()
|
||||
{
|
||||
if (Settings::value('..lookupimdb') > 0) {
|
||||
if (Settings::settingValue('..lookupimdb') > 0) {
|
||||
return
|
||||
$this->pdo->queryOneRow(
|
||||
sprintf('
|
||||
@@ -778,7 +778,7 @@ class Forking extends \fork_daemon
|
||||
%s %s
|
||||
LIMIT 1',
|
||||
NZB::NZB_ADDED,
|
||||
((int) Settings::value('..lookupimdb') === 2 ? 'AND isrenamed = 1' : ''),
|
||||
((int) Settings::settingValue('..lookupimdb') === 2 ? 'AND isrenamed = 1' : ''),
|
||||
($this->ppRenamedOnly ? 'AND isrenamed = 1' : '')
|
||||
)
|
||||
) === false ? false : true;
|
||||
@@ -809,11 +809,11 @@ class Forking extends \fork_daemon
|
||||
LIMIT 16',
|
||||
($this->ppRenamedOnly ? 2 : 1),
|
||||
NZB::NZB_ADDED,
|
||||
((int) Settings::value('..lookupimdb') === 2 ? 'AND isrenamed = 1' : ''),
|
||||
((int) Settings::settingValue('..lookupimdb') === 2 ? 'AND isrenamed = 1' : ''),
|
||||
($this->ppRenamedOnly ? 'AND isrenamed = 1' : '')
|
||||
)
|
||||
);
|
||||
$maxProcesses = (int) Settings::value('..postthreadsnon');
|
||||
$maxProcesses = (int) Settings::settingValue('..postthreadsnon');
|
||||
}
|
||||
|
||||
return $maxProcesses;
|
||||
@@ -826,7 +826,7 @@ class Forking extends \fork_daemon
|
||||
*/
|
||||
private function checkProcessTV()
|
||||
{
|
||||
if (Settings::value('..lookuptvrage') > 0) {
|
||||
if (Settings::settingValue('..lookuptvrage') > 0) {
|
||||
return
|
||||
$this->pdo->queryOneRow(
|
||||
sprintf('
|
||||
@@ -839,7 +839,7 @@ class Forking extends \fork_daemon
|
||||
%s %s
|
||||
LIMIT 1',
|
||||
NZB::NZB_ADDED,
|
||||
(int) Settings::value('..lookuptvrage') === 2 ? 'AND isrenamed = 1' : '',
|
||||
(int) Settings::settingValue('..lookuptvrage') === 2 ? 'AND isrenamed = 1' : '',
|
||||
$this->ppRenamedOnly ? 'AND isrenamed = 1' : ''
|
||||
)
|
||||
) === false ? false : true;
|
||||
@@ -871,11 +871,11 @@ class Forking extends \fork_daemon
|
||||
LIMIT 16',
|
||||
($this->ppRenamedOnly ? 2 : 1),
|
||||
NZB::NZB_ADDED,
|
||||
(int) Settings::value('..lookuptvrage') === 2 ? 'AND isrenamed = 1' : '',
|
||||
(int) Settings::settingValue('..lookuptvrage') === 2 ? 'AND isrenamed = 1' : '',
|
||||
($this->ppRenamedOnly ? 'AND isrenamed = 1' : '')
|
||||
)
|
||||
);
|
||||
$maxProcesses = (int) Settings::value('..postthreadsnon');
|
||||
$maxProcesses = (int) Settings::settingValue('..postthreadsnon');
|
||||
}
|
||||
|
||||
return $maxProcesses;
|
||||
@@ -891,7 +891,7 @@ class Forking extends \fork_daemon
|
||||
$sharing = $this->pdo->queryOneRow('SELECT enabled FROM sharing');
|
||||
if ($sharing !== false && $sharing['enabled'] == 1) {
|
||||
$nntp = new NNTP(['Settings' => $this->pdo]);
|
||||
if ((int) (Settings::value('..alternate_nntp') === 1 ? $nntp->doConnect(true, true) : $nntp->doConnect()) === true) {
|
||||
if ((int) (Settings::settingValue('..alternate_nntp') === 1 ? $nntp->doConnect(true, true) : $nntp->doConnect()) === true) {
|
||||
(new PostProcess(['Settings' => $this->pdo, 'ColorCLI' => $this->_colorCLI]))->processSharing($nntp);
|
||||
}
|
||||
|
||||
@@ -943,7 +943,7 @@ class Forking extends \fork_daemon
|
||||
)
|
||||
);
|
||||
|
||||
return (int) Settings::value('..reqidthreads');
|
||||
return (int) Settings::settingValue('..reqidthreads');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -970,7 +970,7 @@ class Forking extends \fork_daemon
|
||||
$this->register_child_run([0 => $this, 1 => 'updatePerGroupChildWorker']);
|
||||
$this->work = $this->pdo->query('SELECT id FROM groups WHERE (active = 1 OR backfill = 1)');
|
||||
|
||||
return (int) Settings::value('..releasethreads');
|
||||
return (int) Settings::settingValue('..releasethreads');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -125,8 +125,8 @@ class PostProcess
|
||||
$this->releaseFiles = (($options['ReleaseFiles'] instanceof ReleaseFiles) ? $options['ReleaseFiles'] : new ReleaseFiles($this->pdo));
|
||||
|
||||
// Site settings.
|
||||
$this->addpar2 = (int) Settings::value('..addpar2') !== 0;
|
||||
$this->alternateNNTP = (int) Settings::value('..alternate_nntp') === 1;
|
||||
$this->addpar2 = (int) Settings::settingValue('..addpar2') !== 0;
|
||||
$this->alternateNNTP = (int) Settings::settingValue('..alternate_nntp') === 1;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -160,7 +160,7 @@ class PostProcess
|
||||
*/
|
||||
public function processAnime(): void
|
||||
{
|
||||
if ((int) Settings::value('..lookupanidb') !== 0) {
|
||||
if ((int) Settings::settingValue('..lookupanidb') !== 0) {
|
||||
(new AniDB(['Echo' => $this->echooutput, 'Settings' => $this->pdo]))->processAnimeReleases();
|
||||
}
|
||||
}
|
||||
@@ -173,7 +173,7 @@ class PostProcess
|
||||
*/
|
||||
public function processBooks(): void
|
||||
{
|
||||
if ((int) Settings::value('..lookupbooks') !== 0) {
|
||||
if ((int) Settings::settingValue('..lookupbooks') !== 0) {
|
||||
(new Books(['Echo' => $this->echooutput, 'Settings' => $this->pdo]))->processBookReleases();
|
||||
}
|
||||
}
|
||||
@@ -185,7 +185,7 @@ class PostProcess
|
||||
*/
|
||||
public function processConsoles(): void
|
||||
{
|
||||
if ((int) Settings::value('..lookupgames') !== 0) {
|
||||
if ((int) Settings::settingValue('..lookupgames') !== 0) {
|
||||
(new Console(['Settings' => $this->pdo, 'Echo' => $this->echooutput]))->processConsoleReleases();
|
||||
}
|
||||
}
|
||||
@@ -198,7 +198,7 @@ class PostProcess
|
||||
*/
|
||||
public function processGames(): void
|
||||
{
|
||||
if ((int) Settings::value('..lookupgames') !== 0) {
|
||||
if ((int) Settings::settingValue('..lookupgames') !== 0) {
|
||||
(new Games(['Echo' => $this->echooutput, 'Settings' => $this->pdo]))->processGamesReleases();
|
||||
}
|
||||
}
|
||||
@@ -216,7 +216,7 @@ class PostProcess
|
||||
*/
|
||||
public function processMovies($groupID = '', $guidChar = '', $processMovies = ''): void
|
||||
{
|
||||
$processMovies = (is_numeric($processMovies) ? $processMovies : Settings::value('..lookupimdb'));
|
||||
$processMovies = (is_numeric($processMovies) ? $processMovies : Settings::settingValue('..lookupimdb'));
|
||||
if ($processMovies > 0) {
|
||||
(new Movie(['Echo' => $this->echooutput, 'Settings' => $this->pdo]))->processMovieReleases($groupID, $guidChar, $processMovies);
|
||||
}
|
||||
@@ -229,7 +229,7 @@ class PostProcess
|
||||
*/
|
||||
public function processMusic(): void
|
||||
{
|
||||
if ((int) Settings::value('..lookupmusic') !== 0) {
|
||||
if ((int) Settings::settingValue('..lookupmusic') !== 0) {
|
||||
(new Music(['Echo' => $this->echooutput, 'Settings' => $this->pdo]))->processMusicReleases();
|
||||
}
|
||||
}
|
||||
@@ -246,8 +246,8 @@ class PostProcess
|
||||
*/
|
||||
public function processNfos(&$nntp, $groupID = '', $guidChar = ''): void
|
||||
{
|
||||
if ((int) Settings::value('..lookupnfo') === 1) {
|
||||
$this->Nfo->processNfoFiles($nntp, $groupID, $guidChar, (int) Settings::value('..lookupimdb'), (int) Settings::value('..lookuptvrage'));
|
||||
if ((int) Settings::settingValue('..lookupnfo') === 1) {
|
||||
$this->Nfo->processNfoFiles($nntp, $groupID, $guidChar, (int) Settings::settingValue('..lookupimdb'), (int) Settings::settingValue('..lookuptvrage'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -274,7 +274,7 @@ class PostProcess
|
||||
*/
|
||||
public function processTv($groupID = '', $guidChar = '', $processTV = ''): void
|
||||
{
|
||||
$processTV = (is_numeric($processTV) ? $processTV : Settings::value('..lookuptvrage'));
|
||||
$processTV = (is_numeric($processTV) ? $processTV : Settings::settingValue('..lookuptvrage'));
|
||||
if ($processTV > 0) {
|
||||
(new TVDB(['Echo' => $this->echooutput, 'Settings' => $this->pdo]))->processSite($groupID, $guidChar, $processTV);
|
||||
(new TVMaze(['Echo' => $this->echooutput, 'Settings' => $this->pdo]))->processSite($groupID, $guidChar, $processTV);
|
||||
@@ -311,7 +311,7 @@ class PostProcess
|
||||
*/
|
||||
public function processXXX(): void
|
||||
{
|
||||
if ((int) Settings::value('..lookupxxx') === 1) {
|
||||
if ((int) Settings::settingValue('..lookupxxx') === 1) {
|
||||
(new XXX(['Echo' => $this->echooutput, 'Settings' => $this->pdo]))->processXXXReleases();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,20 +145,20 @@ class ProcessReleases
|
||||
$this->releases = ($options['Releases'] instanceof Releases ? $options['Releases'] : new Releases(['Settings' => $this->pdo, 'Groups' => $this->groups]));
|
||||
$this->releaseImage = ($options['ReleaseImage'] instanceof ReleaseImage ? $options['ReleaseImage'] : new ReleaseImage($this->pdo));
|
||||
|
||||
$dummy = Settings::value('..delaytime');
|
||||
$dummy = Settings::settingValue('..delaytime');
|
||||
$this->collectionDelayTime = ($dummy !== '' ? (int) $dummy : 2);
|
||||
$dummy = Settings::value('..crossposttime');
|
||||
$dummy = Settings::settingValue('..crossposttime');
|
||||
$this->crossPostTime = ($dummy !== '' ? (int) $dummy : 2);
|
||||
$dummy = Settings::value('..maxnzbsprocessed');
|
||||
$dummy = Settings::settingValue('..maxnzbsprocessed');
|
||||
$this->releaseCreationLimit = ($dummy !== '' ? (int) $dummy : 1000);
|
||||
$dummy = Settings::value('..completionpercent');
|
||||
$dummy = Settings::settingValue('..completionpercent');
|
||||
$this->completion = ($dummy !== '' ? (int) $dummy : 0);
|
||||
$this->processRequestIDs = (int) Settings::value('lookup_reqids');
|
||||
$this->processRequestIDs = (int) Settings::settingValue('lookup_reqids');
|
||||
if ($this->completion > 100) {
|
||||
$this->completion = 100;
|
||||
echo ColorCLI::error(PHP_EOL.'You have an invalid setting for completion. It cannot be higher than 100.');
|
||||
}
|
||||
$this->collectionTimeout = (int) Settings::value('indexer.processing.collection_timeout');
|
||||
$this->collectionTimeout = (int) Settings::settingValue('indexer.processing.collection_timeout');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -188,10 +188,10 @@ class ProcessReleases
|
||||
ColorCLI::doEcho(ColorCLI::header('Starting release update process ('.date('Y-m-d H:i:s').')'), true);
|
||||
}
|
||||
|
||||
if (! file_exists(Settings::value('..nzbpath'))) {
|
||||
if (! file_exists(Settings::settingValue('..nzbpath'))) {
|
||||
if ($this->echoCLI) {
|
||||
ColorCLI::doEcho(
|
||||
ColorCLI::error('Bad or missing nzb directory - '.Settings::value('..nzbpath')),
|
||||
ColorCLI::error('Bad or missing nzb directory - '.Settings::settingValue('..nzbpath')),
|
||||
true
|
||||
);
|
||||
}
|
||||
@@ -419,9 +419,9 @@ class ProcessReleases
|
||||
|
||||
$minSizeDeleted = $maxSizeDeleted = $minFilesDeleted = 0;
|
||||
|
||||
$maxSizeSetting = Settings::value('.release.maxsizetoformrelease');
|
||||
$minSizeSetting = Settings::value('.release.minsizetoformrelease');
|
||||
$minFilesSetting = Settings::value('.release.minfilestoformrelease');
|
||||
$maxSizeSetting = Settings::settingValue('.release.maxsizetoformrelease');
|
||||
$minSizeSetting = Settings::settingValue('.release.minsizetoformrelease');
|
||||
$minFilesSetting = Settings::settingValue('.release.minfilestoformrelease');
|
||||
|
||||
foreach ($groupIDs as $grpID) {
|
||||
$groupMinSizeSetting = $groupMinFilesSetting = 0;
|
||||
@@ -841,7 +841,7 @@ class ProcessReleases
|
||||
*/
|
||||
public function processRequestIDs($groupID = '', $limit = 5000, $local = true): void
|
||||
{
|
||||
if ($local === false && (int) Settings::value('..lookup_reqids') === 0) {
|
||||
if ($local === false && (int) Settings::settingValue('..lookup_reqids') === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -972,7 +972,7 @@ class ProcessReleases
|
||||
ColorCLI::header('Process Releases -> Delete finished collections.'.PHP_EOL).
|
||||
ColorCLI::primary(sprintf(
|
||||
'Deleting collections/binaries/parts older than %d hours.',
|
||||
Settings::value('..partretentionhours')
|
||||
Settings::settingValue('..partretentionhours')
|
||||
));
|
||||
}
|
||||
|
||||
@@ -987,7 +987,7 @@ class ProcessReleases
|
||||
$this->tables['cname'],
|
||||
$this->tables['bname'],
|
||||
$this->tables['pname'],
|
||||
Settings::value('..partretentionhours')
|
||||
Settings::settingValue('..partretentionhours')
|
||||
)
|
||||
);
|
||||
|
||||
@@ -1183,9 +1183,9 @@ class ProcessReleases
|
||||
|
||||
$groupID === '' ? $groupIDs = $this->groups->getActiveIDs() : $groupIDs = [['id' => $groupID]];
|
||||
|
||||
$maxSizeSetting = Settings::value('.release.maxsizetoformrelease');
|
||||
$minSizeSetting = Settings::value('.release.minsizetoformrelease');
|
||||
$minFilesSetting = Settings::value('.release.minfilestoformrelease');
|
||||
$maxSizeSetting = Settings::settingValue('.release.maxsizetoformrelease');
|
||||
$minSizeSetting = Settings::settingValue('.release.minsizetoformrelease');
|
||||
$minFilesSetting = Settings::settingValue('.release.minfilestoformrelease');
|
||||
|
||||
foreach ($groupIDs as $grpID) {
|
||||
$releases = $this->pdo->queryDirect(
|
||||
@@ -1283,11 +1283,11 @@ class ProcessReleases
|
||||
}
|
||||
|
||||
// Releases past retention.
|
||||
if ((int) Settings::value('..releaseretentiondays') !== 0) {
|
||||
if ((int) Settings::settingValue('..releaseretentiondays') !== 0) {
|
||||
$releases = $this->pdo->queryDirect(
|
||||
sprintf(
|
||||
'SELECT SQL_NO_CACHE id, guid FROM releases WHERE postdate < (NOW() - INTERVAL %d DAY)',
|
||||
(int) Settings::value('..releaseretentiondays')
|
||||
(int) Settings::settingValue('..releaseretentiondays')
|
||||
)
|
||||
);
|
||||
if ($releases instanceof \Traversable) {
|
||||
@@ -1299,7 +1299,7 @@ class ProcessReleases
|
||||
}
|
||||
|
||||
// Passworded releases.
|
||||
if ((int) Settings::value('..deletepasswordedrelease') === 1) {
|
||||
if ((int) Settings::settingValue('..deletepasswordedrelease') === 1) {
|
||||
$releases = $this->pdo->queryDirect(
|
||||
sprintf(
|
||||
'SELECT SQL_NO_CACHE id, guid FROM releases WHERE passwordstatus = %d',
|
||||
@@ -1315,7 +1315,7 @@ class ProcessReleases
|
||||
}
|
||||
|
||||
// Possibly passworded releases.
|
||||
if ((int) Settings::value('..deletepossiblerelease') === 1) {
|
||||
if ((int) Settings::settingValue('..deletepossiblerelease') === 1) {
|
||||
$releases = $this->pdo->queryDirect(
|
||||
sprintf(
|
||||
'SELECT SQL_NO_CACHE id, guid FROM releases WHERE passwordstatus = %d',
|
||||
@@ -1434,7 +1434,7 @@ class ProcessReleases
|
||||
}
|
||||
|
||||
// Misc other.
|
||||
if (Settings::value('..miscotherretentionhours') > 0) {
|
||||
if (Settings::settingValue('..miscotherretentionhours') > 0) {
|
||||
$releases = $this->pdo->queryDirect(
|
||||
sprintf('
|
||||
SELECT SQL_NO_CACHE id, guid
|
||||
@@ -1442,7 +1442,7 @@ class ProcessReleases
|
||||
WHERE categories_id = %d
|
||||
AND adddate <= NOW() - INTERVAL %d HOUR',
|
||||
Category::OTHER_MISC,
|
||||
(int) Settings::value('..miscotherretentionhours')
|
||||
(int) Settings::settingValue('..miscotherretentionhours')
|
||||
)
|
||||
);
|
||||
if ($releases instanceof \Traversable) {
|
||||
@@ -1454,7 +1454,7 @@ class ProcessReleases
|
||||
}
|
||||
|
||||
// Misc hashed.
|
||||
if ((int) Settings::value('..mischashedretentionhours') > 0) {
|
||||
if ((int) Settings::settingValue('..mischashedretentionhours') > 0) {
|
||||
$releases = $this->pdo->queryDirect(
|
||||
sprintf('
|
||||
SELECT SQL_NO_CACHE id, guid
|
||||
@@ -1462,7 +1462,7 @@ class ProcessReleases
|
||||
WHERE categories_id = %d
|
||||
AND adddate <= NOW() - INTERVAL %d HOUR',
|
||||
Category::OTHER_HASHED,
|
||||
(int) Settings::value('..mischashedretentionhours')
|
||||
(int) Settings::settingValue('..mischashedretentionhours')
|
||||
)
|
||||
);
|
||||
if ($releases instanceof \Traversable) {
|
||||
@@ -1770,7 +1770,7 @@ class ProcessReleases
|
||||
*/
|
||||
private function processStuckCollections($where): void
|
||||
{
|
||||
$lastRun = Settings::value('indexer.processing.last_run_time');
|
||||
$lastRun = Settings::settingValue('indexer.processing.last_run_time');
|
||||
|
||||
$obj = $this->pdo->queryExec(
|
||||
sprintf("
|
||||
|
||||
@@ -55,7 +55,7 @@ class AniDB
|
||||
$this->echooutput = ($options['Echo'] && NN_ECHOCLI);
|
||||
$this->pdo = ($options['Settings'] instanceof DB ? $options['Settings'] : new DB());
|
||||
|
||||
$qty = Settings::value('..maxanidbprocessed');
|
||||
$qty = Settings::settingValue('..maxanidbprocessed');
|
||||
$this->aniqty = $qty ?? 100;
|
||||
|
||||
$this->status = 'NULL';
|
||||
|
||||
@@ -416,32 +416,32 @@ class ProcessAdditional
|
||||
$this->_nfo = ($options['Nfo'] instanceof Nfo ? $options['Nfo'] : new Nfo(['Echo' => $this->_echoCLI, 'Settings' => $this->pdo]));
|
||||
$this->sphinx = ($options['SphinxSearch'] instanceof SphinxSearch ? $options['SphinxSearch'] : new SphinxSearch());
|
||||
|
||||
$this->_innerFileBlacklist = (Settings::value('indexer.ppa.innerfileblacklist') == '' ? false : Settings::value('indexer.ppa.innerfileblacklist'));
|
||||
$this->_maxNestedLevels = (Settings::value('..maxnestedlevels') == 0 ? 3 : Settings::value('..maxnestedlevels'));
|
||||
$this->_extractUsingRarInfo = (Settings::value('..extractusingrarinfo') == 0 ? false : true);
|
||||
$this->_fetchLastFiles = (Settings::value('archive.fetch.end') == 0 ? false : true);
|
||||
$this->_innerFileBlacklist = (Settings::settingValue('indexer.ppa.innerfileblacklist') == '' ? false : Settings::settingValue('indexer.ppa.innerfileblacklist'));
|
||||
$this->_maxNestedLevels = (Settings::settingValue('..maxnestedlevels') == 0 ? 3 : Settings::settingValue('..maxnestedlevels'));
|
||||
$this->_extractUsingRarInfo = (Settings::settingValue('..extractusingrarinfo') == 0 ? false : true);
|
||||
$this->_fetchLastFiles = (Settings::settingValue('archive.fetch.end') == 0 ? false : true);
|
||||
|
||||
$this->_7zipPath = false;
|
||||
$this->_unrarPath = false;
|
||||
|
||||
// Pass the binary extractors to ArchiveInfo.
|
||||
$clients = [];
|
||||
if (Settings::value('apps..unrarpath') != '') {
|
||||
$clients += [ArchiveInfo::TYPE_RAR => Settings::value('apps..unrarpath')];
|
||||
$this->_unrarPath = Settings::value('apps..unrarpath');
|
||||
if (Settings::settingValue('apps..unrarpath') != '') {
|
||||
$clients += [ArchiveInfo::TYPE_RAR => Settings::settingValue('apps..unrarpath')];
|
||||
$this->_unrarPath = Settings::settingValue('apps..unrarpath');
|
||||
}
|
||||
if (Settings::value('apps..7zippath') != '') {
|
||||
$clients += [ArchiveInfo::TYPE_ZIP => Settings::value('apps..7zippath')];
|
||||
$this->_7zipPath = Settings::value('apps..7zippath');
|
||||
if (Settings::settingValue('apps..7zippath') != '') {
|
||||
$clients += [ArchiveInfo::TYPE_ZIP => Settings::settingValue('apps..7zippath')];
|
||||
$this->_7zipPath = Settings::settingValue('apps..7zippath');
|
||||
}
|
||||
$this->_archiveInfo->setExternalClients($clients);
|
||||
|
||||
$this->_killString = '"';
|
||||
if (Settings::value('apps..timeoutpath') != '' && Settings::value('..timeoutseconds') > 0) {
|
||||
if (Settings::settingValue('apps..timeoutpath') != '' && Settings::settingValue('..timeoutseconds') > 0) {
|
||||
$this->_killString = (
|
||||
'"'.Settings::value('apps..timeoutpath').
|
||||
'"'.Settings::settingValue('apps..timeoutpath').
|
||||
'" --foreground --signal=KILL '.
|
||||
Settings::value('..timeoutseconds').' "'
|
||||
Settings::settingValue('..timeoutseconds').' "'
|
||||
);
|
||||
}
|
||||
|
||||
@@ -449,52 +449,52 @@ class ProcessAdditional
|
||||
|
||||
// Maximum amount of releases to fetch per run.
|
||||
$this->_queryLimit =
|
||||
(Settings::value('..maxaddprocessed') != '') ? (int) Settings::value('..maxaddprocessed') : 25;
|
||||
(Settings::settingValue('..maxaddprocessed') != '') ? (int) Settings::settingValue('..maxaddprocessed') : 25;
|
||||
|
||||
// Maximum message ID's to download per file type in the NZB (video, jpg, etc).
|
||||
$this->_segmentsToDownload =
|
||||
(Settings::value('..segmentstodownload') != '') ? (int) Settings::value('..segmentstodownload') : 2;
|
||||
(Settings::settingValue('..segmentstodownload') != '') ? (int) Settings::settingValue('..segmentstodownload') : 2;
|
||||
|
||||
// Maximum message ID's to download for a RAR file.
|
||||
$this->_maximumRarSegments =
|
||||
(Settings::value('..maxpartsprocessed') != '') ? (int) Settings::value('..maxpartsprocessed') : 3;
|
||||
(Settings::settingValue('..maxpartsprocessed') != '') ? (int) Settings::settingValue('..maxpartsprocessed') : 3;
|
||||
|
||||
// Maximum RAR files to check for a password before stopping.
|
||||
$this->_maximumRarPasswordChecks =
|
||||
(Settings::value('..passchkattempts') != '') ? (int) Settings::value('..passchkattempts') : 1;
|
||||
(Settings::settingValue('..passchkattempts') != '') ? (int) Settings::settingValue('..passchkattempts') : 1;
|
||||
|
||||
$this->_maximumRarPasswordChecks = ($this->_maximumRarPasswordChecks < 1 ? 1 : $this->_maximumRarPasswordChecks);
|
||||
|
||||
// Maximum size of releases in GB.
|
||||
$this->_maxSize =
|
||||
(Settings::value('..maxsizetopostprocess') != '') ? (int) Settings::value('..maxsizetopostprocess') : 100;
|
||||
(Settings::settingValue('..maxsizetopostprocess') != '') ? (int) Settings::settingValue('..maxsizetopostprocess') : 100;
|
||||
$this->_maxSize = ($this->_maxSize > 0 ? ('AND r.size < '.($this->_maxSize * 1073741824)) : '');
|
||||
// Minimum size of releases in MB.
|
||||
$this->_minSize =
|
||||
(Settings::value('..minsizetopostprocess') != '') ? (int) Settings::value('..minsizetopostprocess') : 100;
|
||||
(Settings::settingValue('..minsizetopostprocess') != '') ? (int) Settings::settingValue('..minsizetopostprocess') : 100;
|
||||
$this->_minSize = ($this->_minSize > 0 ? ('AND r.size > '.($this->_minSize * 1048576)) : '');
|
||||
|
||||
// Use the alternate NNTP provider for downloading Message-ID's ?
|
||||
$this->_alternateNNTP = (Settings::value('..alternate_nntp') == 1 ? true : false);
|
||||
$this->_alternateNNTP = (Settings::settingValue('..alternate_nntp') == 1 ? true : false);
|
||||
|
||||
$this->_ffMPEGDuration = (Settings::value('..ffmpeg_duration') != '') ? (int) Settings::value('..ffmpeg_duration') : 5;
|
||||
$this->_ffMPEGDuration = (Settings::settingValue('..ffmpeg_duration') != '') ? (int) Settings::settingValue('..ffmpeg_duration') : 5;
|
||||
|
||||
$this->_addPAR2Files = (Settings::value('..addpar2') === '0') ? false : true;
|
||||
$this->_addPAR2Files = (Settings::settingValue('..addpar2') === '0') ? false : true;
|
||||
|
||||
if (! Settings::value('apps..ffmpegpath')) {
|
||||
if (! Settings::settingValue('apps..ffmpegpath')) {
|
||||
$this->_processAudioSample = $this->_processThumbnails = $this->_processVideo = false;
|
||||
} else {
|
||||
$this->_processAudioSample = (Settings::value('..saveaudiopreview') == 0) ? false : true;
|
||||
$this->_processThumbnails = (Settings::value('..processthumbnails') == 0 ? false : true);
|
||||
$this->_processVideo = (Settings::value('..processvideos') == 0) ? false : true;
|
||||
$this->_processAudioSample = (Settings::settingValue('..saveaudiopreview') == 0) ? false : true;
|
||||
$this->_processThumbnails = (Settings::settingValue('..processthumbnails') == 0 ? false : true);
|
||||
$this->_processVideo = (Settings::settingValue('..processvideos') == 0) ? false : true;
|
||||
}
|
||||
|
||||
$this->_processJPGSample = (Settings::value('..processjpg') == 0) ? false : true;
|
||||
$this->_processMediaInfo = (Settings::value('apps..mediainfopath') == '') ? false : true;
|
||||
$this->_processJPGSample = (Settings::settingValue('..processjpg') == 0) ? false : true;
|
||||
$this->_processMediaInfo = (Settings::settingValue('apps..mediainfopath') == '') ? false : true;
|
||||
$this->_processAudioInfo = $this->_processMediaInfo;
|
||||
$this->_processPasswords = (
|
||||
(((Settings::value('..checkpasswordedrar') == 0) ? false : true)) &&
|
||||
((Settings::value('apps..unrarpath') == '') ? false : true)
|
||||
(((Settings::settingValue('..checkpasswordedrar') == 0) ? false : true)) &&
|
||||
((Settings::settingValue('apps..unrarpath') == '') ? false : true)
|
||||
);
|
||||
|
||||
$this->_audioSavePath = NN_COVERS.'audiosample'.DS;
|
||||
@@ -558,7 +558,7 @@ class ProcessAdditional
|
||||
protected function _setMainTempPath(&$guidChar, &$groupID = '')
|
||||
{
|
||||
// Set up the temporary files folder location.
|
||||
$this->_mainTmpPath = (string) Settings::value('..tmpunrarpath');
|
||||
$this->_mainTmpPath = (string) Settings::settingValue('..tmpunrarpath');
|
||||
|
||||
// Check if it ends with a dir separator.
|
||||
if (! preg_match('/[\/\\\\]$/', $this->_mainTmpPath)) {
|
||||
@@ -1757,7 +1757,7 @@ class ProcessAdditional
|
||||
|
||||
// Get the media info for the file.
|
||||
$xmlArray = Utility::runCmd(
|
||||
$this->_killString.Settings::value('apps..mediainfopath').'" --Output=XML "'.$fileLocation.'"'
|
||||
$this->_killString.Settings::settingValue('apps..mediainfopath').'" --Output=XML "'.$fileLocation.'"'
|
||||
);
|
||||
if (is_array($xmlArray)) {
|
||||
|
||||
@@ -1842,7 +1842,7 @@ class ProcessAdditional
|
||||
// Create an audio sample.
|
||||
Utility::runCmd(
|
||||
$this->_killString.
|
||||
Settings::value('apps..ffmpegpath').
|
||||
Settings::settingValue('apps..ffmpegpath').
|
||||
'" -t 30 -i "'.
|
||||
$fileLocation.
|
||||
'" -acodec libvorbis -loglevel quiet -y "'.
|
||||
@@ -1945,7 +1945,7 @@ class ProcessAdditional
|
||||
// Get the real duration of the file.
|
||||
$time = Utility::runCmd(
|
||||
$this->_killString.
|
||||
Settings::value('apps..ffmpegpath').
|
||||
Settings::settingValue('apps..ffmpegpath').
|
||||
'" -i "'.$videoLocation.
|
||||
'" -vcodec copy -y 2>&1 "'.
|
||||
$tmpVideo.'"',
|
||||
@@ -1991,7 +1991,7 @@ class ProcessAdditional
|
||||
// Create the image.
|
||||
Utility::runCmd(
|
||||
$this->_killString.
|
||||
Settings::value('apps..ffmpegpath').
|
||||
Settings::settingValue('apps..ffmpegpath').
|
||||
'" -i "'.
|
||||
$fileLocation.
|
||||
'" -ss '.($time === '' ? '00:00:03.00' : $time).
|
||||
@@ -2084,7 +2084,7 @@ class ProcessAdditional
|
||||
// Try to get the sample (from the end instead of the start).
|
||||
Utility::runCmd(
|
||||
$this->_killString.
|
||||
Settings::value('apps..ffmpegpath').
|
||||
Settings::settingValue('apps..ffmpegpath').
|
||||
'" -i "'.
|
||||
$fileLocation.
|
||||
'" -ss '.$lowestLength.
|
||||
@@ -2101,7 +2101,7 @@ class ProcessAdditional
|
||||
// If longer than 60 or we could not get the video length, run the old way.
|
||||
Utility::runCmd(
|
||||
$this->_killString.
|
||||
Settings::value('apps..ffmpegpath').
|
||||
Settings::settingValue('apps..ffmpegpath').
|
||||
'" -i "'.
|
||||
$fileLocation.
|
||||
'" -vcodec libtheora -filter:v scale=320:-1 -t '.
|
||||
@@ -2176,7 +2176,7 @@ class ProcessAdditional
|
||||
|
||||
// Run media info on it.
|
||||
$xmlArray = Utility::runCmd(
|
||||
$this->_killString.Settings::value('apps..mediainfopath').'" --Output=XML "'.$fileLocation.'"'
|
||||
$this->_killString.Settings::settingValue('apps..mediainfopath').'" --Output=XML "'.$fileLocation.'"'
|
||||
);
|
||||
|
||||
// Check if we got it.
|
||||
|
||||
@@ -55,7 +55,7 @@ class TMDB extends TV
|
||||
public function __construct(array $options = [])
|
||||
{
|
||||
parent::__construct($options);
|
||||
$this->token = new ApiToken(Settings::value('APIs..tmdbkey'));
|
||||
$this->token = new ApiToken(Settings::settingValue('APIs..tmdbkey'));
|
||||
$this->client = new Client($this->token, [
|
||||
'cache' => [
|
||||
'enabled' => false,
|
||||
|
||||
@@ -62,7 +62,7 @@ abstract class TV extends Videos
|
||||
{
|
||||
parent::__construct($options);
|
||||
$this->catWhere = 'categories_id BETWEEN '.Category::TV_ROOT.' AND '.Category::TV_OTHER.' AND categories_id != '.Category::TV_ANIME;
|
||||
$this->tvqty = (Settings::value('..maxrageprocessed') != '') ? Settings::value('..maxrageprocessed') : 75;
|
||||
$this->tvqty = (Settings::settingValue('..maxrageprocessed') != '') ? Settings::settingValue('..maxrageprocessed') : 75;
|
||||
$this->imgSavePath = NN_COVERS.'tvshows'.DS;
|
||||
$this->siteColumns = ['tvdb', 'trakt', 'tvrage', 'tvmaze', 'imdb', 'tmdb'];
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ class TraktTv extends TV
|
||||
public function __construct(array $options = [])
|
||||
{
|
||||
parent::__construct($options);
|
||||
$this->clientId = Settings::value('APIs..trakttvclientkey');
|
||||
$this->clientId = Settings::settingValue('APIs..trakttvclientkey');
|
||||
$this->requestHeaders = [
|
||||
'Content-Type' => 'application/json',
|
||||
'trakt-api-version' => 2,
|
||||
|
||||
@@ -255,7 +255,7 @@ class Utility
|
||||
if (! ($pdo instanceof DB)) {
|
||||
$pdo = new DB();
|
||||
}
|
||||
$patch = Settings::value('..sqlpatch');
|
||||
$patch = Settings::settingValue('..sqlpatch');
|
||||
$ver = $versions->versions->sql->file;
|
||||
|
||||
// Check database patch version
|
||||
@@ -769,8 +769,8 @@ class Utility
|
||||
}
|
||||
}
|
||||
|
||||
$fromEmail = (PHPMAILER_FROM_EMAIL === '') ? Settings::value('site.main.email') : PHPMAILER_FROM_EMAIL;
|
||||
$fromName = (PHPMAILER_FROM_NAME === '') ? Settings::value('site.main.title') : PHPMAILER_FROM_NAME;
|
||||
$fromEmail = (PHPMAILER_FROM_EMAIL === '') ? Settings::settingValue('site.main.email') : PHPMAILER_FROM_EMAIL;
|
||||
$fromName = (PHPMAILER_FROM_NAME === '') ? Settings::settingValue('site.main.title') : PHPMAILER_FROM_NAME;
|
||||
$replyTo = (PHPMAILER_REPLYTO === '') ? $from : PHPMAILER_REPLYTO;
|
||||
|
||||
(PHPMAILER_BCC !== '') ? $mail->addBCC(PHPMAILER_BCC) : null;
|
||||
@@ -815,7 +815,7 @@ class Utility
|
||||
*/
|
||||
public static function fileInfo($path)
|
||||
{
|
||||
$magicPath = Settings::value('apps.indexer.magic_file_path');
|
||||
$magicPath = Settings::settingValue('apps.indexer.magic_file_path');
|
||||
if (self::hasCommand('file') && (! self::isWin() || ! empty($magicPath))) {
|
||||
$magicSwitch = empty($magicPath) ? '' : " -m $magicPath";
|
||||
$output = self::runCmd('file'.$magicSwitch.' -b "'.$path.'"');
|
||||
|
||||
@@ -157,7 +157,7 @@ $page->smarty->assign('book_reqids_ids', $book_reqids_ids);
|
||||
$page->smarty->assign('book_reqids_names', $book_reqids_names);
|
||||
|
||||
// convert from a list to an array as we need to use an array, but teh Settings table only saves strings
|
||||
$books_selected = explode(',', Settings::value('..book_reqids'));
|
||||
$books_selected = explode(',', Settings::settingValue('..book_reqids'));
|
||||
|
||||
// convert from a string array to an int array
|
||||
$books_selected = array_map(create_function('$value', 'return (int)$value;'), $books_selected);
|
||||
|
||||
@@ -71,7 +71,7 @@ switch ($action) {
|
||||
if ($_POST['role'] !== '') {
|
||||
$newRole = UserRole::query()->where('id', $_POST['role'])->value('name');
|
||||
$email = $_POST['email'] ?? $_GET['email'];
|
||||
Utility::sendEmail($email, 'Account changed', 'Your account role has been changed to '.$newRole, Settings::value('site.main.email'));
|
||||
Utility::sendEmail($email, 'Account changed', 'Your account role has been changed to '.$newRole, Settings::settingValue('site.main.email'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -65,8 +65,8 @@ switch ($page->page) {
|
||||
case 'xxx':
|
||||
case 'xxxmodal':
|
||||
// Don't show these pages if it's an API-only site.
|
||||
if (! $page->users->isLoggedIn() && (int) Settings::value('..registerstatus') === Settings::REGISTER_STATUS_API_ONLY) {
|
||||
header('Location: '.Settings::value('site.main.code'));
|
||||
if (! $page->users->isLoggedIn() && (int) Settings::settingValue('..registerstatus') === Settings::REGISTER_STATUS_API_ONLY) {
|
||||
header('Location: '.Settings::settingValue('site.main.code'));
|
||||
break;
|
||||
}
|
||||
case 'api':
|
||||
|
||||
@@ -148,7 +148,7 @@ class BasePage
|
||||
$this->smarty->assign('loggedin', 'false');
|
||||
}
|
||||
if ($this->theme === 'None') {
|
||||
$this->theme = Settings::value('site.main.style');
|
||||
$this->theme = Settings::settingValue('site.main.style');
|
||||
}
|
||||
|
||||
$this->smarty->assign('theme', $this->theme);
|
||||
@@ -331,13 +331,13 @@ class BasePage
|
||||
$this->userdata['rolecategoryexclusions'] = $this->users->getRoleCategoryExclusion($this->userdata['role']);
|
||||
|
||||
// Change the theme to user's selected theme if they selected one, else use the admin one.
|
||||
if ((int) Settings::value('site.main.userselstyle') === 1) {
|
||||
if ((int) Settings::settingValue('site.main.userselstyle') === 1) {
|
||||
$this->theme = $this->userdata['style'] ?? 'None';
|
||||
if ($this->theme === 'None') {
|
||||
$this->theme = Settings::value('site.main.style');
|
||||
$this->theme = Settings::settingValue('site.main.style');
|
||||
}
|
||||
} else {
|
||||
$this->theme = Settings::value('site.main.style');
|
||||
$this->theme = Settings::settingValue('site.main.style');
|
||||
}
|
||||
|
||||
// Update last login every 15 mins.
|
||||
@@ -403,6 +403,6 @@ class BasePage
|
||||
*/
|
||||
public function getSettingValue($setting): ?string
|
||||
{
|
||||
return Settings::value($setting);
|
||||
return Settings::settingValue($setting);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ class Page extends BasePage
|
||||
$this->smarty->assign('usefulcontentlist', $content->getForMenuByTypeAndRole(Contents::TYPEUSEFUL, $role));
|
||||
$this->smarty->assign('articlecontentlist', $content->getForMenuByTypeAndRole(Contents::TYPEARTICLE, $role));
|
||||
if ($this->userdata != null) {
|
||||
$this->smarty->assign('recentforumpostslist', $f->getPosts(Settings::value('..showrecentforumposts')));
|
||||
$this->smarty->assign('recentforumpostslist', $f->getPosts(Settings::settingValue('..showrecentforumposts')));
|
||||
}
|
||||
|
||||
$this->smarty->assign('main_menu', $this->smarty->fetch('mainmenu.tpl'));
|
||||
|
||||
@@ -8,7 +8,7 @@ if (! $page->users->isLoggedIn()) {
|
||||
|
||||
if (isset($_GET['action'], $_GET['emailto']) && (int) $_GET['action'] === 1) {
|
||||
$emailto = $_GET['emailto'];
|
||||
$ret = $page->users->sendInvite(Settings::value('site.main.title'), Settings::value('site.main.email'), $page->serverurl, $page->users->currentUserId(), $emailto);
|
||||
$ret = $page->users->sendInvite(Settings::settingValue('site.main.title'), Settings::settingValue('site.main.email'), $page->serverurl, $page->users->currentUserId(), $emailto);
|
||||
if (! $ret) {
|
||||
echo 'Invite not sent.';
|
||||
} else {
|
||||
|
||||
@@ -287,7 +287,7 @@ switch ($function) {
|
||||
case 'r':
|
||||
$api->verifyEmptyParameter('email');
|
||||
|
||||
if (! in_array((int) Settings::value('..registerstatus'), [Settings::REGISTER_STATUS_OPEN, Settings::REGISTER_STATUS_API_ONLY], false)) {
|
||||
if (! in_array((int) Settings::settingValue('..registerstatus'), [Settings::REGISTER_STATUS_OPEN, Settings::REGISTER_STATUS_API_ONLY], false)) {
|
||||
Utility::showApiError(104);
|
||||
}
|
||||
// Check email is valid format.
|
||||
|
||||
@@ -14,7 +14,7 @@ if (isset($_POST['useremail'])) {
|
||||
|
||||
if ($captcha->getError() === false) {
|
||||
$email = $_POST['useremail'];
|
||||
$mailto = Settings::value('site.main.email');
|
||||
$mailto = Settings::settingValue('site.main.email');
|
||||
$mailsubj = 'Contact Form Submitted';
|
||||
$mailhead = "From: $email\n";
|
||||
$mailbody = "Values submitted from contact form:\n";
|
||||
@@ -28,14 +28,14 @@ if (isset($_POST['useremail'])) {
|
||||
if (! preg_match("/\n/i", $_POST['useremail'])) {
|
||||
Utility::sendEmail($mailto, $mailsubj, $mailbody, $email);
|
||||
}
|
||||
$msg = "<h2 style='text-align:center;'>Thank you for getting in touch with ".Settings::value('site.main.title').'.</h2>';
|
||||
$msg = "<h2 style='text-align:center;'>Thank you for getting in touch with ".Settings::settingValue('site.main.title').'.</h2>';
|
||||
}
|
||||
}
|
||||
$page->smarty->assign('msg', $msg);
|
||||
$page->title = 'Contact '.Settings::value('site.main.title');
|
||||
$page->meta_title = 'Contact '.Settings::value('site.main.title');
|
||||
$page->title = 'Contact '.Settings::settingValue('site.main.title');
|
||||
$page->meta_title = 'Contact '.Settings::settingValue('site.main.title');
|
||||
$page->meta_keywords = 'contact us,contact,get in touch,email';
|
||||
$page->meta_description = 'Contact us at '.Settings::value('site.main.title').' and submit your feedback';
|
||||
$page->meta_description = 'Contact us at '.Settings::settingValue('site.main.title').' and submit your feedback';
|
||||
|
||||
$page->content = $page->smarty->fetch('contact.tpl');
|
||||
|
||||
|
||||
@@ -65,13 +65,13 @@ if (isset($_GET['id'])) {
|
||||
$mov['actors'] = $movie->makeFieldLinks($mov, 'actors');
|
||||
$mov['genre'] = $movie->makeFieldLinks($mov, 'genre');
|
||||
$mov['director'] = $movie->makeFieldLinks($mov, 'director');
|
||||
if (Settings::value('site.trailers.trailers_display')) {
|
||||
if (Settings::settingValue('site.trailers.trailers_display')) {
|
||||
$trailer = empty($mov['trailer']) || $mov['trailer'] === '' ? $movie->getTrailer($data['imdbid']) : $mov['trailer'];
|
||||
if ($trailer) {
|
||||
$mov['trailer'] = sprintf(
|
||||
'<iframe width=\"%d\" height=\"%d\" src=\"%s\"></iframe>',
|
||||
Settings::value('site.trailers.trailers_size_x'),
|
||||
Settings::value('site.trailers.trailers_size_y'),
|
||||
Settings::settingValue('site.trailers.trailers_size_x'),
|
||||
Settings::settingValue('site.trailers.trailers_size_y'),
|
||||
$trailer
|
||||
);
|
||||
}
|
||||
@@ -152,7 +152,7 @@ if (isset($_GET['id'])) {
|
||||
$page->smarty->assign('comments', $comments);
|
||||
$page->smarty->assign('searchname', $releases->getSimilarName($data['searchname']));
|
||||
$page->smarty->assign('similars', $similars);
|
||||
$page->smarty->assign('privateprofiles', (int) Settings::value('..privateprofiles') === 1);
|
||||
$page->smarty->assign('privateprofiles', (int) Settings::settingValue('..privateprofiles') === 1);
|
||||
$page->smarty->assign('failed', $failed);
|
||||
$page->smarty->assign('cpapi', $cpapi);
|
||||
$page->smarty->assign('cpurl', $cpurl);
|
||||
|
||||
@@ -8,7 +8,7 @@ if ($page->users->isLoggedIn()) {
|
||||
$uid = $page->users->currentUserId();
|
||||
$rssToken = $page->userdata['rsstoken'];
|
||||
} else {
|
||||
if ((int) Settings::value('..registerstatus') === Settings::REGISTER_STATUS_API_ONLY) {
|
||||
if ((int) Settings::settingValue('..registerstatus') === Settings::REGISTER_STATUS_API_ONLY) {
|
||||
if (! isset($_GET['rsstoken'])) {
|
||||
header('X-DNZB-RCode: 400');
|
||||
header('X-DNZB-RText: Bad request, please supply all parameters!');
|
||||
|
||||
@@ -33,10 +33,10 @@ switch ($action) {
|
||||
$page->users->updatePassword($ret['id'], $newpass);
|
||||
|
||||
$to = $ret['email'];
|
||||
$subject = Settings::value('site.main.title').' Password Reset';
|
||||
$subject = Settings::settingValue('site.main.title').' Password Reset';
|
||||
$contents = 'Your password has been reset to '.$newpass;
|
||||
$onscreen = 'Your password has been reset to <strong>'.$newpass.'</strong> and sent to your e-mail address.';
|
||||
Utility::sendEmail($to, $subject, $contents, Settings::value('site.main.email'));
|
||||
Utility::sendEmail($to, $subject, $contents, Settings::settingValue('site.main.email'));
|
||||
$page->smarty->assign('notice', $onscreen);
|
||||
$confirmed = true;
|
||||
break;
|
||||
@@ -69,9 +69,9 @@ switch ($action) {
|
||||
// Send the email
|
||||
//
|
||||
$to = $ret['email'];
|
||||
$subject = Settings::value('site.main.title').' Forgotten Password Request';
|
||||
$subject = Settings::settingValue('site.main.title').' Forgotten Password Request';
|
||||
$contents = 'Someone has requested a password reset for this email address. To reset the password use the following link. '.PHP_EOL.PHP_EOL.$page->serverurl.'forgottenpassword?action=reset&guid='.$guid;
|
||||
Utility::sendEmail($to, $subject, $contents, Settings::value('site.main.email'));
|
||||
Utility::sendEmail($to, $subject, $contents, Settings::settingValue('site.main.email'));
|
||||
$sent = true;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ $page->smarty->assign('pageroffset', $offset);
|
||||
$page->smarty->assign('pageritemsperpage', ITEMS_PER_PAGE);
|
||||
$page->smarty->assign('pagerquerybase', WWW_TOP.'/forum?offset=');
|
||||
$page->smarty->assign('pagerquerysuffix', '#results');
|
||||
$page->smarty->assign('privateprofiles', (int) Settings::value('..privateprofiles') === 1);
|
||||
$page->smarty->assign('privateprofiles', (int) Settings::settingValue('..privateprofiles') === 1);
|
||||
|
||||
$pager = $page->smarty->fetch('pager.tpl');
|
||||
$page->smarty->assign('pager', $pager);
|
||||
|
||||
@@ -27,7 +27,7 @@ $page->meta_keywords = 'view,forum,post,thread';
|
||||
$page->meta_description = 'View forum post';
|
||||
|
||||
$page->smarty->assign('results', $results);
|
||||
$page->smarty->assign('privateprofiles', (int) Settings::value('..privateprofiles') === 1);
|
||||
$page->smarty->assign('privateprofiles', (int) Settings::settingValue('..privateprofiles') === 1);
|
||||
|
||||
$page->content = $page->smarty->fetch('forumpost.tpl');
|
||||
$page->render();
|
||||
|
||||
@@ -16,7 +16,7 @@ if ($page->users->isLoggedIn()) {
|
||||
Utility::showApiError(101);
|
||||
}
|
||||
} else {
|
||||
if (Settings::value('..registerstatus') == Settings::REGISTER_STATUS_API_ONLY) {
|
||||
if (Settings::settingValue('..registerstatus') == Settings::REGISTER_STATUS_API_ONLY) {
|
||||
$res = $page->users->getById(0);
|
||||
} else {
|
||||
if ((! isset($_GET['i']) || ! isset($_GET['r']))) {
|
||||
@@ -44,8 +44,8 @@ if (isset($_GET['id'])) {
|
||||
// A hash of the users ip to record against the download
|
||||
//
|
||||
$hosthash = '';
|
||||
if (Settings::value('..storeuserips') == 1) {
|
||||
$hosthash = $page->users->getHostHash($_SERVER['REMOTE_ADDR'], Settings::value('..siteseed'));
|
||||
if (Settings::settingValue('..storeuserips') == 1) {
|
||||
$hosthash = $page->users->getHostHash($_SERVER['REMOTE_ADDR'], Settings::settingValue('..siteseed'));
|
||||
}
|
||||
|
||||
// Check download limit on user role.
|
||||
|
||||
@@ -63,7 +63,7 @@ switch ($action) {
|
||||
$categories = [];
|
||||
foreach ($tmpcats as $c) {
|
||||
// If MOVIE WEB-DL categorization is disabled, don't include it as an option
|
||||
if (Settings::value('indexer.categorise.catwebdl') == 0 && $c['id'] == Category::MOVIE_WEBDL) {
|
||||
if (Settings::settingValue('indexer.categorise.catwebdl') == 0 && $c['id'] == Category::MOVIE_WEBDL) {
|
||||
continue;
|
||||
}
|
||||
$categories[$c['id']] = $c['title'];
|
||||
|
||||
@@ -63,7 +63,7 @@ switch ($action) {
|
||||
$categories = [];
|
||||
foreach ($tmpcats as $c) {
|
||||
// If TV WEB-DL categorization is disabled, don't include it as an option
|
||||
if (Settings::value('indexer.categorise.catwebdl') == 0 && $c['id'] == Category::TV_WEBDL) {
|
||||
if (Settings::settingValue('indexer.categorise.catwebdl') == 0 && $c['id'] == Category::TV_WEBDL) {
|
||||
continue;
|
||||
}
|
||||
$categories[$c['id']] = $c['title'];
|
||||
|
||||
@@ -15,7 +15,7 @@ $nzbget = new NZBGet($page);
|
||||
|
||||
$userID = $page->users->currentUserId();
|
||||
$privileged = $page->users->isAdmin($userID) || $page->users->isModerator($userID);
|
||||
$privateProfiles = (int) Settings::value('..privateprofiles') === 1;
|
||||
$privateProfiles = (int) Settings::settingValue('..privateprofiles') === 1;
|
||||
$publicView = false;
|
||||
|
||||
if ($privileged || ! $privateProfiles) {
|
||||
|
||||
@@ -108,7 +108,7 @@ switch ($action) {
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if ((int) Settings::value('site.main.userselstyle') === 1) {
|
||||
if ((int) Settings::settingValue('site.main.userselstyle') === 1) {
|
||||
// Get the list of themes.
|
||||
$page->smarty->assign('themelist', Utility::getThemesList());
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ $page->smarty->assign('user', $userData);
|
||||
|
||||
$queueType = $error = '';
|
||||
$queue = null;
|
||||
switch (Settings::value('apps.sabnzbplus.integrationtype')) {
|
||||
switch (Settings::settingValue('apps.sabnzbplus.integrationtype')) {
|
||||
case SABnzbd::INTEGRATION_TYPE_NONE:
|
||||
if ($userData['queuetype'] === 2) {
|
||||
$queueType = 'NZBGet';
|
||||
|
||||
@@ -12,10 +12,10 @@ if ($page->users->isLoggedIn()) {
|
||||
$error = $userName = $password = $confirmPassword = $email = $inviteCode = $inviteCodeQuery = '';
|
||||
$showRegister = 1;
|
||||
|
||||
if ((int) Settings::value('..registerstatus') === Settings::REGISTER_STATUS_CLOSED || (int) Settings::value('..registerstatus') === Settings::REGISTER_STATUS_API_ONLY) {
|
||||
if ((int) Settings::settingValue('..registerstatus') === Settings::REGISTER_STATUS_CLOSED || (int) Settings::settingValue('..registerstatus') === Settings::REGISTER_STATUS_API_ONLY) {
|
||||
$error = 'Registrations are currently disabled.';
|
||||
$showRegister = 0;
|
||||
} elseif (Settings::value('..registerstatus') === Settings::REGISTER_STATUS_INVITE && (! isset($_REQUEST['invitecode']) || empty($_REQUEST['invitecode']))) {
|
||||
} elseif (Settings::settingValue('..registerstatus') === Settings::REGISTER_STATUS_INVITE && (! isset($_REQUEST['invitecode']) || empty($_REQUEST['invitecode']))) {
|
||||
$error = 'Registrations are currently invite only.';
|
||||
$showRegister = 0;
|
||||
}
|
||||
|
||||
@@ -13,10 +13,10 @@ $offset = 0;
|
||||
if (! isset($_GET['t']) && ! isset($_GET['show']) && ! isset($_GET['anidb'])) {
|
||||
// User has to either be logged in, or using rsskey.
|
||||
if (! $page->users->isLoggedIn()) {
|
||||
if (Settings::value('..registerstatus') != Settings::REGISTER_STATUS_API_ONLY) {
|
||||
if (Settings::settingValue('..registerstatus') != Settings::REGISTER_STATUS_API_ONLY) {
|
||||
Utility::showApiError(100);
|
||||
} else {
|
||||
header('Location: '.Settings::value('site.main.code'));
|
||||
header('Location: '.Settings::settingValue('site.main.code'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ if (! isset($_GET['t']) && ! isset($_GET['show']) && ! isset($_GET['anidb'])) {
|
||||
$rssToken = $page->userdata['rsstoken'];
|
||||
$maxRequests = $page->userdata['apirequests'];
|
||||
} else {
|
||||
if (Settings::value('..registerstatus') == Settings::REGISTER_STATUS_API_ONLY) {
|
||||
if (Settings::settingValue('..registerstatus') == Settings::REGISTER_STATUS_API_ONLY) {
|
||||
$res = $page->users->getById(0);
|
||||
} else {
|
||||
if (! isset($_GET['i']) || ! isset($_GET['r'])) {
|
||||
|
||||
@@ -71,10 +71,10 @@ $page->smarty->assign([
|
||||
if (isset($_GET['type']) && $_GET['type'] == 'xml') {
|
||||
echo $page->smarty->fetch('sitemap-xml.tpl');
|
||||
} else {
|
||||
$page->title = Settings::value('site.main.title').' site map';
|
||||
$page->meta_title = Settings::value('site.main.title').' site map';
|
||||
$page->title = Settings::settingValue('site.main.title').' site map';
|
||||
$page->meta_title = Settings::settingValue('site.main.title').' site map';
|
||||
$page->meta_keywords = 'sitemap,site,map';
|
||||
$page->meta_description = Settings::value('site.main.title').' site map shows all our pages.';
|
||||
$page->meta_description = Settings::settingValue('site.main.title').' site map shows all our pages.';
|
||||
$page->content = $page->smarty->fetch('sitemap.tpl');
|
||||
$page->render();
|
||||
}
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
use App\Models\Settings;
|
||||
|
||||
$page->title = 'Terms and Conditions';
|
||||
$page->meta_title = Settings::value('site.main.title').' - Terms and conditions';
|
||||
$page->meta_title = Settings::settingValue('site.main.title').' - Terms and conditions';
|
||||
$page->meta_keywords = 'terms,conditions';
|
||||
$page->meta_description = 'Terms and Conditions for '.Settings::value('site.main.title');
|
||||
$page->meta_description = 'Terms and Conditions for '.Settings::settingValue('site.main.title');
|
||||
|
||||
$page->content = $page->smarty->fetch('terms.tpl');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user