@@ -41,7 +41,7 @@ |
||
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | echo $pdo->log->primary('Patching database - ' . $dbname); |
| 44 | - exec("$PHP ${ROOTDIR}/cli/update_db.php true"); |
|
| 44 | + exec("$PHP ${rootdir}/cli/update_db.php true"); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | $tablecnt = 0; |
@@ -13,9 +13,9 @@ |
||
| 13 | 13 | } |
| 14 | 14 | $tableCount = $pdo->optimise(false, $argv[1], (isset($argv[2]) && $argv[2] === 'true'), (isset($argv[3]) ? [$argv[3]] : [])); |
| 15 | 15 | if ($tableCount > 0 && $argv[1] === 'analyze') { |
| 16 | - exit($pdo->log->header("Analyzed {$tableCount} MySQL tables successfully." . PHP_EOL)); |
|
| 16 | + exit($pdo->log->header("analyzed {$tableCount} MySQL tables successfully." . PHP_EOL)); |
|
| 17 | 17 | } else if ($tableCount > 0) { |
| 18 | - exit($pdo->log->header("Optimized {$tableCount} MySQL tables successfully." . PHP_EOL)); |
|
| 18 | + exit($pdo->log->header("optimized {$tableCount} MySQL tables successfully." . PHP_EOL)); |
|
| 19 | 19 | } else { |
| 20 | 20 | exit($pdo->log->notice('No MySQL tables to optimize.' . PHP_EOL)); |
| 21 | 21 | } |
@@ -31,7 +31,6 @@ |
||
| 31 | 31 | (isset($argv[2]) && is_numeric($argv[2]) && $argv[2] > 0 ? $argv[2] : $maxHeaders)); |
| 32 | 32 | } |
| 33 | 33 | } else { |
| 34 | - $binaries->updateAllGroups((isset($argv[1]) && is_numeric($argv[1]) && $argv[1] > 0 ? $argv[1] : |
|
| 35 | - $maxHeaders)); |
|
| 34 | + $binaries->updateAllGroups((isset($argv[1]) && is_numeric($argv[1]) && $argv[1] > 0 ? $argv[1] : $maxHeaders)); |
|
| 36 | 35 | } |
| 37 | 36 | ?> |
@@ -279,8 +279,7 @@ |
||
| 279 | 279 | $dMessage = |
| 280 | 280 | "We have hit the maximum we can backfill for " . |
| 281 | 281 | $groupName . |
| 282 | - ($this->_disableBackfillGroup ? ", disabling backfill on it." : |
|
| 283 | - ", skipping it, consider disabling backfill on it."); |
|
| 282 | + ($this->_disableBackfillGroup ? ", disabling backfill on it." : ", skipping it, consider disabling backfill on it."); |
|
| 284 | 283 | if ($this->_debug) { |
| 285 | 284 | $this->_debugging->log(get_class(), __FUNCTION__, $dMessage, Logger::LOG_NOTICE); |
| 286 | 285 | } |
@@ -678,11 +678,11 @@ |
||
| 678 | 678 | { |
| 679 | 679 | return preg_replace( |
| 680 | 680 | [ |
| 681 | - '/(\x03(?:\d{1,2}(?:,\d{1,2})?)?)/', // Color code |
|
| 682 | - '/\x02/', // Bold |
|
| 683 | - '/\x0F/', // Escaped |
|
| 684 | - '/\x16/', // Italic |
|
| 685 | - '/\x1F/', // Underline |
|
| 681 | + '/(\x03(?:\d{1,2}(?:,\d{1,2})?)?)/', // Color code |
|
| 682 | + '/\x02/', // Bold |
|
| 683 | + '/\x0F/', // Escaped |
|
| 684 | + '/\x16/', // Italic |
|
| 685 | + '/\x1F/', // Underline |
|
| 686 | 686 | '/\x12/' // Device control 2 |
| 687 | 687 | ], '', $text |
| 688 | 688 | ); |
@@ -597,7 +597,7 @@ |
||
| 597 | 597 | if (preg_match('/(a\s?r\s?t\s?i\s?s\s?t|l\s?a\s?b\s?e\s?l|mp3|e\s?n\s?c\s?o\s?d\s?e\s?r|rip|stereo|mono|single charts)/i', $nfo) |
| 598 | 598 | && !preg_match('/(\bavi\b|x\.?264|divx|mvk|xvid|install(?!ation)|Setup\.exe|unzip|unrar)/i', $nfo)) { |
| 599 | 599 | $artist = preg_split('/(?:a\s?r\s?t\s?i\s?s\s?t\s?s?\b[^ \.\:]*|a\s?u\s?t\s?h\s?o\s?r\s?s?\b[^ \.\:]*) *?(?!(?:[^\s\.\:\}\]\*\x{2500}-\x{3000}\?] ?){2,}?\b)(?:[\*\?\-\=\|\;\:\.\[\}\]\(\s\x{2500}-\x{3000}\?]+?)[\s\.\>\:\(\)\x{2500}-\x{3000}\?]((?!\:) ?\w.+)(?:\n|$|\s{3}|\.{3})/Uuim', $nfo, 0, PREG_SPLIT_DELIM_CAPTURE); |
| 600 | - if(isset($artist[1])) { |
|
| 600 | + if (isset($artist[1])) { |
|
| 601 | 601 | $title = preg_split('/(?:t+\s?i+\s?t+\s?l+\s?e+\b|a\s?l\s?b\s?u\s?m\b|r\s?e\s?l\s?e\s?a\s?s\s?e\b) *?(?!(?:[^\s\.\:\}\]\*\x{2500}-\x{3000}\?] ?){2,}?\b)(?:[\*\?\-\=\|\;\:\.\[\}\]\(\s\x{2500}-\x{3000}\?]+?)[\s\.\>\:\(\)\x{2500}-\x{3000}\?]((?!\:) ?\w.+)(?:\n|$|\s{3}|\.{3})/Uuim', $nfo, 0, PREG_SPLIT_DELIM_CAPTURE); |
| 602 | 602 | } |
| 603 | 603 | |
@@ -902,7 +902,7 @@ |
||
| 902 | 902 | // Try re-selecting the group. |
| 903 | 903 | $data = $nntp->selectGroup($group); |
| 904 | 904 | if ($this->isError($data)) { |
| 905 | - $message = "Code {$data->code}: {$data->message}\nSkipping group: {$group}"; |
|
| 905 | + $message = "code {$data->code}: {$data->message}\nSkipping group: {$group}"; |
|
| 906 | 906 | if ($this->_debugBool) { |
| 907 | 907 | $this->_debugging->log(get_class(), __FUNCTION__, $message, Logger::LOG_NOTICE); |
| 908 | 908 | } |
@@ -268,8 +268,7 @@ discard block |
||
| 268 | 268 | $decoded = ''; |
| 269 | 269 | $encodedLength = strlen($encoded); |
| 270 | 270 | for ($chr = 0; $chr < $encodedLength; $chr++) { |
| 271 | - $decoded .= ($encoded[$chr] !== '=' ? chr(ord($encoded[$chr]) - 42) : |
|
| 272 | - chr((ord($encoded[++$chr]) - 64) - 42)); |
|
| 271 | + $decoded .= ($encoded[$chr] !== '=' ? chr(ord($encoded[$chr]) - 42) : chr((ord($encoded[++$chr]) - 64) - 42)); |
|
| 273 | 272 | } |
| 274 | 273 | |
| 275 | 274 | // Make sure the decoded file size is the same as the size specified in the header. |
@@ -1200,8 +1199,7 @@ discard block |
||
| 1200 | 1199 | |
| 1201 | 1200 | $length = strlen($input); |
| 1202 | 1201 | for ($chr = 0; $chr < $length; $chr++) { |
| 1203 | - $data .= ($input[$chr] !== '=' ? chr(ord($input[$chr]) - 42) : |
|
| 1204 | - chr((ord($input[++$chr]) - 64) - 42)); |
|
| 1202 | + $data .= ($input[$chr] !== '=' ? chr(ord($input[$chr]) - 42) : chr((ord($input[++$chr]) - 64) - 42)); |
|
| 1205 | 1203 | } |
| 1206 | 1204 | } else { |
| 1207 | 1205 | if ($this->_yEncExtension) { |
@@ -1344,7 +1342,7 @@ discard block |
||
| 1344 | 1342 | // If there was an error selecting the group, return PEAR error object. |
| 1345 | 1343 | if ($this->isError($summary)) { |
| 1346 | 1344 | if ($this->_debugBool) { |
| 1347 | - $this->_debugging->log(__CLASS__,__FUNCTION__,$summary->getMessage(),Logger::LOG_WARNING); |
|
| 1345 | + $this->_debugging->log(__CLASS__, __FUNCTION__, $summary->getMessage(), Logger::LOG_WARNING); |
|
| 1348 | 1346 | } |
| 1349 | 1347 | |
| 1350 | 1348 | return $summary; |
@@ -981,8 +981,7 @@ |
||
| 981 | 981 | $iterator = 0; |
| 982 | 982 | |
| 983 | 983 | // Loop over strings of headers. |
| 984 | - foreach ($data as $key => &$header) |
|
| 985 | - { |
|
| 984 | + foreach ($data as $key => &$header) { |
|
| 986 | 985 | // Split the individual headers by tab. |
| 987 | 986 | $header = explode("\t", $header); |
| 988 | 987 | |
@@ -59,10 +59,10 @@ |
||
| 59 | 59 | } |
| 60 | 60 | // Table | Column |
| 61 | 61 | $this->audSavePath = nZEDb_COVERS . 'audiosample' . DS; // releases guid |
| 62 | - $this->imgSavePath = nZEDb_COVERS . 'preview' . DS; // releases guid |
|
| 63 | - $this->jpgSavePath = nZEDb_COVERS . 'sample' . DS; // releases guid |
|
| 64 | - $this->movieImgSavePath = nZEDb_COVERS . 'movies' . DS; // releases imdbid |
|
| 65 | - $this->vidSavePath = nZEDb_COVERS . 'video' . DS; // releases guid |
|
| 62 | + $this->imgSavePath = nZEDb_COVERS . 'preview' . DS; // releases guid |
|
| 63 | + $this->jpgSavePath = nZEDb_COVERS . 'sample' . DS; // releases guid |
|
| 64 | + $this->movieImgSavePath = nZEDb_COVERS . 'movies' . DS; // releases imdbid |
|
| 65 | + $this->vidSavePath = nZEDb_COVERS . 'video' . DS; // releases guid |
|
| 66 | 66 | |
| 67 | 67 | /* For reference. * |
| 68 | 68 | $this->anidbImgPath = nZEDb_COVERS . 'anime' . DS; // anidb anidbid | used in populate_anidb.php, not anidb.php |
@@ -338,10 +338,10 @@ discard block |
||
| 338 | 338 | */ |
| 339 | 339 | public function setCookie($host, $apikey, $priority, $apitype) |
| 340 | 340 | { |
| 341 | - setcookie('sabnzbd_' . $this->uid . '__host', $host, (time() + 2592000)); |
|
| 342 | - setcookie('sabnzbd_' . $this->uid . '__apikey', $apikey, (time() + 2592000)); |
|
| 341 | + setcookie('sabnzbd_' . $this->uid . '__host', $host, (time() + 2592000)); |
|
| 342 | + setcookie('sabnzbd_' . $this->uid . '__apikey', $apikey, (time() + 2592000)); |
|
| 343 | 343 | setcookie('sabnzbd_' . $this->uid . '__priority', $priority, (time() + 2592000)); |
| 344 | - setcookie('sabnzbd_' . $this->uid . '__apitype', $apitype, (time() + 2592000)); |
|
| 344 | + setcookie('sabnzbd_' . $this->uid . '__apitype', $apitype, (time() + 2592000)); |
|
| 345 | 345 | } |
| 346 | 346 | |
| 347 | 347 | /** |
@@ -349,9 +349,9 @@ discard block |
||
| 349 | 349 | */ |
| 350 | 350 | public function unsetCookie() |
| 351 | 351 | { |
| 352 | - setcookie('sabnzbd_' . $this->uid . '__host', '', (time() - 2592000)); |
|
| 353 | - setcookie('sabnzbd_' . $this->uid . '__apikey', '', (time() - 2592000)); |
|
| 352 | + setcookie('sabnzbd_' . $this->uid . '__host', '', (time() - 2592000)); |
|
| 353 | + setcookie('sabnzbd_' . $this->uid . '__apikey', '', (time() - 2592000)); |
|
| 354 | 354 | setcookie('sabnzbd_' . $this->uid . '__priority', '', (time() - 2592000)); |
| 355 | - setcookie('sabnzbd_' . $this->uid . '__apitype', '', (time() - 2592000)); |
|
| 355 | + setcookie('sabnzbd_' . $this->uid . '__apitype', '', (time() - 2592000)); |
|
| 356 | 356 | } |
| 357 | 357 | } |