diff --git a/.idea/dataSources.xml b/.idea/dataSources.xml
new file mode 100644
index 000000000..b7d457e17
--- /dev/null
+++ b/.idea/dataSources.xml
@@ -0,0 +1,19 @@
+
+
+
+
+ mysql
+ true
+ com.mysql.jdbc.Driver
+ jdbc:mysql://localhost:3306/newznab
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
new file mode 100644
index 000000000..c9da87f61
--- /dev/null
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml
new file mode 100644
index 000000000..3b312839b
--- /dev/null
+++ b/.idea/inspectionProfiles/profiles_settings.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Changelog b/Changelog
index edc4f36da..72c0313eb 100755
--- a/Changelog
+++ b/Changelog
@@ -1,3 +1,11 @@
+2015-10-15 DariusIII
+ Chg: Move all the configs into newznab/config/ folder.
+ Adjust patches and scripts to the new change, adapt patches for nn+ new releases table structure.
+2015-10-14 DariusIII
+ Chg: Change location of config files(located now in newznab/config folder) update scripts
+ to accomodate this change.
+2015-10-14 DariusIII
+ Fix: Possible fix for NULL nzb_guid values.
2015-10-13 DariusIII
Fix: Wrong edits, still working on commit management
2015-10-13 DariusIII
diff --git a/www/SPLClassLoader.php b/SPLClassLoader.php
old mode 100644
new mode 100755
similarity index 91%
rename from www/SPLClassLoader.php
rename to SPLClassLoader.php
index 77b17eec5..06ef6ba5a
--- a/www/SPLClassLoader.php
+++ b/SPLClassLoader.php
@@ -1,10 +1,9 @@
_namespace = $ns;
foreach ($includePath as &$path) {
@@ -105,7 +104,7 @@ class SplClassLoader
*/
public function register()
{
- spl_autoload_register(array($this, 'loadClass'));
+ spl_autoload_register([$this, 'loadClass']);
}
/**
@@ -113,7 +112,7 @@ class SplClassLoader
*/
public function unregister()
{
- spl_autoload_unregister(array($this, 'loadClass'));
+ spl_autoload_unregister([$this, 'loadClass']);
}
/**
@@ -126,7 +125,7 @@ class SplClassLoader
{
if (preg_match('#\\\#', $className)) {
// Looks like it's a namespaced class. just clean pathsepearator for now.
- $className = str_replace('#\\#', DS, $className);
+ $className = str_replace('#\\#', DIRECTORY_SEPARATOR, $className);
}
if ($className == 'Smarty') {
require_once SMARTY_DIR . 'Smarty.class.php';
@@ -135,7 +134,7 @@ class SplClassLoader
if ($this->_namespace === null || $this->_namespace . $this->_namespaceSeparator === substr($className, 0, strlen($this->_namespace . $this->_namespaceSeparator))) {
$fileName = '';
$namespace = '';
- if (strtolower(substr($className, 0, 7)) !== 'smarty_') {
+ if (strtolower(substr($className, 0, 6)) !== 'smarty') {
if (false !== ($lastNsPos = strripos($className, $this->_namespaceSeparator))) {
$namespace = substr($className, 0, $lastNsPos);
$className = substr($className, $lastNsPos + 1);
@@ -159,5 +158,3 @@ class SplClassLoader
}
}
}
-
-?>
\ No newline at end of file
diff --git a/autoloader.php b/autoloader.php
new file mode 100755
index 000000000..9250473b5
--- /dev/null
+++ b/autoloader.php
@@ -0,0 +1,38 @@
+.
+ * @author niel
+ * @copyright 2014 nZEDb
+ */
+
+spl_autoload_register(
+ function ($class) {
+ // Only continue if the class is in our namespace.
+ if (strpos($class, 'newznab\\') === 0) {
+ // Replace namespace separators with directory separators in the class name, append
+ // with .php
+ $file = NN_ROOT . str_replace('\\', DIRECTORY_SEPARATOR, $class) . '.php';
+
+ // if the file exists, require it
+ if (file_exists($file)) {
+ require_once $file;
+ }
+ }
+ }
+);
+
+?>
diff --git a/build/NewPatches.php b/build/NewPatches.php
index 10b10cbd7..2ca5dbcd3 100644
--- a/build/NewPatches.php
+++ b/build/NewPatches.php
@@ -19,7 +19,7 @@
* @copyright 2015 nZEDb
*/
-require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . 'www' . DIRECTORY_SEPARATOR . 'config.php';
+require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . 'indexer.php';
use newznab\db\DbUpdate;
use newznab\utility\Git;
diff --git a/cli/data/populate_anidb.php b/cli/data/populate_anidb.php
index 236ae91f6..6bba40218 100755
--- a/cli/data/populate_anidb.php
+++ b/cli/data/populate_anidb.php
@@ -2,7 +2,7 @@
/* This script is designed to gather all show data from anidb and add it to the anidb table for newznab, as part of this process we need the number of PI queries that can be executed max and whether or not we want debuging the first argument if unset will try to do the entire list (a good way to get banned), the second option can be blank or true for debugging.
* IF you are using this script then then you also want to edit anidb.php in www/lib and locate "604800" and replace it with 1204400, this will make sure it never tries to connect to anidb as this will fail
*/
-require_once dirname(__FILE__) . '/../../www/config.php';
+require_once realpath(dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'indexer.php');
use newznab\db\Settings;
use newznab\db\populate\AniDB;
diff --git a/cli/data/predb_import_daily_batch.php b/cli/data/predb_import_daily_batch.php
index 1483adf81..ede250d97 100644
--- a/cli/data/predb_import_daily_batch.php
+++ b/cli/data/predb_import_daily_batch.php
@@ -7,14 +7,7 @@
use newznab\db\Settings;
use newznab\utility\Utility;
-$config = dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'www' . DIRECTORY_SEPARATOR .
- 'config.php';
-
-
-if (!is_file($config)) {
- exit('Place this script in the testing folder of tmux.' . PHP_EOL);
-}
-require_once dirname(__FILE__) . '/../../www/config.php';
+require_once realpath(dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'indexer.php');
unset($config);
if (!Utility::isWin()) {
diff --git a/cli/update_db.php b/cli/update_db.php
index b53938184..8dc043ab4 100644
--- a/cli/update_db.php
+++ b/cli/update_db.php
@@ -18,8 +18,8 @@
* @author niel
* @copyright 2014 nZEDb
*/
-require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . 'www' . DIRECTORY_SEPARATOR . 'config.php';
-require_once SMARTY_DIR . 'Smarty.class.php';
+require_once realpath(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'indexer.php');
+require_once NN_LIBS . DIRECTORY_SEPARATOR . 'smarty' . DIRECTORY_SEPARATOR . 'Smarty.class.php';
use newznab\db\DbUpdate;
use newznab\utility\Utility;
diff --git a/cli/verify_permissions.php b/cli/verify_permissions.php
index 8135af61f..5c388a2ec 100644
--- a/cli/verify_permissions.php
+++ b/cli/verify_permissions.php
@@ -11,12 +11,7 @@ if (!isset($argv[1]) || $argv[1] !== 'yes') {
);
}
-$www_path = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'www' . DIRECTORY_SEPARATOR;
-if (is_file($www_path . 'config.php')) {
- require($www_path . 'config.php');
-} else {
- require($www_path . 'automated.config.php');
-}
+require_once realpath(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'indexer.php');
define('R', 1);
define('W', 2);
diff --git a/cli/versions.php b/cli/versions.php
index d5d90f383..072add7df 100644
--- a/cli/versions.php
+++ b/cli/versions.php
@@ -18,7 +18,7 @@
* @author niel
* @copyright 2014 nZEDb
*/
-require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . 'www' . DIRECTORY_SEPARATOR . 'config.php';
+require_once realpath(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'indexer.php');
use newznab\utility\Utility;
use newznab\utility\Versions;
diff --git a/constants.php b/constants.php
new file mode 100755
index 000000000..467428af6
--- /dev/null
+++ b/constants.php
@@ -0,0 +1,51 @@
+.
* @author niel
- * @copyright 2014 nZEDb
+ * @copyright 2015 nZEDb
*/
+require_once 'constants.php';
+require_once 'autoloader.php';
+require_once 'libs/autoloader.php';
-require_once NN_CORE . 'autoloader.php';
-require_once NN_LIB . 'autoloader.php';
-require_once NN_LIBS . 'autoloader.php';
+use newznab\config\Configure;
+use newznab\utility\Utility;
-require_once NN_WWW . '/SPLClassLoader.php';
+$config = new Configure('indexer');
-$paths = [NN_ROOT, NN_WWW . 'pages', SMARTY_DIR, SMARTY_DIR . 'plugins', SMARTY_DIR . 'sysplugins'];
-$classLoader = new \SplClassLoader(null, $paths);
-$classLoader->register();
+define('HAS_WHICH', Utility::hasWhich() ? true : false);
-?>
\ No newline at end of file
+?>
diff --git a/initialise.php b/initialise.php
new file mode 100755
index 000000000..5dadf98c9
--- /dev/null
+++ b/initialise.php
@@ -0,0 +1,8 @@
+register();
+
+?>
diff --git a/misc/testing/IRCScraper/.gitignore b/misc/IRCScraper/.gitignore
similarity index 100%
rename from misc/testing/IRCScraper/.gitignore
rename to misc/IRCScraper/.gitignore
diff --git a/misc/testing/IRCScraper/README.txt b/misc/IRCScraper/README.txt
similarity index 100%
rename from misc/testing/IRCScraper/README.txt
rename to misc/IRCScraper/README.txt
diff --git a/misc/testing/IRCScraper/scrape.php b/misc/IRCScraper/scrape.php
similarity index 60%
rename from misc/testing/IRCScraper/scrape.php
rename to misc/IRCScraper/scrape.php
index e6176c02c..a7652aa2c 100644
--- a/misc/testing/IRCScraper/scrape.php
+++ b/misc/IRCScraper/scrape.php
@@ -1,13 +1,28 @@
optimizeRTIndex($argv[1]);
+(new SphinxSearch())->optimizeRTIndex($argv[1]);
diff --git a/misc/sphinxsearch/populate_rt_indexes.php b/misc/sphinxsearch/populate_rt_indexes.php
index 0025574eb..2e4347cf2 100644
--- a/misc/sphinxsearch/populate_rt_indexes.php
+++ b/misc/sphinxsearch/populate_rt_indexes.php
@@ -1,7 +1,8 @@
log->error('Error, NN_RELEASE_SEARCH_TYPE in www/settings.php must be set to SPHINX to optimize for Sphinx!' . PHP_EOL);
diff --git a/misc/testing/DB/change_USP_provider.php b/misc/testing/DB/change_USP_provider.php
index 7d4d6982f..90c1d0982 100644
--- a/misc/testing/DB/change_USP_provider.php
+++ b/misc/testing/DB/change_USP_provider.php
@@ -1,7 +1,9 @@
$pdo]);
+ $nntp = new NNTP(['Settings' => $pdo]);
if ($nntp->doConnect() !== true) {
return;
}
@@ -77,7 +79,7 @@ function daytopost($nntp, $group, $days, $debug = true, $bfcheck = true)
}
if (!isset($nntp)) {
- $nntp = new \NNTP(['Settings' => $pdo]);
+ $nntp = new NNTP(['Settings' => $pdo]);
if ($nntp->doConnect(false) !== true) {
return;
}
@@ -85,7 +87,7 @@ function daytopost($nntp, $group, $days, $debug = true, $bfcheck = true)
$st = true;
}
- $binaries = new \Binaries(['NNTP' => $nntp, 'Settings' => $pdo]);
+ $binaries = new Binaries(['NNTP' => $nntp, 'Settings' => $pdo]);
$data = $nntp->selectGroup($group);
if ($nntp->isError($data)) {
diff --git a/misc/testing/DB/convert_mysql_tables.php b/misc/testing/DB/convert_mysql_tables.php
index 950272ba4..8944f463c 100644
--- a/misc/testing/DB/convert_mysql_tables.php
+++ b/misc/testing/DB/convert_mysql_tables.php
@@ -1,7 +1,8 @@
$pdo]);
-$consoletools = new \ConsoleTools(['ColorCLI' => $pdo->log]);
+$groups = new Groups(['Settings' => $pdo]);
+$consoletools = new ConsoleTools(['ColorCLI' => $pdo->log]);
$DoPartRepair = ($pdo->getSetting('partrepair') == '0') ? false : true;
if ((!isset($argv[1])) || $argv[1] != 'true') {
diff --git a/misc/testing/DB/convert_to_tpg_alt.php b/misc/testing/DB/convert_to_tpg_alt.php
index 78b673a59..95003dd9d 100644
--- a/misc/testing/DB/convert_to_tpg_alt.php
+++ b/misc/testing/DB/convert_to_tpg_alt.php
@@ -1,7 +1,10 @@
$pdo]);
diff --git a/misc/testing/DB/populate_nzb_guid.php b/misc/testing/DB/populate_nzb_guid.php
index 544204e2c..f657b7a02 100644
--- a/misc/testing/DB/populate_nzb_guid.php
+++ b/misc/testing/DB/populate_nzb_guid.php
@@ -1,10 +1,15 @@
$pdo->log]);
+ $consoletools = new ConsoleTools(['ColorCLI' => $pdo->log]);
$timestart = TIME();
$relcount = $deleted = $total = 0;
@@ -35,9 +40,9 @@ function create_guids($live, $delete = false)
}
if ($total > 0) {
echo $pdo->log->header("Creating nzb_guids for " . number_format($total) . " releases.");
- $releases = new \Releases(['Settings' => $pdo]);
- $nzb = new \NZB($pdo);
- $releaseImage = new \ReleaseImage($pdo);
+ $releases = new Releases(['Settings' => $pdo]);
+ $nzb = new NZB($pdo);
+ $releaseImage = new ReleaseImage($pdo);
$reccnt = 0;
if ($relrecs instanceof \Traversable) {
foreach ($relrecs as $relrec) {
diff --git a/misc/testing/DB/rename_to_lower.php b/misc/testing/DB/rename_to_lower.php
index 22dc9f04d..021c230e6 100644
--- a/misc/testing/DB/rename_to_lower.php
+++ b/misc/testing/DB/rename_to_lower.php
@@ -1,5 +1,5 @@
$pdo->log]);
+$consoletools = new ConsoleTools(['ColorCLI' => $pdo->log]);
$ran = false;
if (isset($argv[1]) && $argv[1] === "all") {
diff --git a/misc/testing/DB/reset_truncate.php b/misc/testing/DB/reset_truncate.php
index 1a74cdb21..3a172d180 100644
--- a/misc/testing/DB/reset_truncate.php
+++ b/misc/testing/DB/reset_truncate.php
@@ -1,5 +1,5 @@
log->header("Thank you, continuing...\n\n");
$timestart = time();
$relcount = 0;
-$ri = new \ReleaseImage($pdo);
-$nzb = new \NZB($pdo);
-$consoletools = new \ConsoleTools(['ColorCLI' => $pdo->log]);
+$ri = new ReleaseImage($pdo);
+$nzb = new NZB($pdo);
+$consoletools = new ConsoleTools(['ColorCLI' => $pdo->log]);
$pdo->queryExec("UPDATE groups SET first_record = 0, first_record_postdate = NULL, last_record = 0, last_record_postdate = NULL, last_updated = NULL");
echo $pdo->log->primary("Reseting all groups completed.");
@@ -54,7 +58,7 @@ foreach ($tables as $row) {
}
}
-(new \SphinxSearch())->truncateRTIndex('releases_rt');
+(new SphinxSearch())->truncateRTIndex('releases_rt');
$pdo->optimise(false, 'full');
diff --git a/misc/testing/DB/setUserPasswordHash.php b/misc/testing/DB/setUserPasswordHash.php
index bf29c0357..8a5bf21b9 100644
--- a/misc/testing/DB/setUserPasswordHash.php
+++ b/misc/testing/DB/setUserPasswordHash.php
@@ -6,9 +6,10 @@
* reason, it will allow the password hash on the account to be changed.
* Hopefully that will allow admin access to fix any further problems.
*/
-require_once dirname(__FILE__) . '/../../../www/config.php';
+require_once realpath(dirname(dirname(dirname(__DIR__))) . DIRECTORY_SEPARATOR . 'indexer.php');
use newznab\db\Settings;
+use newznab\controllers\Users;
$pdo = new Settings();
diff --git a/misc/testing/DB/setUserPasswordHashesToEmail.php b/misc/testing/DB/setUserPasswordHashesToEmail.php
index f8ed6cdd0..28159fa58 100644
--- a/misc/testing/DB/setUserPasswordHashesToEmail.php
+++ b/misc/testing/DB/setUserPasswordHashesToEmail.php
@@ -15,9 +15,11 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-require_once dirname(__FILE__) . '/../../../www/config.php';
+require_once realpath(dirname(dirname(dirname(__DIR__))) . DIRECTORY_SEPARATOR . 'indexer.php');
use newznab\db\Settings;
+use newznab\controllers\ColorCLI;
+use newznab\controllers\Users;
$colorCLI = new ColorCLI();
diff --git a/misc/testing/DB/show_table_sizes.php b/misc/testing/DB/show_table_sizes.php
index f096cc135..65334944d 100644
--- a/misc/testing/DB/show_table_sizes.php
+++ b/misc/testing/DB/show_table_sizes.php
@@ -1,5 +1,5 @@
$pdo]);
- $category = new \Categorize(['Settings' => $pdo]);
+ $groups = new Groups(['Settings' => $pdo]);
+ $category = new Categorize(['Settings' => $pdo]);
$internal = $external = $pre = 0;
$show = 2;
if ($argv[$argc - 1] === 'show') {
@@ -45,7 +52,7 @@ function preName($argv, $argc)
$show = 3;
}
$counter = 0;
- $pdo->log = new \ColorCLI();
+ $pdo->log = new ColorCLI();
$full = $all = $usepre = false;
$what = $where = '';
if ($argv[1] === 'full') {
@@ -93,7 +100,7 @@ function preName($argv, $argc)
$res = $pdo->queryDirect("SELECT id, name, searchname, fromname, size, groupid, categoryid FROM releases" . $why . $what . $where);
$total = $res->rowCount();
if ($total > 0) {
- $consoletools = new \ConsoleTools(['ColorCLI' => $pdo->log]);
+ $consoletools = new ConsoleTools(['ColorCLI' => $pdo->log]);
foreach ($res as $row) {
$groupname = $groups->getByNameByID($row['groupid']);
$cleanerName = releaseCleaner($row['name'], $row['fromname'], $row['size'], $groupname, $usepre);
@@ -123,7 +130,7 @@ function preName($argv, $argc)
if ($cleanName != '') {
if (preg_match('/alt\.binaries\.e\-?book(\.[a-z]+)?/', $groupname)) {
if (preg_match('/^[0-9]{1,6}-[0-9]{1,6}-[0-9]{1,6}$/', $cleanName, $match)) {
- $rf = new \ReleaseFiles($pdo);
+ $rf = new ReleaseFiles($pdo);
$files = $rf->get($row['id']);
foreach ($files as $f) {
if (preg_match(
@@ -177,7 +184,7 @@ function preName($argv, $argc)
$oldcatname = $category->getNameByID($row["categoryid"]);
$newcatname = $category->getNameByID($determinedcat);
- \NameFixer::echoChangedReleaseName(array(
+ NameFixer::echoChangedReleaseName(array(
'new_name' => $cleanName,
'old_name' => $row["searchname"],
'new_category' => $newcatname,
@@ -233,7 +240,7 @@ function preName($argv, $argc)
} else {
$relcount = catRelease("searchname", "WHERE (iscategorized = 0 OR categoryid = 8010) AND adddate > NOW() - INTERVAL " . $argv[1] . " HOUR", true);
}
- $consoletools = new \ConsoleTools(['ColorCLI' => $pdo->log]);
+ $consoletools = new ConsoleTools(['ColorCLI' => $pdo->log]);
$time = $consoletools->convertTime(TIME() - $timestart);
echo $pdo->log->header("Finished categorizing " . number_format($relcount) . " releases in " . $time . " seconds, using the usenet subject.\n");
resetSearchnames();
@@ -268,8 +275,8 @@ function resetSearchnames()
function catRelease($type, $where, $echooutput = false)
{
global $pdo;
- $cat = new \Categorize(['Settings' => $pdo]);
- $consoletools = new \ConsoleTools(['ColorCLI' => $pdo->log]);
+ $cat = new Categorize(['Settings' => $pdo]);
+ $consoletools = new ConsoleTools(['ColorCLI' => $pdo->log]);
$relcount = 0;
echo $pdo->log->primary("SELECT id, " . $type . ", groupid FROM releases " . $where);
$resrel = $pdo->queryDirect("SELECT id, " . $type . ", groupid FROM releases " . $where);
@@ -292,8 +299,8 @@ function catRelease($type, $where, $echooutput = false)
function releaseCleaner($subject, $fromName, $size, $groupname, $usepre)
{
- $groups = new \Groups();
- $releaseCleaning = new \ReleaseCleaning($groups->pdo);
+ $groups = new Groups();
+ $releaseCleaning = new ReleaseCleaning($groups->pdo);
$cleanerName = $releaseCleaning->releaseCleaner($subject, $fromName, $size, $groupname, $usepre);
if (!is_array($cleanerName) && $cleanerName != false) {
return array("cleansubject" => $cleanerName, "properlynamed" => true, "increment" => false);
diff --git a/misc/testing/PostProc/check_previews.php b/misc/testing/PostProc/check_previews.php
index 1a965e20c..b8c05107f 100644
--- a/misc/testing/PostProc/check_previews.php
+++ b/misc/testing/PostProc/check_previews.php
@@ -2,10 +2,14 @@
// --------------------------------------------------------------
// Scan for releases missing previews on disk
// --------------------------------------------------------------
-require_once dirname(__FILE__) . '/../../../www/config.php';
+require_once realpath(dirname(dirname(dirname(__DIR__))) . DIRECTORY_SEPARATOR . 'indexer.php');
use newznab\db\Settings;
use newznab\utility\Utility;
+use newznab\controllers\Releases;
+use newznab\controllers\NZB;
+use newznab\controllers\ReleaseImage;
+use newznab\controllers\ConsoleTools;
$pdo = new Settings();
diff --git a/misc/testing/PostProc/extractTVCovers.php b/misc/testing/PostProc/extractTVCovers.php
index bdf82bdcf..b9bdbc74f 100644
--- a/misc/testing/PostProc/extractTVCovers.php
+++ b/misc/testing/PostProc/extractTVCovers.php
@@ -1,6 +1,6 @@
true, 'Settings' => $pdo]);
+$console = new Console(['Echo' => true, 'Settings' => $pdo]);
$res = $pdo->queryDirect(sprintf("SELECT searchname, id FROM releases WHERE consoleinfoid IS NULL AND categoryid BETWEEN 1000 AND 1999 ORDER BY id DESC" ));
if ($res instanceof \Traversable) {
diff --git a/misc/testing/PostProc/getGameCovers.php b/misc/testing/PostProc/getGameCovers.php
index 9ce02c7fe..c9c05c709 100644
--- a/misc/testing/PostProc/getGameCovers.php
+++ b/misc/testing/PostProc/getGameCovers.php
@@ -1,13 +1,14 @@
true, 'Settings' => $pdo]);
+$game = new Games(['Echo' => true, 'Settings' => $pdo]);
$res = $pdo->query(
sprintf("SELECT id, title FROM gamesinfo WHERE cover = 0 ORDER BY id DESC LIMIT 100")
diff --git a/misc/testing/PostProc/getImdb.php b/misc/testing/PostProc/getImdb.php
index 71df0154b..2ab4e3fa8 100644
--- a/misc/testing/PostProc/getImdb.php
+++ b/misc/testing/PostProc/getImdb.php
@@ -1,8 +1,10 @@
removeByCriteria(array_slice($argv, 1, $totalArgs-1));
diff --git a/misc/testing/Tests/queryamazon.php b/misc/testing/Tests/queryamazon.php
index 44dfa783f..8283574e2 100644
--- a/misc/testing/Tests/queryamazon.php
+++ b/misc/testing/Tests/queryamazon.php
@@ -1 +1 @@
-get();
$title = "Long Arm, The - Franz Habl ";
$obj = new AmazonProductAPI($site->amazonpubkey, $site->amazonprivkey, $site->amazonassociatetag);
try
{
$amaz = $obj->searchProducts($title, AmazonProductAPI::BOOKS, "TITLE");
$item = [];
$item["asin"] = (string) $amaz->Items->Item->ASIN;
$item["url"] = (string) $amaz->Items->Item->DetailPageURL;
$item["cover"] = (string) $amaz->Items->Item->LargeImage->URL;
$item["author"] = (string) $amaz->Items->Item->ItemAttributes->Author;
$item["dewey"] = (string) $amaz->Items->Item->ItemAttributes->DeweyDecimalNumber;
$item["ean"] = (string) $amaz->Items->Item->ItemAttributes->EAN;
$item["isbn"] = (string) $amaz->Items->Item->ItemAttributes->ISBN;
$item["publisher"] = (string) $amaz->Items->Item->ItemAttributes->Publisher;
$item["publishdate"] = (string) $amaz->Items->Item->ItemAttributes->PublicationDate;
$item["pages"] = (string) $amaz->Items->Item->ItemAttributes->NumberOfPages;
$item["title"] = (string) $amaz->Items->Item->ItemAttributes->Title;
$item["review"] = "";
if (isset($amaz->Items->Item->EditorialReviews))
$item["review"] = trim(strip_tags((string) $amaz->Items->Item->EditorialReviews->EditorialReview->Content));
print_r($item);
}
catch(Exception $e)
{
echo "failed";
}
\ No newline at end of file
+getSetting('amazonpubkey'), $s->getSetting('amazonprivkey'), $s->getSetting('amazonassociatetag'));
try
{
$amaz = $obj->searchProducts($title, AmazonProductAPI::BOOKS, "TITLE");
$item = [];
$item["asin"] = (string)$amaz->Items->Item->ASIN;
$item["url"] = (string)$amaz->Items->Item->DetailPageURL;
$item["cover"] = (string)$amaz->Items->Item->LargeImage->URL;
$item["author"] = (string)$amaz->Items->Item->ItemAttributes->Author;
$item["dewey"] = (string)$amaz->Items->Item->ItemAttributes->DeweyDecimalNumber;
$item["ean"] = (string)$amaz->Items->Item->ItemAttributes->EAN;
$item["isbn"] = (string)$amaz->Items->Item->ItemAttributes->ISBN;
$item["publisher"] = (string)$amaz->Items->Item->ItemAttributes->Publisher;
$item["publishdate"] = (string)$amaz->Items->Item->ItemAttributes->PublicationDate;
$item["pages"] = (string)$amaz->Items->Item->ItemAttributes->NumberOfPages;
$item["title"] = (string)$amaz->Items->Item->ItemAttributes->Title;
$item["review"] = '';
if (isset($amaz->Items->Item->EditorialReviews)) {
$item["review"] = trim(strip_tags((string)$amaz->Items->Item->EditorialReviews->EditorialReview->Content));
}
print_r($item);
}
catch(Exception $e)
{
echo "failed";
}
\ No newline at end of file
diff --git a/misc/testing/Tests/regexverify.php b/misc/testing/Tests/regexverify.php
index f9cb21bb3..ca615293d 100644
--- a/misc/testing/Tests/regexverify.php
+++ b/misc/testing/Tests/regexverify.php
@@ -5,7 +5,10 @@
//
// by l2g
//
-require_once dirname(__FILE__) . '/../../../www/config.php';
+require_once realpath(dirname(dirname(dirname(__DIR__))) . DIRECTORY_SEPARATOR . 'indexer.php');
+
+use newznab\controllers\Releases;
+use newznab\db\Settings;
function handleError($errno, $errstr, $errfile, $errline, array $errcontext)
diff --git a/misc/testing/Tests/test_regex.php b/misc/testing/Tests/test_regex.php
index 48af227ec..df3b90520 100644
--- a/misc/testing/Tests/test_regex.php
+++ b/misc/testing/Tests/test_regex.php
@@ -5,7 +5,7 @@
//
// by l2g
//
-require_once dirname(__FILE__) . '/../../../www/config.php';
+require_once realpath(dirname(dirname(dirname(__DIR__))) . DIRECTORY_SEPARATOR . 'indexer.php');
use newznab\db\Settings;
diff --git a/misc/testing/Tests/testnewamazon.php b/misc/testing/Tests/testnewamazon.php
index 197f301b4..41d99c7f4 100644
--- a/misc/testing/Tests/testnewamazon.php
+++ b/misc/testing/Tests/testnewamazon.php
@@ -1,16 +1,16 @@
get();
+$s = new Settings();
-$pubkey = $site->amazonpubkey;
-$privkey = $site->amazonprivkey;
-$asstag = $site->amazonassociatetag;
+$pubkey = $s->getSetting('amazonpubkey');
+$privkey = $s->getSetting('amazonprivkey');
+$asstag = $s->getSetting('amazonassociatetag');
$conf = new GenericConfiguration();
$conf
diff --git a/misc/testing/Tests/timetest.php b/misc/testing/Tests/timetest.php
index afbec7865..60df7d33f 100644
--- a/misc/testing/Tests/timetest.php
+++ b/misc/testing/Tests/timetest.php
@@ -1,12 +1,12 @@
queryonerow( sprintf("Select now()"));
+$res = $db->queryOneRow( sprintf("Select now()"));
foreach($res as $time){
echo "Mysql Time Is Now ".$time."\n";}
$res="";
diff --git a/misc/testing/checkblanklinenzbs.php b/misc/testing/checkblanklinenzbs.php
index 878bd2afd..03f740d36 100644
--- a/misc/testing/checkblanklinenzbs.php
+++ b/misc/testing/checkblanklinenzbs.php
@@ -1,12 +1,14 @@
get();
$items = $db->query("SELECT guid FROM releases");
diff --git a/misc/testing/deletepreviews.php b/misc/testing/deletepreviews.php
index 354ef2660..07d00aace 100644
--- a/misc/testing/deletepreviews.php
+++ b/misc/testing/deletepreviews.php
@@ -2,9 +2,10 @@
//This script allows you to delete properly all preview images for a range
-require_once dirname(__FILE__) . '/../../www/config.php';
+require_once realpath(dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'indexer.php');
use newznab\db\Settings;
+use newznab\controllers\Releases;
$releases = new Releases();
$db = new Settings;
diff --git a/misc/testing/dumpnfo.php b/misc/testing/dumpnfo.php
index cf91eada3..cfa2fe783 100644
--- a/misc/testing/dumpnfo.php
+++ b/misc/testing/dumpnfo.php
@@ -1 +1 @@
-queryDirect("select releases.searchname, releases.postdate, uncompress(releasenfo.nfo) as nfo from releases inner join releasenfo on releases.ID = releasenfo.releaseID and releasenfo.nfo is not null order by postdate");
while ($row = $db->getAssocArray($res))
{
$dir = date("Ymd", strtotime($row["postdate"]));
if (!file_exists($dir))
mkdir($dir);
$filename = $dir."/".safeFilename($row["searchname"]).".nfo";
if (!file_exists($filename))
{
$fh = fopen($filename, 'w');
fwrite($fh, \newznab\utility\Utility::cp437toUTF($row["nfo"]));
fclose($fh);
}
}
\ No newline at end of file
+queryDirect("select releases.searchname, releases.postdate, uncompress(releasenfo.nfo) as nfo from releases inner join releasenfo on releases.ID = releasenfo.releaseID and releasenfo.nfo is not null order by postdate");
while ($row = $db->getAssocArray($res))
{
$dir = date("Ymd", strtotime($row["postdate"]));
if (!file_exists($dir))
mkdir($dir);
$filename = $dir."/".safeFilename($row["searchname"]).".nfo";
if (!file_exists($filename))
{
$fh = fopen($filename, 'w');
fwrite($fh, Utility::cp437toUTF($row["nfo"]));
fclose($fh);
}
}
\ No newline at end of file
diff --git a/misc/testing/fixTVRage.php b/misc/testing/fixTVRage.php
index 35259c2f9..4971b1d41 100644
--- a/misc/testing/fixTVRage.php
+++ b/misc/testing/fixTVRage.php
@@ -1,9 +1,11 @@
1)";
$rows = $db->query($sql);
diff --git a/misc/testing/fix_filesize.php b/misc/testing/fix_filesize.php
index dda1e7689..941aba687 100644
--- a/misc/testing/fix_filesize.php
+++ b/misc/testing/fix_filesize.php
@@ -6,9 +6,10 @@ If after import you have a bunch of zero sized releases run this
Author: lordgnu
*/
-require_once dirname(__FILE__) . '/../../www/config.php';
+require_once realpath(dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'indexer.php');
use newznab\db\Settings;
+use newznab\controllers\NZB;
$pdo = new Settings;
$nzb = new NZB;
diff --git a/misc/testing/fixreleasename.php b/misc/testing/fixreleasename.php
index 6334cc985..77d0b3382 100644
--- a/misc/testing/fixreleasename.php
+++ b/misc/testing/fixreleasename.php
@@ -1,5 +1,5 @@
true, 'Settings' => $pdo]);
diff --git a/misc/testing/getCovers.php b/misc/testing/getCovers.php
index 106f20681..337191e25 100644
--- a/misc/testing/getCovers.php
+++ b/misc/testing/getCovers.php
@@ -1,9 +1,10 @@
get();
$releases = new Releases();
$db = new Settings();
$nzb = new NZB();
@@ -14,8 +17,8 @@ $nntp = new NNTP;
// read pars for a release GUID, echo out any that look like a rar
$relguid = "249f9ec1f0d68d33b5fa85594ba1a47d";
-$nzbfile = $nzb->getNZBPath($relguid, $site->nzbpath, true);
-$nzbInfo = new nzbInfo;
+$nzbfile = $nzb->getNZBPath($relguid, $db->getSetting('nzbpath'), true);
+$nzbInfo = new NZBInfo();
$nzbInfo->loadFromFile($nzbfile);
$nntp->doConnect();
diff --git a/misc/testing/parsebooknames.php b/misc/testing/parsebooknames.php
index 474bb6910..2d344c1b8 100644
--- a/misc/testing/parsebooknames.php
+++ b/misc/testing/parsebooknames.php
@@ -1 +1 @@
-parseAuthor($t);
if ($book !== false)
{
echo 'Looking up: '.$book["author"].' - '.$book["title"].' ['.$t.']'."\n";
//check for existing book entry
$bookCheck = $b->getBookInfoByName($book["author"], $book["title"]);
if ($bookCheck === false)
{
//
// get from amazon
//
$ret = $b->updateBookInfo($book["author"], $book["title"]);
if ($ret !== false)
{
$bookId = $ret;
}
}
else
{
$bookId = $bookCheck["id"];
}
}
echo $bookId;
}
\ No newline at end of file
+parseAuthor($t);
if ($book !== false)
{
echo 'Looking up: '.$book["author"].' - '.$book["title"].' ['.$t.']'."\n";
//check for existing book entry
$bookCheck = $b->getBookInfoByName($book["author"], $book["title"]);
if ($bookCheck === false)
{
//
// get from amazon
//
$ret = $b->updateBookInfo($book["author"], $book["title"]);
if ($ret !== false)
{
$bookId = $ret;
}
}
else
{
$bookId = $bookCheck["id"];
}
}
echo $bookId;
}
\ No newline at end of file
diff --git a/misc/testing/predbUpdateAll.php b/misc/testing/predbUpdateAll.php
index bf9cc5563..621f7c41d 100644
--- a/misc/testing/predbUpdateAll.php
+++ b/misc/testing/predbUpdateAll.php
@@ -1,5 +1,7 @@
nzpreUpdate();
diff --git a/misc/testing/recategorize.php b/misc/testing/recategorize.php
index 2ce8da19b..87ab7c671 100644
--- a/misc/testing/recategorize.php
+++ b/misc/testing/recategorize.php
@@ -1,7 +1,10 @@
true, 'Settings' => $pdo]);
diff --git a/misc/testing/rottentom.php b/misc/testing/rottentom.php
index ac93f1395..abbd63cba 100644
--- a/misc/testing/rottentom.php
+++ b/misc/testing/rottentom.php
@@ -1,12 +1,16 @@
get();
+use newznab\db\Settings;
+use newznab\controllers\RottenTomato;
-if (isset($site->rottentomatokey))
+$s = new Settings();
+$rtkey = $s->getSetting('rottentomatokey');
+$rt = new RottenTomato($rtkey);
+
+if (isset($rtkey) && $rtkey !='')
{
- $rt = new RottenTomato($site->rottentomatokey);
+ $rt = new RottenTomato($rtkey);
//print_r($rt->getMoviesBoxOffice());
//print_r($rt->getMoviesInTheaters());
diff --git a/misc/testing/spotnab.php b/misc/testing/spotnab.php
index ea043f604..fbcc3c8f4 100644
--- a/misc/testing/spotnab.php
+++ b/misc/testing/spotnab.php
@@ -172,7 +172,9 @@ SHARING
recognize or want to test out the source.
*/
-require_once dirname(__FILE__) . '/../../www/config.php';
+require_once realpath(dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'indexer.php');
+
+use newznab\controllers\SpotNab;
// Subject Lines will always be a hash key that helps scanning identify whether
// or not the contents are valid or not. the hash key contains is built
diff --git a/misc/testing/tidynzbfolder.php b/misc/testing/tidynzbfolder.php
index e340690ae..4634965c2 100644
--- a/misc/testing/tidynzbfolder.php
+++ b/misc/testing/tidynzbfolder.php
@@ -1,10 +1,9 @@
get();
$db = new Settings();
$r = new Releases();
diff --git a/misc/testing/updateCategories.php b/misc/testing/updateCategories.php
index f10c6932e..8f3021933 100644
--- a/misc/testing/updateCategories.php
+++ b/misc/testing/updateCategories.php
@@ -1,8 +1,9 @@
query("select releaseID, videowidth, videoheight from releasevideo where definition is null");
foreach($rels as $rel)
{
$sql = sprintf("update releasevideo set definition = %d where releaseID = %d",
$rv->determineVideoResolution($rel["videowidth"], $rel["videoheight"]), $rel["releaseID"]);
$db->exec($sql);
}
?>
\ No newline at end of file
+query("select releaseID, videowidth, videoheight from releasevideo where definition is null");
foreach($rels as $rel)
{
$sql = sprintf("update releasevideo set definition = %d where releaseID = %d",
$rv->determineVideoResolution($rel["videowidth"], $rel["videoheight"]), $rel["releaseID"]);
$db->exec($sql);
}
?>
\ No newline at end of file
diff --git a/misc/update_scripts/backfill.php b/misc/update_scripts/backfill.php
index 41593f8ea..6ceb33dbd 100644
--- a/misc/update_scripts/backfill.php
+++ b/misc/update_scripts/backfill.php
@@ -1,33 +1,35 @@
$pdo]);
+$nntp = new NNTP(['Settings' => $pdo]);
if ($nntp->doConnect() !== true) {
exit($pdo->log->error("Unable to connect to usenet."));
}
if (isset($argv[1]) && $argv[1] == 'all' && $argv[1] !== 'safe' && $argv[1] !== 'alph' && $argv[1] !== 'date' && !is_numeric($argv[1]) && !isset($argv[2])) {
- $backfill = new \Backfill(['NNTP' => $nntp, 'Settings' => $pdo]);
+ $backfill = new Backfill(['NNTP' => $nntp, 'Settings' => $pdo]);
$backfill->backfillAllGroups();
} else if (isset($argv[1]) && $argv[1] !== 'all' && $argv[1] !== 'safe' && $argv[1] !== 'alph' && $argv[1] !== 'date' && !is_numeric($argv[1]) && !isset($argv[2])) {
- $backfill = new \Backfill(['NNTP' => $nntp, 'Settings' => $pdo]);
+ $backfill = new Backfill(['NNTP' => $nntp, 'Settings' => $pdo]);
$backfill->backfillAllGroups($argv[1]);
} else if (isset($argv[1]) && $argv[1] !== 'all' && $argv[1] !== 'safe' && $argv[1] !== 'alph' && $argv[1] !== 'date' && !is_numeric($argv[1]) && isset($argv[2]) && is_numeric($argv[2])) {
- $backfill = new \Backfill(['NNTP' => $nntp, 'Settings' => $pdo]);
+ $backfill = new Backfill(['NNTP' => $nntp, 'Settings' => $pdo]);
$backfill->backfillAllGroups($argv[1], $argv[2]);
} else if (isset($argv[1]) && $argv[1] !== 'all' && $argv[1] !== 'safe' && $argv[1] == 'alph' && $argv[1] !== 'date' && !is_numeric($argv[1]) && isset($argv[2]) && is_numeric($argv[2])) {
- $backfill = new \Backfill(['NNTP' => $nntp, 'Settings' => $pdo]);
+ $backfill = new Backfill(['NNTP' => $nntp, 'Settings' => $pdo]);
$backfill->backfillAllGroups('', $argv[2], 'normal');
} else if (isset($argv[1]) && $argv[1] !== 'all' && $argv[1] !== 'safe' && $argv[1] !== 'alph' && $argv[1] == 'date' && !is_numeric($argv[1]) && isset($argv[2]) && is_numeric($argv[2])) {
- $backfill = new \Backfill(['NNTP' => $nntp, 'Settings' => $pdo]);
+ $backfill = new Backfill(['NNTP' => $nntp, 'Settings' => $pdo]);
$backfill->backfillAllGroups('', $argv[2], 'date');
} else if (isset($argv[1]) && $argv[1] !== 'all' && $argv[1] == 'safe' && $argv[1] !== 'alph' && $argv[1] !== 'date' && !is_numeric($argv[1]) && isset($argv[2]) && is_numeric($argv[2])) {
- $backfill = new \Backfill(['NNTP' => $nntp, 'Settings' => $pdo]);
+ $backfill = new Backfill(['NNTP' => $nntp, 'Settings' => $pdo]);
$backfill->safeBackfill($argv[2]);
} else {
exit($pdo->log->error("\nWrong set of arguments.\n"
diff --git a/misc/update_scripts/backfill_date.php b/misc/update_scripts/backfill_date.php
index bd5352d44..a105589b1 100644
--- a/misc/update_scripts/backfill_date.php
+++ b/misc/update_scripts/backfill_date.php
@@ -19,7 +19,9 @@
=> Script will backfill ONLY a.b.games.xbox from May 15, 2011
*/
-require_once("config.php");
+require_once realpath(dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'indexer.php');
+
+use newznab\controllers\Backfill;
$time = 0;
diff --git a/misc/update_scripts/backfill_threaded.php b/misc/update_scripts/backfill_threaded.php
index b9ea05d16..664a816a1 100644
--- a/misc/update_scripts/backfill_threaded.php
+++ b/misc/update_scripts/backfill_threaded.php
@@ -1,11 +1,14 @@
getActive();
unset($groups);
-$ps = new \PowerProcess;
+$ps = new PowerProcess;
$ps->RegisterCallback('psUpdateComplete');
$ps->maxThreads = 10;
$ps->tickCount = 10000; // value in usecs. change this to 1000000 (one second) to reduce cpu use
diff --git a/misc/update_scripts/config.php b/misc/update_scripts/config.php
old mode 100644
new mode 100755
index 48e96baf7..5593d791a
--- a/misc/update_scripts/config.php
+++ b/misc/update_scripts/config.php
@@ -1,3 +1,5 @@
diff --git a/misc/update_scripts/import.php b/misc/update_scripts/import.php
index c7af7d730..9fb3ca1df 100644
--- a/misc/update_scripts/import.php
+++ b/misc/update_scripts/import.php
@@ -1,9 +1,15 @@
(string): python|php
// The type of process we want to do: $options[1] => (string): releases
@@ -26,7 +32,7 @@ switch ($options[1]) {
$value = $pdo->queryOneRow("SELECT value FROM tmux WHERE setting = 'backfill_qty'");
if ($value !== false) {
$nntp = nntp($pdo);
- (new \Backfill())->backfillAllGroups($options[2], ($options[3] == 1 ? '' : $value['value']));
+ (new Backfill())->backfillAllGroups($options[2], ($options[3] == 1 ? '' : $value['value']));
}
}
break;
@@ -39,7 +45,7 @@ switch ($options[1]) {
case 'backfill_all_quantity':
$pdo = new Settings();
$nntp = nntp($pdo);
- (new \Backfill())->backfillAllGroups($options[2], $options[3]);
+ (new Backfill())->backfillAllGroups($options[2], $options[3]);
break;
// BackFill a single group, 10000 parts.
@@ -47,7 +53,7 @@ switch ($options[1]) {
case 'backfill_all_quick':
$pdo = new Settings();
$nntp = nntp($pdo);
- (new \Backfill())->backfillAllGroups($options[2], 10000, 'normal');
+ (new Backfill())->backfillAllGroups($options[2], 10000, 'normal');
break;
/* Get a range of article headers for a group.
@@ -61,14 +67,14 @@ switch ($options[1]) {
case 'get_range':
$pdo = new Settings();
$nntp = nntp($pdo);
- $groups = new \Groups();
+ $groups = new Groups();
$groupMySQL = $groups->getByName($options[3]);
if ($nntp->isError($nntp->selectGroup($groupMySQL['name']))) {
if ($nntp->isError($nntp->dataError($nntp, $groupMySQL['name']))) {
return;
}
}
- $binaries = new \Binaries(['NNTP' => $nntp, 'Settings' => $pdo, 'Groups' => $groups]);
+ $binaries = new Binaries(['NNTP' => $nntp, 'Settings' => $pdo, 'Groups' => $groups]);
$return = $binaries->scan($groupMySQL, $options[4], $options[5], ($pdo->getSetting('safepartrepair') == 1 ? 'update' : 'backfill'));
if (empty($return)) {
exit();
@@ -125,7 +131,7 @@ switch ($options[1]) {
*/
case 'part_repair':
$pdo = new Settings();
- $groups = new \Groups(['Settings' => $pdo]);
+ $groups = new Groups(['Settings' => $pdo]);
$groupMySQL = $groups->getByName($options[2]);
$nntp = nntp($pdo);
// Select group, here, only once
@@ -135,7 +141,7 @@ switch ($options[1]) {
exit();
}
}
- (new \Binaries(['NNTP' => $nntp, 'Groups' => $groups, 'Settings' => $pdo]))->partRepair($groupMySQL);
+ (new Binaries(['NNTP' => $nntp, 'Groups' => $groups, 'Settings' => $pdo]))->partRepair($groupMySQL);
break;
// Process releases.
@@ -172,7 +178,7 @@ switch ($options[1]) {
// $options[2] => (int)groupid, group to work on
case 'requestid':
if (is_numeric($options[2])) {
- (new \RequestIDLocal(['Echo' => true]))->lookupRequestIDs(['GroupID' => $options[2], 'limit' => 5000]);
+ (new RequestIDLocal(['Echo' => true]))->lookupRequestIDs(['GroupID' => $options[2], 'limit' => 5000]);
}
break;
@@ -183,9 +189,9 @@ switch ($options[1]) {
case 'update_group_headers':
$pdo = new Settings();
$nntp = nntp($pdo);
- $groups = new \Groups();
+ $groups = new Groups();
$groupMySQL = $groups->getByName($options[2]);
- (new \Binaries(['NNTP' => $nntp, 'Groups' => $groups, 'Settings' => $pdo]))->updateGroup($groupMySQL);
+ (new Binaries(['NNTP' => $nntp, 'Groups' => $groups, 'Settings' => $pdo]))->updateGroup($groupMySQL);
break;
@@ -205,10 +211,10 @@ switch ($options[1]) {
// Connect to NNTP.
$nntp = nntp($pdo);
- $backFill = new \Backfill();
+ $backFill = new Backfill();
// Update the group for new binaries.
- (new \Binaries())->updateGroup($groupMySQL);
+ (new Binaries())->updateGroup($groupMySQL);
// BackFill the group with 20k articles.
$backFill->backfillAllGroups($groupMySQL['name'], 20000, 'normal');
@@ -218,7 +224,7 @@ switch ($options[1]) {
// Post process the releases.
(new ProcessAdditional(['Echo' => true, 'NNTP' => $nntp, 'Settings' => $pdo]))->start($options[2]);
- (new \Nfo(['Echo' => true, 'Settings' => $pdo]))->processNfoFiles($nntp, $options[2]);
+ (new Nfo(['Echo' => true, 'Settings' => $pdo]))->processNfoFiles($nntp, $options[2]);
}
break;
@@ -234,7 +240,7 @@ switch ($options[1]) {
$nntp = nntp($pdo, true);
if ($options[1] === 'pp_nfo') {
- (new \Nfo(['Echo' => true, 'Settings' => $pdo]))->processNfoFiles($nntp, '', $options[2]);
+ (new Nfo(['Echo' => true, 'Settings' => $pdo]))->processNfoFiles($nntp, '', $options[2]);
} else {
(new ProcessAdditional(['Echo' => true, 'NNTP' => $nntp, 'Settings' => $pdo]))->start('', $options[2]);
}
@@ -327,7 +333,7 @@ function collectionCheck(&$pdo, $groupID)
*/
function &nntp(&$pdo, $alternate = false)
{
- $nntp = new \NNTP(['Settings' => $pdo]);
+ $nntp = new NNTP(['Settings' => $pdo]);
if (($alternate && $pdo->getSetting('alternate_nntp') == 1 ? $nntp->doConnect(true, true) : $nntp->doConnect()) !== true) {
exit("ERROR: Unable to connect to usenet." . PHP_EOL);
}
diff --git a/misc/update_scripts/nix_scripts/tmux/bin/config.php b/misc/update_scripts/nix_scripts/tmux/bin/config.php
deleted file mode 100644
index 05d1da552..000000000
--- a/misc/update_scripts/nix_scripts/tmux/bin/config.php
+++ /dev/null
@@ -1,4 +0,0 @@
-error("This script is not intended to be run manually, it is called from fixreleasenames_threaded.py."));
} else if (isset($argv[1])) {
$db = new Settings();
- $namefixer = new \NameFixer(['Settings' => $pdo]);
+ $namefixer = new NameFixer(['Settings' => $pdo]);
$pieces = explode(' ', $argv[1]);
if (isset($pieces[1]) && $pieces[0] == 'nfo') {
$release = $pieces[1];
diff --git a/misc/update_scripts/nix_scripts/tmux/bin/groupfixrelnames.php b/misc/update_scripts/nix_scripts/tmux/bin/groupfixrelnames.php
index 61bb97763..dd03b21a2 100644
--- a/misc/update_scripts/nix_scripts/tmux/bin/groupfixrelnames.php
+++ b/misc/update_scripts/nix_scripts/tmux/bin/groupfixrelnames.php
@@ -1,15 +1,20 @@
log->error("This script is not intended to be run manually, it is called from Forking.php."));
} else if (isset($argv[1])) {
- $namefixer = new \NameFixer(['Settings' => $pdo]);
+ $namefixer = new NameFixer(['Settings' => $pdo]);
$pieces = explode(' ', $argv[1]);
$guidChar = $pieces[1];
$maxperrun = $pieces[2];
diff --git a/misc/update_scripts/nix_scripts/tmux/bin/postprocess.php b/misc/update_scripts/nix_scripts/tmux/bin/postprocess.php
index 7e28f6193..84108a961 100644
--- a/misc/update_scripts/nix_scripts/tmux/bin/postprocess.php
+++ b/misc/update_scripts/nix_scripts/tmux/bin/postprocess.php
@@ -1,9 +1,10 @@
$pdo->log]);
+$consoleTools = new ConsoleTools(['ColorCLI' => $pdo->log]);
// Create the connection here and pass
-$nntp = new \NNTP(['Settings' => $pdo]);
+$nntp = new NNTP(['Settings' => $pdo]);
if ($nntp->doConnect() !== true) {
exit($pdo->log->error("Unable to connect to usenet."));
}
diff --git a/misc/update_scripts/nix_scripts/tmux/lib/DB/db.sql b/misc/update_scripts/nix_scripts/tmux/lib/DB/db.sql
index 66d429fc9..dd8ce6f74 100644
--- a/misc/update_scripts/nix_scripts/tmux/lib/DB/db.sql
+++ b/misc/update_scripts/nix_scripts/tmux/lib/DB/db.sql
@@ -1,35 +1,35 @@
-ALTER TABLE `releases`
-ADD `dehashstatus` TINYINT(1) NOT NULL DEFAULT 0,
-ADD `nfostatus` TINYINT NOT NULL DEFAULT 0,
-ADD `jpgstatus` TINYINT(1) NOT NULL DEFAULT 0,
-ADD `audiostatus` TINYINT(1) NOT NULL DEFAULT 0,
-ADD `videostatus` TINYINT(1) NOT NULL DEFAULT 0,
-ADD `reqidstatus` TINYINT(1) NOT NULL DEFAULT 0,
-ADD `prehashid` INT UNSIGNED NOT NULL DEFAULT 0,
-ADD `iscategorized` BIT NOT NULL DEFAULT 0,
-ADD `isrenamed` BIT NOT NULL DEFAULT 0,
-ADD `ishashed` BIT NOT NULL DEFAULT 0,
-ADD `isrequestid` BIT NOT NULL DEFAULT 0,
-ADD `proc_pp` TINYINT(1) NOT NULL DEFAULT 0,
-ADD `proc_par2` BIT NOT NULL DEFAULT 0,
-ADD `proc_nfo` BIT NOT NULL DEFAULT 0,
-ADD `proc_files` BIT NOT NULL DEFAULT 0,
-ADD `gamesinfo_id` INT SIGNED NOT NULL DEFAULT '0',
-ADD `xxxinfo_id` INT SIGNED NOT NULL DEFAULT '0',
-ADD `nzbstatus` TINYINT(1) NOT NULL DEFAULT 0,
-ADD `proc_sorter` TINYINT(1) NOT NULL DEFAULT '0';
-CREATE INDEX `ix_releases_nfostatus` ON `releases` (`nfostatus` ASC) USING HASH;
-CREATE INDEX `ix_releases_reqidstatus` ON `releases` (`reqidstatus` ASC) USING HASH;
-CREATE INDEX `ix_releases_passwordstatus` ON `releases` (`passwordstatus`);
-CREATE INDEX `ix_releases_releasenfoID` ON `releases` (`releasenfoid`);
-CREATE INDEX `ix_releases_dehashstatus` ON `releases` (`dehashstatus`);
-CREATE INDEX `ix_releases_haspreview` ON `releases` (`haspreview` ASC) USING HASH;
-CREATE INDEX `ix_releases_postdate_name` ON `releases` (`postdate`, `name`);
-CREATE INDEX `ix_releases_prehashid_searchname` ON `releases` (`prehashid`, `searchname`);
-CREATE INDEX `ix_releases_gamesinfo_id` ON `releases` (`gamesinfo_id`);
-CREATE INDEX `ix_releases_xxxinfo_id` ON `releases` (`xxxinfo_id`);
-CREATE INDEX `ix_releases_status` ON `releases` (`nzbstatus`, `iscategorized`, `isrenamed`, `nfostatus`, `ishashed`, `passwordstatus`, `dehashstatus`, `releasenfoid`, `musicinfoid`, `consoleinfoid`, `bookinfoid`, `haspreview`, `categoryid`, `imdbid');
-UPDATE releases SET `nzbstatus` = 1 WHERE `nzbstatus` = 0;
+ALTER TABLE releases
+ADD dehashstatus TINYINT(1) NOT NULL DEFAULT 0,
+ADD nfostatus TINYINT NOT NULL DEFAULT 0,
+ADD jpgstatus TINYINT(1) NOT NULL DEFAULT 0,
+ADD audiostatus TINYINT(1) NOT NULL DEFAULT 0,
+ADD videostatus TINYINT(1) NOT NULL DEFAULT 0,
+ADD reqidstatus TINYINT(1) NOT NULL DEFAULT 0,
+ADD prehashid INT UNSIGNED NOT NULL DEFAULT 0,
+ADD iscategorized BIT NOT NULL DEFAULT 0,
+ADD isrenamed BIT NOT NULL DEFAULT 0,
+ADD ishashed BIT NOT NULL DEFAULT 0,
+ADD isrequestid BIT NOT NULL DEFAULT 0,
+ADD proc_pp TINYINT(1) NOT NULL DEFAULT 0,
+ADD proc_par2 BIT NOT NULL DEFAULT 0,
+ADD proc_nfo BIT NOT NULL DEFAULT 0,
+ADD proc_files BIT NOT NULL DEFAULT 0,
+ADD gamesinfo_id INT SIGNED NOT NULL DEFAULT '0',
+ADD xxxinfo_id INT SIGNED NOT NULL DEFAULT '0',
+ADD nzbstatus TINYINT(1) NOT NULL DEFAULT 0,
+ADD proc_sorter TINYINT(1) NOT NULL DEFAULT '0';
+CREATE INDEX ix_releases_nfostatus ON releases (nfostatus ASC) USING HASH;
+CREATE INDEX ix_releases_reqidstatus ON releases (reqidstatus ASC) USING HASH;
+CREATE INDEX ix_releases_passwordstatus ON releases (passwordstatus);
+CREATE INDEX ix_releases_releasenfoID ON releases (releasenfoid);
+CREATE INDEX ix_releases_dehashstatus ON releases (dehashstatus);
+CREATE INDEX ix_releases_haspreview ON releases (haspreview ASC) USING HASH;
+CREATE INDEX ix_releases_postdate_name ON releases (postdate, name);
+CREATE INDEX ix_releases_prehashid_searchname ON releases (prehashid, searchname);
+CREATE INDEX ix_releases_gamesinfo_id ON releases (gamesinfo_id);
+CREATE INDEX ix_releases_xxxinfo_id ON releases (xxxinfo_id);
+CREATE INDEX ix_releases_status ON releases (nzbstatus, iscategorized, isrenamed, nfostatus, ishashed, passwordstatus, dehashstatus, releasenfoid, musicinfoid, consoleinfoid, bookinfoid, haspreview, categoryid, imdbid);
+UPDATE releases SET nzbstatus = 1 WHERE nzbstatus = 0;
ALTER TABLE users ADD COLUMN gameview INT AFTER consoleview;
ALTER TABLE users ADD COLUMN xxxview INT AFTER consoleview;
@@ -56,20 +56,20 @@ CREATE TABLE prehash (
searched TINYINT(1) NOT NULL DEFAULT '0',
PRIMARY KEY (id)
)
- ENGINE =INNODB
+ ENGINE =MyISAM
DEFAULT CHARACTER SET utf8
COLLATE utf8_unicode_ci
AUTO_INCREMENT =1;
-CREATE INDEX `ix_prehash_filename` ON `prehash` (`filename`);
-CREATE UNIQUE INDEX `ix_prehash_title` ON `prehash` (`title`);
-CREATE INDEX `ix_prehash_nfo` ON `prehash` (`nfo`);
-CREATE INDEX `ix_prehash_predate` ON `prehash` (`predate`);
-CREATE INDEX `ix_prehash_source` ON `prehash` (`source`);
-CREATE INDEX `ix_prehash_requestid` ON `prehash` (`requestid`, `groupid`);
-CREATE INDEX `ix_prehash_size` ON `prehash` (`size`);
-CREATE INDEX `ix_prehash_category` ON `prehash` (`category`);
-CREATE INDEX `ix_prehash_searched` ON `prehash` (`searched`);
+CREATE INDEX ix_prehash_filename ON prehash (filename);
+CREATE UNIQUE INDEX ix_prehash_title ON prehash (title);
+CREATE INDEX ix_prehash_nfo ON prehash (nfo);
+CREATE INDEX ix_prehash_predate ON prehash (predate);
+CREATE INDEX ix_prehash_source ON prehash (source);
+CREATE INDEX ix_prehash_requestid ON prehash (requestid, groupid);
+CREATE INDEX ix_prehash_size ON prehash (size);
+CREATE INDEX ix_prehash_category ON prehash (category);
+CREATE INDEX ix_prehash_searched ON prehash (searched);
DROP TABLE IF EXISTS tmux;
CREATE TABLE tmux (
@@ -82,7 +82,7 @@ CREATE TABLE tmux (
PRIMARY KEY (id),
UNIQUE KEY setting (setting)
)
- ENGINE =INNODB
+ ENGINE =MyISAM
DEFAULT CHARSET =utf8
COLLATE =utf8_unicode_ci;
@@ -232,7 +232,7 @@ CREATE TABLE country (
code CHAR(2) NOT NULL DEFAULT "",
PRIMARY KEY (id)
)
- ENGINE =INNODB
+ ENGINE =MyISAM
DEFAULT CHARACTER SET utf8
COLLATE utf8_unicode_ci
AUTO_INCREMENT =1;
@@ -292,7 +292,7 @@ INSERT INTO country (code, name) VALUES ('AF', 'Afghanistan'),
('CG', 'Congo the'),
('CK', 'Cook Islands'),
('CR', 'Costa Rica'),
-('CI', 'Cote d\'Ivoire'),
+('CI', 'Cote d Ivoire'),
('HR', 'Croatia'),
('CU', 'Cuba'),
('CY', 'Cyprus'),
@@ -498,7 +498,7 @@ CREATE TABLE gamesinfo (
PRIMARY KEY (id),
UNIQUE INDEX ix_gamesinfo_asin (asin)
)
- ENGINE = InnoDB
+ ENGINE = MyISAM
DEFAULT CHARSET = utf8
COLLATE = utf8_unicode_ci
AUTO_INCREMENT = 1;
@@ -524,21 +524,21 @@ CREATE TABLE xxxinfo (
PRIMARY KEY (id),
INDEX ix_xxxinfo_title (title)
)
- ENGINE = InnoDB
+ ENGINE = MyISAM
DEFAULT CHARSET = utf8
COLLATE = utf8_unicode_ci
AUTO_INCREMENT = 1;
-DROP TABLE IF EXISTS `genres`;
-CREATE TABLE IF NOT EXISTS `genres` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
- `type` int(4) DEFAULT NULL,
- `disabled` tinyint(1) NOT NULL DEFAULT '0',
- PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC AUTO_INCREMENT=635;
+DROP TABLE IF EXISTS genres;
+CREATE TABLE IF NOT EXISTS genres (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ title varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ type int(4) DEFAULT NULL,
+ disabled tinyint(1) NOT NULL DEFAULT '0',
+ PRIMARY KEY (id)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC AUTO_INCREMENT=635;
-INSERT IGNORE INTO `genres` (`id`, `title`, `type`, `disabled`) VALUES
+INSERT IGNORE INTO genres (id, title, type, disabled) VALUES
(150, 'Blues', 3000, 0),
(151, 'Classic Rock', 3000, 0),
(152, 'Country', 3000, 0),
@@ -1034,7 +1034,7 @@ CREATE TABLE shortgroups (
updated DATETIME DEFAULT NULL,
PRIMARY KEY (id)
)
- ENGINE =InnoDB
+ ENGINE =MyISAM
DEFAULT CHARACTER SET utf8
COLLATE utf8_unicode_ci
AUTO_INCREMENT =1;
@@ -1042,19 +1042,19 @@ CREATE TABLE shortgroups (
CREATE INDEX ix_shortgroups_id ON shortgroups (id);
CREATE INDEX ix_shortgroups_name ON shortgroups (name);
-DROP TABLE IF EXISTS `category`;
+DROP TABLE IF EXISTS category;
CREATE TABLE category
(
- `id` INT PRIMARY KEY NOT NULL AUTO_INCREMENT,
- `title` VARCHAR(255) NOT NULL,
- `parentid` INT NULL,
- `status` INT NOT NULL DEFAULT '1',
- `minsizetoformrelease` BIGINT UNSIGNED NOT NULL DEFAULT '0',
- `maxsizetoformrelease` BIGINT UNSIGNED NOT NULL DEFAULT '0',
- `description` VARCHAR(255) NULL,
- `disablepreview` TINYINT(1) NOT NULL DEFAULT '0'
+ id INT PRIMARY KEY NOT NULL AUTO_INCREMENT,
+ title VARCHAR(255) NOT NULL,
+ parentid INT NULL,
+ status INT NOT NULL DEFAULT '1',
+ minsizetoformrelease BIGINT UNSIGNED NOT NULL DEFAULT '0',
+ maxsizetoformrelease BIGINT UNSIGNED NOT NULL DEFAULT '0',
+ description VARCHAR(255) NULL,
+ disablepreview TINYINT(1) NOT NULL DEFAULT '0'
)
- ENGINE =INNODB
+ ENGINE =MyISAM
DEFAULT CHARACTER SET utf8
COLLATE utf8_unicode_ci
AUTO_INCREMENT =100000;
@@ -1144,7 +1144,7 @@ CREATE TABLE sharing_sites (
comments MEDIUMINT UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY (id)
)
- ENGINE =InnoDB
+ ENGINE =MyISAM
DEFAULT CHARACTER SET utf8
COLLATE utf8_unicode_ci
AUTO_INCREMENT =1;
@@ -1165,7 +1165,7 @@ CREATE TABLE sharing (
max_download MEDIUMINT UNSIGNED NOT NULL DEFAULT '150',
PRIMARY KEY (site_guid)
)
- ENGINE =InnoDB
+ ENGINE =MyISAM
DEFAULT CHARACTER SET utf8
COLLATE utf8_unicode_ci;
@@ -1179,9 +1179,9 @@ UPDATE releasecomment
SET text_hash = MD5(text);
ALTER IGNORE TABLE releasecomment ADD UNIQUE INDEX ix_releasecomment_hash_gid (text_hash, gid);
-ALTER TABLE `releasefiles` ADD COLUMN `ishashed` TINYINT(1) NOT NULL DEFAULT '0'
-AFTER `size`;
-CREATE INDEX `ix_releasefiles_ishashed` ON `releasefiles` (`ishashed`);
+ALTER TABLE releasefiles ADD COLUMN ishashed TINYINT(1) NOT NULL DEFAULT '0'
+AFTER size;
+CREATE INDEX ix_releasefiles_ishashed ON releasefiles (ishashed);
DROP TABLE IF EXISTS predbhash;
CREATE TABLE predbhash (
@@ -1207,7 +1207,7 @@ VALUES ('prehash', 'Prehash',
'Prehash', 1, 68);
INSERT INTO menu (href, title, tooltip, role, ordinal ) VALUES ('newposterwall', 'New Releases', "Newest Releases Poster Wall", 1, 11);
-INSERT INTO `site` (`setting`, `value`) VALUES
+INSERT INTO site (setting, value) VALUES
('categorizeforeign', '1'),
('catwebdl', '0'),
('giantbombkey', ''),
diff --git a/misc/update_scripts/nix_scripts/tmux/lib/DB/mysqldump_tables.php b/misc/update_scripts/nix_scripts/tmux/lib/DB/mysqldump_tables.php
index 906aa6de5..9b99cd2a1 100644
--- a/misc/update_scripts/nix_scripts/tmux/lib/DB/mysqldump_tables.php
+++ b/misc/update_scripts/nix_scripts/tmux/lib/DB/mysqldump_tables.php
@@ -1,5 +1,5 @@
$pdo]);
-$predb = new \PreHash(['Echo' => true, 'Settings' => $pdo]);
+$namefixer = new NameFixer(['Settings' => $pdo]);
+$predb = new PreHash(['Echo' => true, 'Settings' => $pdo]);
if (isset($argv[1]) && isset($argv[2]) && isset($argv[3]) && isset($argv[4])) {
$update = ($argv[2] == "true") ? 1 : 2;
@@ -34,7 +37,7 @@ if (isset($argv[1]) && isset($argv[2]) && isset($argv[3]) && isset($argv[4])) {
$nntp = null;
if ($argv[1] == 7 || $argv[1] == 8) {
- $nntp = new \NNTP(['Settings' => $pdo]);
+ $nntp = new NNTP(['Settings' => $pdo]);
if (($pdo->getSetting('alternate_nntp') == '1' ? $nntp->doConnect(true, true) : $nntp->doConnect()) !== true) {
echo $pdo->log->error("Unable to connect to usenet.\n");
return;
diff --git a/misc/update_scripts/nix_scripts/tmux/lib/postprocess_pre.php b/misc/update_scripts/nix_scripts/tmux/lib/postprocess_pre.php
index 73b134aeb..fc3a84f8f 100644
--- a/misc/update_scripts/nix_scripts/tmux/lib/postprocess_pre.php
+++ b/misc/update_scripts/nix_scripts/tmux/lib/postprocess_pre.php
@@ -1,4 +1,6 @@
true]))->checkPre((isset($argv[1]) && is_numeric($argv[1]) ? $argv[1] : false));
\ No newline at end of file
+use newznab\controllers\PreHash;
+
+(new PreHash(['Echo' => true]))->checkPre((isset($argv[1]) && is_numeric($argv[1]) ? $argv[1] : false));
\ No newline at end of file
diff --git a/misc/update_scripts/nix_scripts/tmux/lib/removeCrapReleases.php b/misc/update_scripts/nix_scripts/tmux/lib/removeCrapReleases.php
index 05e93b22f..6c1dbf214 100644
--- a/misc/update_scripts/nix_scripts/tmux/lib/removeCrapReleases.php
+++ b/misc/update_scripts/nix_scripts/tmux/lib/removeCrapReleases.php
@@ -3,9 +3,12 @@
/*
* This script deletes releases that match certain criteria, type php removeCrapReleases.php false for details.
*/
-require_once(dirname(__FILE__) . "/../bin/config.php");
+require_once dirname(__FILE__) . '/../../../config.php';
-$cli = new \ColorCLI();
+use newznab\controllers\ColorCLI;
+use newznab\controllers\ReleaseRemover;
+
+$cli = new ColorCLI();
$n = PHP_EOL;
$argCnt = count($argv);
@@ -65,5 +68,5 @@ if (isset($argv[3]) && $argv[3] === 'blacklist' && isset($argv[4])) {
$blacklistID = $argv[4];
}
-$RR = new \ReleaseRemover();
+$RR = new ReleaseRemover();
$RR->removeCrap(($argv[1] === 'true' ? true : false), $argv[2], (isset($argv[3]) ? $argv[3] : ''), (isset($blacklistID) ? $argv[4] : ''));
\ No newline at end of file
diff --git a/misc/update_scripts/nix_scripts/tmux/lib/requestid.php b/misc/update_scripts/nix_scripts/tmux/lib/requestid.php
index b1cdd773d..b9b87b3b9 100644
--- a/misc/update_scripts/nix_scripts/tmux/lib/requestid.php
+++ b/misc/update_scripts/nix_scripts/tmux/lib/requestid.php
@@ -1,7 +1,11 @@
error(
@@ -20,11 +24,11 @@ if (!isset($argv[1]) || ($argv[1] != "all" && $argv[1] != "full" && $argv[1] !=
}
if ($argv[1] === 'web') {
- (new \RequestIDWeb())->lookupRequestIDs(
+ (new RequestIDWeb())->lookupRequestIDs(
['limit' => 1000, 'show' => $argv[2], 'time' => (isset($argv[3]) && is_numeric($argv[3]) && $argv[3] > 0 ? $argv[3] : 0)]
);
} else {
- (new \RequestIDLocal())->lookupRequestIDs(
+ (new RequestIDLocal())->lookupRequestIDs(
['limit' => $argv[1], 'show' => $argv[2], 'time' => (isset($argv[3]) && is_numeric($argv[3]) && $argv[3] > 0 ? $argv[3] : 0)]
);
}
diff --git a/misc/update_scripts/nix_scripts/tmux/monitor.php b/misc/update_scripts/nix_scripts/tmux/monitor.php
index 672cb0e2a..7e897371c 100644
--- a/misc/update_scripts/nix_scripts/tmux/monitor.php
+++ b/misc/update_scripts/nix_scripts/tmux/monitor.php
@@ -1,13 +1,16 @@
0) {
$runVar['timers']['query']['tmux_time'] = (time() - $timer01);
$runVar['settings']['book_reqids'] = (!empty($runVar['settings']['book_reqids'])
- ? $runVar['settings']['book_reqids'] : \Category::CAT_PARENT_BOOK);
+ ? $runVar['settings']['book_reqids'] : Category::CAT_PARENT_BOOK);
//get usenet connection info
$runVar['connections'] = $tOut->getConnectionsInfo($runVar['constants']);
diff --git a/misc/update_scripts/nix_scripts/tmux/run.php b/misc/update_scripts/nix_scripts/tmux/run.php
index 066bc20ce..f3bb2e3ba 100644
--- a/misc/update_scripts/nix_scripts/tmux/run.php
+++ b/misc/update_scripts/nix_scripts/tmux/run.php
@@ -1,8 +1,10 @@
queryOneRow('SELECT enabled, posting, fetching FROM sharing');
- $t = new \Tmux();
+ $t = new Tmux();
$tmux = $t->get();
$tmux_share = (isset($tmux->run_sharing)) ? $tmux->run_sharing : 0;
diff --git a/misc/update_scripts/nix_scripts/tmux/start.php b/misc/update_scripts/nix_scripts/tmux/start.php
index 3c15bdbfd..364ab0f4c 100644
--- a/misc/update_scripts/nix_scripts/tmux/start.php
+++ b/misc/update_scripts/nix_scripts/tmux/start.php
@@ -6,13 +6,14 @@
*
* It will start the tmux server and monitoring scripts if needed.
*/
-require_once realpath(__DIR__ . '/../../../../www/config.php');
+require_once realpath(dirname(dirname(dirname(dirname(__DIR__)))) . DIRECTORY_SEPARATOR . 'indexer.php');
use newznab\db\Settings;
+use newznab\controllers\Tmux;
$pdo = new Settings();
-$tmux = new \Tmux();
+$tmux = new Tmux();
$tmux_settings = $tmux->get();
$tmux_session = (isset($tmux_settings->tmux_session)) ? $tmux_settings->tmux_session : 0;
$path = __DIR__;
diff --git a/misc/update_scripts/nix_scripts/tmux/stop.php b/misc/update_scripts/nix_scripts/tmux/stop.php
index 968fac2e5..39e85aae3 100644
--- a/misc/update_scripts/nix_scripts/tmux/stop.php
+++ b/misc/update_scripts/nix_scripts/tmux/stop.php
@@ -1,4 +1,6 @@
stopIfRunning();
+use newznab\controllers\Tmux;
+
+$restart = (new Tmux())->stopIfRunning();
diff --git a/misc/update_scripts/nntpproxy.php b/misc/update_scripts/nntpproxy.php
index b703702e6..df2825acf 100644
--- a/misc/update_scripts/nntpproxy.php
+++ b/misc/update_scripts/nntpproxy.php
@@ -1,5 +1,5 @@
getActive();
diff --git a/misc/update_scripts/update_database_version.php b/misc/update_scripts/update_database_version.php
index 0ff0ab072..f1c3b76f8 100644
--- a/misc/update_scripts/update_database_version.php
+++ b/misc/update_scripts/update_database_version.php
@@ -1,6 +1,6 @@
nzpreUpdate();
diff --git a/misc/update_scripts/update_releases.php b/misc/update_scripts/update_releases.php
index ef04bcea1..8124319cb 100644
--- a/misc/update_scripts/update_releases.php
+++ b/misc/update_scripts/update_releases.php
@@ -1,8 +1,10 @@
true]);
$m->updateUpcoming();
diff --git a/misc/update_scripts/update_tvschedule.php b/misc/update_scripts/update_tvschedule.php
index 67d41cfa0..55ce07ddc 100644
--- a/misc/update_scripts/update_tvschedule.php
+++ b/misc/update_scripts/update_tvschedule.php
@@ -1,6 +1,8 @@
true]))->updateSchedule();
\ No newline at end of file
+use newznab\controllers\TvRage;
+
+(new TvRage(['Echo' => true]))->updateSchedule();
\ No newline at end of file
diff --git a/newzdash/index.php b/newzdash/index.php
index 7bbcb98b9..c7eb896f8 100644
--- a/newzdash/index.php
+++ b/newzdash/index.php
@@ -1,7 +1,5 @@
.
+ * @author niel
+ * @copyright 2015 NN
+ */
+namespace newznab\config;
+
+require_once NN_LIBS . 'autoloader.php';
+
+class Configure
+{
+ private $environments = [
+ 'indexer' => [
+ 'config' => true,
+ 'settings' => false
+ ],
+ 'install' => [
+ 'config' => false,
+ 'settings' => false
+ ],
+ 'smarty' => [
+ 'config' => true,
+ 'settings' => false
+ ],
+ ];
+
+ public function __construct($environment = 'indexer')
+ {
+ $this->loadEnvironment($environment);
+ }
+
+ private function loadEnvironment($environment)
+ {
+ if (array_key_exists($environment, $this->environments)) {
+ foreach ($this->environments[$environment] as $config => $throwException) {
+ $this->loadSettings($config, $throwException);
+ }
+ } else {
+ throw new \RuntimeException("Unknown environment passed to Configure class!");
+ }
+ }
+
+ public function loadSettings($filename, $throwException = true)
+ {
+ $file = NN_CONFIGS . $filename . '.php';
+ if (!file_exists($file)) {
+ if ($throwException) {
+ $errorCode = (int)($filename === 'config');
+ throw new \RuntimeException(
+ "Unable to load configuration file '$file'. Make sure it has been created and contains correct settings.",
+ $errorCode
+ );
+ }
+ } else {
+ require_once $file;
+ }
+
+ switch ($filename) {
+ case 'config':
+ $this->defaultSSL();
+ break;
+ case 'settings':
+ $settings_file = NN_CONFIGS . 'settings.php';
+ if (is_file($settings_file)) {
+ require_once($settings_file);
+ if (php_sapi_name() == 'cli') {
+ $current_settings_file_version = 4; // Update this when updating settings.example.php
+ if (!defined('NN_SETTINGS_FILE_VERSION') ||
+ NN_SETTINGS_FILE_VERSION != $current_settings_file_version
+ ) {
+ echo("\033[0;31mNotice: Your $settings_file file is either out of date or you have not updated" .
+ " NN_SETTINGS_FILE_VERSION to $current_settings_file_version in that file.\033[0m" .
+ PHP_EOL
+ );
+ }
+ unset($current_settings_file_version);
+ }
+ } else {
+ define('ITEMS_PER_PAGE', '50');
+ define('ITEMS_PER_COVER_PAGE', '20');
+ define('NN_ECHOCLI', true);
+ define('NN_DEBUG', false);
+ define('NN_LOGGING', false);
+ define('NN_LOGINFO', false);
+ define('NN_LOGNOTICE', false);
+ define('NN_LOGWARNING', false);
+ define('NN_LOGERROR', false);
+ define('NN_LOGFATAL', false);
+ define('NN_LOGQUERIES', false);
+ define('NN_LOGAUTOLOADER', false);
+ define('NN_QUERY_STRIP_WHITESPACE', false);
+ define('NN_RENAME_PAR2', true);
+ define('NN_RENAME_MUSIC_MEDIAINFO', true);
+ define('NN_CACHE_EXPIRY_SHORT', 300);
+ define('NN_CACHE_EXPIRY_MEDIUM', 600);
+ define('NN_CACHE_EXPIRY_LONG', 900);
+ define('NN_PREINFO_OPEN', false);
+ define('NN_FLOOD_CHECK', false);
+ define('NN_FLOOD_WAIT_TIME', 5);
+ define('NN_FLOOD_MAX_REQUESTS_PER_SECOND', 5);
+ define('NN_USE_SQL_TRANSACTIONS', true);
+ define('NN_RELEASE_SEARCH_TYPE', 0);
+ define('NN_MAX_PAGER_RESULTS', '125000');
+ }
+ unset($settings_file);
+ break;
+ }
+ }
+
+ private function defaultSSL()
+ {
+ // Check if they updated config.php for the openssl changes. Only check 1 to save speed.
+ if (!defined('NN_SSL_VERIFY_PEER')) {
+ define('NN_SSL_CAFILE', '');
+ define('NN_SSL_CAPATH', '');
+ define('NN_SSL_VERIFY_PEER', '0');
+ define('NN_SSL_VERIFY_HOST', '0');
+ define('NN_SSL_ALLOW_SELF_SIGNED', '1');
+ }
+ }
+}
diff --git a/newznab/config/ircscraper_settings_example.php b/newznab/config/ircscraper_settings_example.php
new file mode 100755
index 000000000..df8ec3caa
--- /dev/null
+++ b/newznab/config/ircscraper_settings_example.php
@@ -0,0 +1,102 @@
+'
+ **********************************************************************************************************************/
+define('SCRAPE_IRC_PASSWORD', false);
+
+/***********************************************************************************************************************
+ * This is an optional field you can use for ignoring categories.
+ * @note If you do not wish to exclude any categories, leave it a empty string: ''
+ * @examples Case sensitive: '/^(XXX|PDA|EBOOK|MP3)$/'
+ * Case insensitive: '/^(X264|TV)$/i'
+ **********************************************************************************************************************/
+define('SCRAPE_IRC_CATEGORY_IGNORE', '');
+
+/***********************************************************************************************************************
+ * This is an optional field you can use for ignoring PRE titles.
+ * @note If you do not wish to exclude any PRE titles, leave it a empty string: ''
+ * @examples Case insensitive ignore German or XXX in the title: '/\.(German|XXX)\./i'
+ * This would ignore titles like:
+ * Yanks.14.06.30.Bianca.Travelman.Is.A.Nudist.XXX.MP4-FUNKY
+ * Blancanieves.Ein.Maerchen.von.Schwarz.und.Weiss.2012.German.1080p.BluRay.x264-CONTRiBUTiON
+ **********************************************************************************************************************/
+define('SCRAPE_IRC_TITLE_IGNORE', '');
+
+/***********************************************************************************************************************
+ * This is a list of all the sources we fetch PRE's from.
+ * If you want to ignore a source, change it from false to true.
+ **********************************************************************************************************************/
+define('SCRAPE_IRC_SOURCE_IGNORE',
+ serialize(
+ array(
+ '#a.b.cd.image' => false,
+ '#a.b.console.ps3' => false,
+ '#a.b.dvd' => false,
+ '#a.b.erotica' => false,
+ '#a.b.flac' => false,
+ '#a.b.foreign' => false,
+ '#a.b.games.nintendods' => false,
+ '#a.b.inner-sanctum' => false,
+ '#a.b.moovee' => false,
+ '#a.b.movies.divx' => false,
+ '#a.b.sony.psp' => false,
+ '#a.b.sounds.mp3.complete_cd' => false,
+ '#a.b.teevee' => false,
+ '#a.b.games.wii' => false,
+ '#a.b.warez' => false,
+ '#a.b.games.xbox360' => false,
+ '#pre@corrupt' => false,
+ '#scnzb' => false,
+ '#tvnzb' => false,
+ 'omgwtfnzbs' => false,
+ 'orlydb' => false,
+ 'prelist' => false,
+ 'srrdb' => false,
+ 'u4all.eu' => false,
+ 'zenet' => false
+ )
+ )
+);
diff --git a/newznab/config/openssl.example.php b/newznab/config/openssl.example.php
new file mode 100644
index 000000000..faeb2d22c
--- /dev/null
+++ b/newznab/config/openssl.example.php
@@ -0,0 +1,28 @@
+.
+ * @author niel
+ * @copyright 2015 NN
+ */
+
+define('NN_SSL_ALLOW_SELF_SIGNED', '1');
+define('NN_SSL_CAFILE', '');
+define('NN_SSL_CAPATH', '');
+define('NN_SSL_VERIFY_HOST', '0');
+define('NN_SSL_VERIFY_PEER', '0');
+
+?>
diff --git a/www/settings.example.php b/newznab/config/settings.example.php
old mode 100644
new mode 100755
similarity index 76%
rename from www/settings.example.php
rename to newznab/config/settings.example.php
index 8261c002c..4b7418306
--- a/www/settings.example.php
+++ b/newznab/config/settings.example.php
@@ -5,16 +5,18 @@
///////////////////////////////// Scroll down to the bottom for a change log. //////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+use newznab\utility\Utility;
+
/**********************************************************************************************************************/
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////// MISC //////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/**
- * When we update settings.php.example, we will raise this version, you will get a message saying your settings.php
+ * When we update settings.example.php, we will raise this version, you will get a message saying your settings.php
* is out of date, you will need to update it and change the version number.
*
- * @note Developers: When updating settings.php.example, up this version
- * and $current_settings_file_version in automated.config.php
+ * @note Developers: When updating settings.example.php, up this version
+ * and $current_settings_file_version in newznab\config\Configure.php
* @version 4
*/
define('NN_SETTINGS_FILE_VERSION', 4);
@@ -41,7 +43,7 @@ define('ITEMS_PER_COVER_PAGE', '20');
* If you have ITEMS_PER_PAGE set to 50, and NN_MAX_PAGER_RESULTS set to 125000, you would get a maximum of
* 2,500 pages of results in searches/browse.
*
- * @note This setting can speed up browsing releases tremendously if you have millions of releases and you keep it
+ * @note This setting can speed up browsing releases tremendously if you have millions of releases and you keep it
* a relatively low value.
*
* @default '125000'
@@ -83,10 +85,8 @@ define('NN_FLOOD_MAX_REQUESTS_PER_SECOND', 5);
* of server resources.
* To find a good number for your server, run the misc/testing/Various/find_password_hash_cost.php script.
*
- * @note It is not recommended to set this under 11.
+ * @note It is not recommended to set this under 11.
* @default 11
- *
- * @version 2
*/
define('NN_PASSWORD_HASH_COST', 11);
@@ -108,8 +108,8 @@ define('NN_RELEASE_SEARCH_TYPE', 0);
/**
* This is the hostname to use when connecting to the SphinxQL server,
*
- * @note Using localhost / 127.0.0.1 has caused me issues and only 0 worked on my local server.
- * @note See misc/sphinxsearch/README.md for installation details.
+ * @note Using localhost / 127.0.0.1 has caused me issues and only 0 worked on my local server.
+ * @note See misc/sphinxsearch/README.md for installation details.
* @default '0'
*/
define('NN_SPHINXQL_HOST_NAME', '0');
@@ -162,12 +162,13 @@ define('NN_RENAME_MUSIC_MEDIAINFO', true);
* 2 - redis ; Redis server(s) will be used for caching.
* 3 - apc/apcu ; APC or APCu will be used for caching.
*
- * @note Memcahed: The Memcached PHP extension must be installed.
- * @note Redis: We use the Redis PHP extension by nicolasff. https://github.com/nicolasff/phpredis
- * @note APC: The APC or APCu PHP extension must be installed.
- * @note APC: Ignore these settings: NN_CACHE_HOSTS / NN_CACHE_SOCKET_FILE / NN_CACHE_TIMEOUT
- * @default 0
- * @version 3
+ * @see https://github.com/NN/NN_Misc/blob/master/Guides/Various/Cache/Guide.md
+ * @note Memcahed: The Memcached PHP extension must be installed.
+ * @note Redis: We use the Redis PHP extension by nicolasff. https://github.com/nicolasff/phpredis
+ * @note APC: The APC or APCu PHP extension must be installed.
+ * @note APC: Ignore these settings: NN_CACHE_HOSTS / NN_CACHE_SOCKET_FILE / NN_CACHE_TIMEOUT
+ * @default 0
+ * @version 3
*/
define('NN_CACHE_TYPE', 0);
@@ -180,18 +181,15 @@ define('NN_CACHE_TYPE', 0);
* If you have more than 1 memcached server, see the memcached documentation for more info:
* http://php.net/manual/en/memcached.addserver.php
*/
-define(
- 'NN_CACHE_HOSTS',
- serialize(
- [
- 'Server1' => [
- 'host' => '127.0.0.1',
- 'port' => 11211,
- 'weight' => 0
- ],
- ]
- )
-);
+define('NN_CACHE_HOSTS', serialize(
+ [
+ 'Server1' => [
+ 'host' => '127.0.0.1',
+ 'port' => 11211,
+ 'weight' => 0
+ ],
+ ]
+));
/**
* Optional path to unix socket file, leave '' if to not use.
@@ -199,8 +197,8 @@ define(
* This should be faster than using the host/port if your cache server is local.
*
* @example '/var/run/redis/redis.sock'
- * @note By default, redis and memcached do not have a socket file, you must configure them.
- * @note Read and write access is required to the socket file.
+ * @note By default, redis and memcached do not have a socket file, you must configure them.
+ * @note Read and write access is required to the socket file.
* @default ''
*/
define('NN_CACHE_SOCKET_FILE', '');
@@ -215,7 +213,7 @@ define('NN_CACHE_TIMEOUT', 10);
/**
* Memcached allows to compress the data, saving RAM at the expense of CPU time.
*
- * @note Does nothing on redis.
+ * @note Does nothing on redis.
* @default false
*/
define('NN_CACHE_COMPRESSION', false);
@@ -228,18 +226,19 @@ define('NN_CACHE_COMPRESSION', false);
* on Memcached / Redis / APC, read the notes below.
* 2 - [Redis Only] Use no serializer.
*
- * @note igbinary must be compiled and enabled in php.ini
- * @note Memcached/Redis must be compiled with igbinary support as well to use igbinary.
- * @note Read the igbinary page how to compile / enable.
- * @see https://github.com/phadej/igbinary
- * @default 0
- * @version 3
+ * @note igbinary must be compiled and enabled in php.ini
+ * @note APC/APCu: This setting is ignored, set this in php.ini with apc.serializer
+ * @note Memcached/Redis must be compiled with igbinary support as well to use igbinary.
+ * @note Read the igbinary page how to compile / enable.
+ * @see https://github.com/phadej/igbinary
+ * @default 0
+ * @version 3
*/
define('NN_CACHE_SERIALIZER', 0);
/**
* Amount of time in seconds to expire data from the cache server.
- * The developers of nZEDb decide what should be set as short/medium/long, depending on the type of data.
+ * The developers of NN decide what should be set as short/medium/long, depending on the type of data.
*
* @defaults 300/600/900
*/
@@ -258,7 +257,7 @@ define('NN_CACHE_EXPIRY_LONG', 900);
define('NN_DEBUG', false);
/**
- * Log debug messages to newznab/resources/debug.log
+ * Log debug messages to nzedb/resources/debug.log
*
* @default false
*/
@@ -267,7 +266,7 @@ define('NN_LOGGING', false);
/**
* var_dump missing autoloader files.
*
- * @note Dev setting.
+ * @note Dev setting.
* @default false
*/
define('NN_LOGAUTOLOADER', false);
@@ -287,10 +286,10 @@ define('NN_LOGGING_MAX_LOGS', 20);
define('NN_LOGGING_MAX_SIZE', 30);
/**
- * The folder to put the log files in. Put quotes, example : '/var/log/newznab/'
- * The default is in the nZEDb root folder /resources/logs/
+ * The folder to put the log files in. Put quotes, example : '/var/log/NN/'
+ * The default is in the NN root folder /resources/logs/
*
- * @example '/var/log/newznab/'
+ * @example '/var/log/NN/'
* @default NN_LOGS
*/
define('NN_LOGGING_LOG_FOLDER', NN_LOGS);
@@ -299,9 +298,9 @@ define('NN_LOGGING_LOG_FOLDER', NN_LOGS);
* The name of the log file.
* Must be alphanumeric (a-z 0-9) and contain no file extensions.
*
- * @default 'newznab'
+ * @default 'nzedb'
*/
-define('NN_LOGGING_LOG_NAME', 'newznab');
+define('NN_LOGGING_LOG_NAME', 'nzedb');
/**
* Display memory usage in log file and debug message output?
@@ -384,7 +383,7 @@ define('NN_LOGQUERIES', false);
* Strip white space (space, carriage return, new line, tab, etc) from queries before sending to MySQL.
* This is useful if you use the MySQL slow query log.
*
- * @note This slows down query processing, leave it false unless you turn on the MySQL slow query log.
+ * @note This slows down query processing, leave it false unless you turn on the MySQL slow query log.
* @default false
*/
define('NN_QUERY_STRIP_WHITESPACE', false);
@@ -395,7 +394,7 @@ define('NN_QUERY_STRIP_WHITESPACE', false);
* If there's a problem during a transaction, MySQL can revert the row inserts which is beneficial.
* Transactions can cause deadlocks however if you are trying to insert into the same table from another process.
*
- * @note If all your tables are MyISAM you can set this to false, as MyISAM does not support transactions.
+ * @note If all your tables are MyISAM you can set this to false, as MyISAM does not support transactions.
* @default true
*/
define('NN_USE_SQL_TRANSACTIONS', true);
@@ -405,8 +404,8 @@ define('NN_USE_SQL_TRANSACTIONS', true);
* This prevents table locks by deleting only when no SELECT queries are active on the table.
* This works on MyISAM/ARIA, not INNODB.
*
- * @note Does not cause any errors or warnings if enabled on INNODB.
- * @link https://dev.mysql.com/doc/refman/5.7/en/delete.html
+ * @note Does not cause any errors or warnings if enabled on INNODB.
+ * @link https://dev.mysql.com/doc/refman/5.7/en/delete.html
* @default false
* @version 1
*/
@@ -417,8 +416,8 @@ define('NN_SQL_DELETE_LOW_PRIORITY', false);
* This makes DELETE queries faster on MyISAM/ARIA tables by not merging index leaves.
* Only supported on MyISAM/ARIA
*
- * @note Does not cause any errors or warnings if enabled on INNODB.
- * @link https://dev.mysql.com/doc/refman/5.7/en/delete.html
+ * @note Does not cause any errors or warnings if enabled on INNODB.
+ * @link https://dev.mysql.com/doc/refman/5.7/en/delete.html
* @default false
* @version 1
*/
@@ -431,14 +430,14 @@ define('NN_SQL_DELETE_QUICK', false);
* Simple constant to let us know this file is included and we should use PHPMailer library.
* Uncomment the line below after setting the other constants.
*/
-//define('PHPMAILER_ENABLED', true);
+define('PHPMAILER_ENABLED', false);
/**
* Global "From" Address.
- * This address will be set as the From: address on every email sent by nZEDb.
+ * This address will be set as the From: address on every email sent by NN.
*
* @example 'noreply@example.com'
- * @note Depending on server configurations, it may not respect this value.
+ * @note Depending on server configurations, it may not respect this value.
* @default '' (uses the contact email configured in 'Edit Site' settings)
*/
define('PHPMAILER_FROM_EMAIL', '');
@@ -448,17 +447,17 @@ define('PHPMAILER_FROM_EMAIL', '');
* Along with the email above, this will display as the name.
*
* @example 'KingCat'
- * @note Depending on server configurations, it may not respect this value.
+ * @note Depending on server configurations, it may not respect this value.
* @default '' (uses the site title configured in 'Edit Site' settings)
*/
define('PHPMAILER_FROM_NAME', '');
/**
* Global "Reply-to" Address.
- * This address will be set as the Reply-to: address on every email sent by nZEDb.
+ * This address will be set as the Reply-to: address on every email sent by NN.
*
* @example 'support@example.com'
- * @note It's a good idea to set this to your support email account (if possible)
+ * @note It's a good idea to set this to your support email account (if possible)
* @default '' (uses the contact email configured in 'Edit Site' settings)
*/
define('PHPMAILER_REPLYTO', '');
@@ -467,7 +466,7 @@ define('PHPMAILER_REPLYTO', '');
* Always BCC.
* This email address will be blind carbon copied on every email sent from this site.
*
- * @note This has very specific uses, don't enable unless you're sure you want to get the deluge.
+ * @note This has very specific uses, don't enable unless you're sure you want to get the deluge.
* @default ''
*/
define('PHPMAILER_BCC', '');
@@ -476,21 +475,19 @@ define('PHPMAILER_BCC', '');
* Should we use a SMTP server to send mail?
* If false, it will use your default settings from php.ini.
*
- * @note If set to true, be sure to set the server settings below.
+ * @note If set to true, be sure to set the server settings below.
* @default false
*/
define('PHPMAILER_USE_SMTP', false);
-
/*********************************************************************************
* The following options require PHPMAILER_USE_SMTP to be true: *
*********************************************************************************/
-
/**
* This is the hostname to use if connecting to a SMTP server.
*
- * @note You can specify main and backup hosts, delimit with a semicolon. (i.e. 'main.host.com;backup.host.com')
+ * @note You can specify main and backup hosts, delimit with a semicolon. (i.e. 'main.host.com;backup.host.com')
* @default ''
*/
define('PHPMAILER_SMTP_HOST', '');
@@ -498,15 +495,15 @@ define('PHPMAILER_SMTP_HOST', '');
/**
* TLS & SSL Support for your SMTP server.
*
- * @note Possible values: false, 'tls', 'ssl'
+ * @note Possible values: false, 'tls', 'ssl'
* @default 'tls'
*/
-define('PHPMAILER_SMTP_SECURE','tls');
+define('PHPMAILER_SMTP_SECURE', 'tls');
/**
* SMTP Port
*
- * @note Usually this is 25, 465, or 587
+ * @note Usually this is 25, 465, or 587
* @default 587
*/
define('PHPMAILER_SMTP_PORT', 587);
@@ -514,23 +511,21 @@ define('PHPMAILER_SMTP_PORT', 587);
/**
* Does your SMTP host require authentication?
*
- * @note Be sure to set credentials below if changing to true.
+ * @note Be sure to set credentials below if changing to true.
* @default false
*/
define('PHPMAILER_SMTP_AUTH', false);
-
/*********************************************************************************
* The following options require both PHPMAILER_USE_SMTP & PHPMAILER_SMTP_AUTH to be true: *
*********************************************************************************/
-
/**
* SMTP username for authentication.
*
* @default ''
*/
-define('PHPMAILER_SMTP_USER','');
+define('PHPMAILER_SMTP_USER', '');
/**
* SMTP password for authentication.
@@ -542,19 +537,19 @@ define('PHPMAILER_SMTP_PASSWORD', '');
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////// PHP CLI Settings ///////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-if (stripos(PHP_SAPI, 'cli') !== false) {
+if (Misc::isCLI()) {
/**
* Your server's local timezone.
- * @note Uncomment to enable.
- * @see https://secure.php.net/manual/en/timezones.php
+ * @note Uncomment to enable.
+ * @see https://secure.php.net/manual/en/timezones.php
* @version 4
*/
//ini_set('date.timezone', 'America/New_York');
/**
* Maximum amount of memory a PHP script can consume before being terminated.
- * @note Uncomment to enable.
+ * @note Uncomment to enable.
* @default '1024M'
* @version 4
*/
@@ -562,7 +557,7 @@ if (stripos(PHP_SAPI, 'cli') !== false) {
/**
* Show PHP errors on CLI output.
- * @note Set to '1' for development.
+ * @note Set to '1' for development.
* @default '0'
* @version 4
*/
@@ -570,7 +565,7 @@ if (stripos(PHP_SAPI, 'cli') !== false) {
/**
* Show startup errors on CLI output.
- * @note Set to '1' for development/debugging.
+ * @note Set to '1' for development/debugging.
* @default '0'
* @version 4
*/
@@ -578,12 +573,12 @@ if (stripos(PHP_SAPI, 'cli') !== false) {
/**
* Type of errors to display.
- * @note For development/debugging set to E_ALL
+ * @note For development/debugging set to E_ALL
* @default E_ALL & ~E_DEPRECATED & ~E_STRICT
- * @see https://secure.php.net/manual/en/errorfunc.constants.php
+ * @see https://secure.php.net/manual/en/errorfunc.constants.php
* @version 4
*/
- ini_set('error_reporting', E_ALL & ~E_DEPRECATED & ~E_STRICT);
+ ini_set('error_reporting', E_ALL);
/**
* Turn off HTML tags in error messages.
@@ -595,7 +590,7 @@ if (stripos(PHP_SAPI, 'cli') !== false) {
/**
* Set the location to log PHP errors.
* @default NN_LOGS . 'php_errors.log'
- * @note To log to syslog, put in 'syslog'
+ * @note To log to syslog, put in 'syslog'
* @version 4
*/
ini_set('error_log', NN_LOGS . 'php_errors.log');
@@ -617,12 +612,11 @@ if (stripos(PHP_SAPI, 'cli') !== false) {
/**
* Store the last PHP error in $php_errormsg
* @default '0'
- * @note This is a development/debugging option.
+ * @note This is a development/debugging option.
* @version 4
*/
ini_set('track_errors', '0');
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////// PHP Web Settings ///////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -630,8 +624,8 @@ if (stripos(PHP_SAPI, 'cli') !== false) {
/**
* Your server's local timezone.
- * @note Uncomment to enable.
- * @see https://secure.php.net/manual/en/timezones.php
+ * @note Uncomment to enable.
+ * @see https://secure.php.net/manual/en/timezones.php
* @version 4
*/
//ini_set('date.timezone', 'America/New_York');
@@ -645,7 +639,7 @@ if (stripos(PHP_SAPI, 'cli') !== false) {
/**
* Maximum amount of memory a PHP script can consume before being terminated.
- * @note Uncomment to enable.
+ * @note Uncomment to enable.
* @default '1024M'
* @version 4
*/
@@ -653,7 +647,7 @@ if (stripos(PHP_SAPI, 'cli') !== false) {
/**
* Show PHP errors on web browser.
- * @note Set to '1' for development.
+ * @note Set to '1' for development.
* @default '0'
* @version 4
*/
@@ -661,7 +655,7 @@ if (stripos(PHP_SAPI, 'cli') !== false) {
/**
* Show startup errors on web browser.
- * @note Set to '1' for development/debugging.
+ * @note Set to '1' for development/debugging.
* @default '0'
* @version 4
*/
@@ -669,12 +663,12 @@ if (stripos(PHP_SAPI, 'cli') !== false) {
/**
* Type of errors to display.
- * @note For development/debugging set to E_ALL
+ * @note For development/debugging set to E_ALL
* @default E_ALL & ~E_DEPRECATED & ~E_STRICT
- * @see https://secure.php.net/manual/en/errorfunc.constants.php
+ * @see https://secure.php.net/manual/en/errorfunc.constants.php
* @version 4
*/
- ini_set('error_reporting', E_ALL & ~E_DEPRECATED & ~E_STRICT);
+ ini_set('error_reporting', E_ALL);
/**
* Turn off HTML tags in error messages.
@@ -686,7 +680,7 @@ if (stripos(PHP_SAPI, 'cli') !== false) {
/**
* Set the location to log PHP errors.
* @default NN_LOGS . 'php_errors.log'
- * @note To log to syslog, put in 'syslog'
+ * @note To log to syslog, put in 'syslog'
* @version 4
*/
ini_set('error_log', NN_LOGS . 'php_errors.log');
@@ -708,11 +702,10 @@ if (stripos(PHP_SAPI, 'cli') !== false) {
/**
* Store the last PHP error in $php_errormsg
* @default '0'
- * @note This is a development/debugging option.
+ * @note This is a development/debugging option.
* @version 4
*/
ini_set('track_errors', '0');
-
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -737,7 +730,7 @@ if (extension_loaded('xdebug')) {
/**
* How many items in a array or object to display on var_dump.
- * @note Set to '-1' for no limit.
+ * @note Set to '-1' for no limit.
* @default '128'
* @version 4
*/
@@ -745,7 +738,7 @@ if (extension_loaded('xdebug')) {
/**
* Maximum string length on var_dump. (anything over is truncated)
- * @note Set to '-1' for no limit.
+ * @note Set to '-1' for no limit.
* @default '512'
* @version 4
*/
@@ -753,8 +746,8 @@ if (extension_loaded('xdebug')) {
/**
* How many nested arrays / objects deep to display on var_dump.
- * @note Set to '-1' for no limit.
- * @note Maximum value is '1023'
+ * @note Set to '-1' for no limit.
+ * @note Maximum value is '1023'
* @default '3'
* @version 4
*/
@@ -762,20 +755,20 @@ if (extension_loaded('xdebug')) {
}
/***********************************************************************************************************************
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////// Change log ////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-2015-08-26 v4 Add settings for PHP web/CLI SAPI's.
-Add settings for Xdebug.
-All new settings start from the "PHP CLI Settings" up to the "Change log", lines ~544 to ~768
-
-2015-06-11 v3 Add support for APC or APCu extensions for caching data. Search for @version 3 for the changes.
-
-2015-05-10 v2 Update path to find_password_hash_cost.php in comments. Search for @version 2 for the changes.
-
-2015-05-03 v1 Track settings.php.example changes.
-Add support for quick and low_priority on MySQL DELETE queries.
-Search for @version 1 in this file to quickly find these additions.
-
-//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/
+ * ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ * //////////////////////////////////////////////// Change log ////////////////////////////////////////////////////////////
+ * ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ *
+ * 2015-08-26 v4 Add settings for PHP web/CLI SAPI's.
+ * Add settings for Xdebug.
+ * All new settings start from the "PHP CLI Settings" up to the "Change log", lines ~544 to ~768
+ *
+ * 2015-06-11 v3 Add support for APC or APCu extensions for caching data. Search for @version 3 for the changes.
+ *
+ * 2015-05-10 v2 Update path to find_password_hash_cost.php in comments. Search for @version 2 for the changes.
+ *
+ * 2015-05-03 v1 Track settings.php.example changes.
+ * Add support for quick and low_priority on MySQL DELETE queries.
+ * Search for @version 1 in this file to quickly find these additions.
+ *
+ * //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/
diff --git a/newznab/controllers/ADE.php b/newznab/controllers/ADE.php
index a91942085..80dfb30c8 100644
--- a/newznab/controllers/ADE.php
+++ b/newznab/controllers/ADE.php
@@ -1,4 +1,5 @@
.
+ * @author niel
+ * @copyright 2015 nZEDb
+ */
+namespace newznab\controllers;
+
+
+class LoggerException extends \Exception
+{
+
+}
diff --git a/newznab/controllers/Logging.php b/newznab/controllers/Logging.php
index 6b5f01829..1d46e5709 100644
--- a/newznab/controllers/Logging.php
+++ b/newznab/controllers/Logging.php
@@ -1,4 +1,5 @@
userdata != null)
$role = $this->userdata["role"];
diff --git a/newznab/controllers/Popporn.php b/newznab/controllers/Popporn.php
index 7484fe1e2..82202f981 100644
--- a/newznab/controllers/Popporn.php
+++ b/newznab/controllers/Popporn.php
@@ -1,4 +1,5 @@
type = $t;
diff --git a/newznab/controllers/Sites.php b/newznab/controllers/Sites.php
index 8109c860d..0a73c5317 100644
--- a/newznab/controllers/Sites.php
+++ b/newznab/controllers/Sites.php
@@ -1,4 +1,5 @@
_pdo->queryExec(sprintf('UPDATE release_comments, releases SET release_comments.gid = releases.gid,
+ $affected = $this->_pdo->queryExec(sprintf('UPDATE release_comments, releases SET release_comments.gid = UNHEX(releases.nzb_guid),
release_comments.nzb_guid = UNHEX(releases.nzb_guid)
WHERE releases.id = release_comments.releaseid
AND release_comments.gid IS NULL
- AND UNHEX(release_comments.nzb_guid) = ""
+ AND UNHEX(release_comments.nzb_guid) = "0"
AND UNHEX(releases.nzb_guid) IS NOT NULL
AND releases.gid IS NOT NULL '
)
@@ -1247,10 +1248,10 @@ class SpotNab {
// Comments
$sql_new_cmt = "INSERT INTO release_comments (".
"id, sourceid, username, userid, gid, cid, isvisible, ".
- "releaseid, `text`, createddate, issynced, nzb_guid) VALUES (".
+ "releaseid, text, createddate, issynced, nzb_guid) VALUES (".
"NULL, %d, %s, 0, %s, %s, %d, 0, %s, %s, 1, UNHEX(%s))";
$sql_upd_cmt = "UPDATE release_comments SET ".
- "isvisible = %d, `text` = %s".
+ "isvisible = %d, text = %s".
"WHERE sourceid = %d AND gid = %s AND cid = %s AND nzb_guid = UNHEX(%s)";
$sql_fnd_cmt = "SELECT count(id) as cnt FROM release_comments ".
"WHERE sourceid = %d AND gid = %s AND cid = %s";
diff --git a/newznab/controllers/Steam.php b/newznab/controllers/Steam.php
index c71c31f08..fb0fe216b 100644
--- a/newznab/controllers/Steam.php
+++ b/newznab/controllers/Steam.php
@@ -1,4 +1,6 @@
{$row['setting']} = $row['value'];
}
@@ -275,7 +276,7 @@ class Tmux
public function row2Object($row)
{
- $obj = new stdClass;
+ $obj = new \stdClass;
$rowKeys = array_keys($row);
foreach ($rowKeys as $key) {
$obj->{$key} = $row[$key];
diff --git a/newznab/controllers/TmuxOutput.php b/newznab/controllers/TmuxOutput.php
index 463e4ba93..7d2da3d8e 100644
--- a/newznab/controllers/TmuxOutput.php
+++ b/newznab/controllers/TmuxOutput.php
@@ -1,4 +1,5 @@
_dateFormat = '%Y-%m-%d %T';
diff --git a/newznab/controllers/TraktTv.php b/newznab/controllers/TraktTv.php
index c7f398310..aa4f6316c 100644
--- a/newznab/controllers/TraktTv.php
+++ b/newznab/controllers/TraktTv.php
@@ -1,4 +1,5 @@
false,
'createDb' => false, // create dbname if it does not exist?
- 'ct' => new \ConsoleTools(),
+ 'ct' => new ConsoleTools(),
'dbhost' => defined('DB_HOST') ? DB_HOST : '',
'dbname' => defined('DB_NAME') ? DB_NAME : '',
'dbpass' => defined('DB_PASSWORD') ? DB_PASSWORD : '',
@@ -102,7 +106,7 @@ class DB extends \PDO
'dbsock' => defined('DB_SOCKET') ? DB_SOCKET : '',
'dbtype' => defined('DB_TYPE') ? DB_TYPE : '',
'dbuser' => defined('DB_USER') ? DB_USER : '',
- 'log' => new \ColorCLI(),
+ 'log' => new ColorCLI(),
'persist' => false,
];
$options += $defaults;
@@ -137,8 +141,8 @@ class DB extends \PDO
$this->_debug = (NN_DEBUG || NN_LOGGING);
if ($this->_debug) {
try {
- $this->debugging = new \Logger(['ColorCLI' => $this->log]);
- } catch (\LoggerException $error) {
+ $this->debugging = new Logger(['ColorCLI' => $this->log]);
+ } catch (LoggerException $error) {
$this->_debug = false;
}
}
@@ -222,8 +226,8 @@ class DB extends \PDO
{
$this->_debug = true;
try {
- $this->debugging = new \Logger(['ColorCLI' => $this->log]);
- } catch (\LoggerException $error) {
+ $this->debugging = new Logger(['ColorCLI' => $this->log]);
+ } catch (LoggerException $error) {
$this->_debug = false;
}
}
@@ -444,7 +448,7 @@ class DB extends \PDO
}
if ($this->_debug) {
$this->echoError($error, 'queryInsert', 4);
- $this->debugging->log(get_class(), __FUNCTION__, $query, \Logger::LOG_SQL);
+ $this->debugging->log(get_class(), __FUNCTION__, $query, Logger::LOG_SQL);
}
return false;
}
@@ -489,7 +493,7 @@ class DB extends \PDO
}
if ($silent === false && $this->_debug) {
$this->echoError($error, 'queryExec', 4);
- $this->debugging->log(get_class(), __FUNCTION__, $query, \Logger::LOG_SQL);
+ $this->debugging->log(get_class(), __FUNCTION__, $query, Logger::LOG_SQL);
}
return false;
}
@@ -588,7 +592,7 @@ class DB extends \PDO
$this->echoError($e->getMessage(), 'Exec', 4, false);
if ($this->_debug) {
- $this->debugging->log(get_class(), __FUNCTION__, $query, \Logger::LOG_SQL);
+ $this->debugging->log(get_class(), __FUNCTION__, $query, Logger::LOG_SQL);
}
}
@@ -747,7 +751,7 @@ class DB extends \PDO
if ($ignore === false) {
$this->echoError($e->getMessage(), 'queryDirect', 4, false);
if ($this->_debug) {
- $this->debugging->log(get_class(), __FUNCTION__, $query, \Logger::LOG_SQL);
+ $this->debugging->log(get_class(), __FUNCTION__, $query, Logger::LOG_SQL);
}
}
$result = false;
@@ -922,7 +926,7 @@ class DB extends \PDO
}
if ($this->_debug) {
- $this->debugging->log(get_class(), __FUNCTION__, $message, \Logger::LOG_INFO);
+ $this->debugging->log(get_class(), __FUNCTION__, $message, Logger::LOG_INFO);
}
}
@@ -1062,7 +1066,7 @@ class DB extends \PDO
$PDOstatement = $this->pdo->prepare($query, $options);
} catch (\PDOException $e) {
if ($this->_debug) {
- $this->debugging->log(get_class(), __FUNCTION__, $e->getMessage(), \Logger::LOG_INFO);
+ $this->debugging->log(get_class(), __FUNCTION__, $e->getMessage(), Logger::LOG_INFO);
}
echo $this->log->error("\n" . $e->getMessage());
$PDOstatement = false;
@@ -1085,7 +1089,7 @@ class DB extends \PDO
$result = $this->pdo->getAttribute($attribute);
} catch (\PDOException $e) {
if ($this->_debug) {
- $this->debugging->log(get_class(), __FUNCTION__, $e->getMessage(), \Logger::LOG_INFO);
+ $this->debugging->log(get_class(), __FUNCTION__, $e->getMessage(), Logger::LOG_INFO);
}
echo $this->log->error("\n" . $e->getMessage());
$result = false;
diff --git a/newznab/db/DbUpdate.php b/newznab/db/DbUpdate.php
index c895fe6f3..d92fa5022 100644
--- a/newznab/db/DbUpdate.php
+++ b/newznab/db/DbUpdate.php
@@ -22,7 +22,7 @@ namespace newznab\db;
use newznab\utility\Git;
use newznab\utility\Utility;
-use ColorCLI;
+use newznab\controllers\ColorCLI;
class DbUpdate
diff --git a/newznab/db/Settings.php b/newznab/db/Settings.php
index 7d9ac14ef..4311a2f6e 100644
--- a/newznab/db/Settings.php
+++ b/newznab/db/Settings.php
@@ -20,10 +20,6 @@
*/
namespace newznab\db;
-if (!defined('NN_INSTALLER')) {
- require_once dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'www' . DIRECTORY_SEPARATOR . 'config.php';
-}
-
use newznab\utility\Utility;
use newznab\utility\Versions;
diff --git a/newznab/processing/PostProcess.php b/newznab/processing/PostProcess.php
index 8078afcc1..4fc7a48a2 100644
--- a/newznab/processing/PostProcess.php
+++ b/newznab/processing/PostProcess.php
@@ -4,6 +4,23 @@ namespace newznab\processing;
use \newznab\db\Settings;
use \newznab\processing\post\AniDB;
use \newznab\processing\post\ProcessAdditional;
+use newznab\controllers\Logger;
+use newznab\controllers\NameFixer;
+use newznab\controllers\Groups;
+use newznab\controllers\Nfo;
+use newznab\controllers\ReleaseFiles;
+use newznab\controllers\Category;
+use newznab\controllers\Books;
+use newznab\controllers\Console;
+use newznab\controllers\Movie;
+use newznab\controllers\TvRage;
+use newznab\controllers\XXX;
+use newznab\controllers\Sharing;
+use newznab\controllers\Games;
+use newznab\controllers\Music;
+use newznab\controllers\NNTP;
+use newznab\controllers\TheTVDB;
+use newznab\controllers\SpotNab;
require_once NN_LIBS . 'rarinfo/par2info.php';
@@ -17,13 +34,13 @@ class PostProcess
/**
* Class instance of debugging.
*
- * @var \Logger
+ * @var Logger
*/
protected $debugging;
/**
* Instance of NameFixer.
- * @var \NameFixer
+ * @var NameFixer
*/
protected $nameFixer;
@@ -51,17 +68,17 @@ class PostProcess
private $echooutput;
/**
- * @var \Groups
+ * @var Groups
*/
private $groups;
/**
- * @var \Nfo
+ * @var Nfo
*/
private $Nfo;
/**
- * @var \ReleaseFiles
+ * @var ReleaseFiles
*/
private $releaseFiles;
@@ -86,16 +103,14 @@ class PostProcess
//\\ Various.
$this->echooutput = ($options['Echo'] && NN_ECHOCLI);
//\\
- $s = new \Sites();
- $this->site = $s->get();
//\\ Class instances.
$this->pdo = (($options['Settings'] instanceof Settings) ? $options['Settings'] : new Settings());
- $this->groups = (($options['Groups'] instanceof \Groups) ? $options['Groups'] : new \Groups());
+ $this->groups = (($options['Groups'] instanceof Groups) ? $options['Groups'] : new Groups());
$this->_par2Info = new \Par2Info();
- $this->debugging = ($options['Logger'] instanceof \Logger ? $options['Logger'] : new \Logger(['ColorCLI' => $this->pdo->log]));
- $this->nameFixer = (($options['NameFixer'] instanceof \NameFixer) ? $options['NameFixer'] : new \NameFixer(['Echo' => $this->echooutput, 'Settings' => $this->pdo, 'Groups' => $this->groups]));
- $this->Nfo = (($options['Nfo'] instanceof \Nfo ) ? $options['Nfo'] : new \Nfo(['Echo' => $this->echooutput, 'Settings' => $this->pdo]));
- $this->releaseFiles = (($options['ReleaseFiles'] instanceof \ReleaseFiles) ? $options['ReleaseFiles'] : new \ReleaseFiles($this->pdo));
+ $this->debugging = ($options['Logger'] instanceof Logger ? $options['Logger'] : new Logger(['ColorCLI' => $this->pdo->log]));
+ $this->nameFixer = (($options['NameFixer'] instanceof NameFixer) ? $options['NameFixer'] : new NameFixer(['Echo' => $this->echooutput, 'Settings' => $this->pdo, 'Groups' => $this->groups]));
+ $this->Nfo = (($options['Nfo'] instanceof Nfo ) ? $options['Nfo'] : new Nfo(['Echo' => $this->echooutput, 'Settings' => $this->pdo]));
+ $this->releaseFiles = (($options['ReleaseFiles'] instanceof ReleaseFiles) ? $options['ReleaseFiles'] : new ReleaseFiles($this->pdo));
//\\
//\\ Site settings.
@@ -148,7 +163,7 @@ class PostProcess
public function processBooks()
{
if ($this->pdo->getSetting('lookupbooks') != 0) {
- (new \Books(['Echo' => $this->echooutput, 'Settings' => $this->pdo, ]))->processBookReleases();
+ (new Books(['Echo' => $this->echooutput, 'Settings' => $this->pdo, ]))->processBookReleases();
}
}
@@ -160,7 +175,7 @@ class PostProcess
public function processConsoles()
{
if ($this->pdo->getSetting('lookupgames') != 0) {
- (new \Console(['Settings' => $this->pdo, 'Echo' => $this->echooutput]))->processConsoleReleases();
+ (new Console(['Settings' => $this->pdo, 'Echo' => $this->echooutput]))->processConsoleReleases();
}
}
@@ -172,7 +187,7 @@ class PostProcess
public function processGames()
{
if ($this->pdo->getSetting('lookupgames') != 0) {
- (new \Games(['Echo' => $this->echooutput, 'Settings' => $this->pdo]))->processGamesReleases();
+ (new Games(['Echo' => $this->echooutput, 'Settings' => $this->pdo]))->processGamesReleases();
}
}
@@ -190,7 +205,7 @@ class PostProcess
{
$processMovies = (is_numeric($processMovies) ? $processMovies : $this->pdo->getSetting('lookupimdb'));
if ($processMovies > 0) {
- (new \Movie(['Echo' => $this->echooutput, 'Settings' => $this->pdo]))->processMovieReleases($groupID, $guidChar, $processMovies);
+ (new Movie(['Echo' => $this->echooutput, 'Settings' => $this->pdo]))->processMovieReleases($groupID, $guidChar, $processMovies);
}
}
@@ -202,14 +217,14 @@ class PostProcess
public function processMusic()
{
if ($this->pdo->getSetting('lookupmusic') != 0) {
- (new \Music(['Echo' => $this->echooutput, 'Settings' => $this->pdo]))->processMusicReleases();
+ (new Music(['Echo' => $this->echooutput, 'Settings' => $this->pdo]))->processMusicReleases();
}
}
/**
* Process nfo files.
*
- * @param \NNTP $nntp
+ * @param NNTP $nntp
* @param string $groupID (Optional) id of a group to work on.
* @param string $guidChar (Optional) First letter of a release GUID to use to get work.
*
@@ -227,7 +242,7 @@ class PostProcess
*/
public function processSpotnab()
{
- $spotnab = new \SpotNab();
+ $spotnab = new SpotNab();
$processed = $spotnab->processGID(500);
if ($processed > 0) {
if ($this->echooutput) {
@@ -250,7 +265,7 @@ class PostProcess
*/
public function processSharing(&$nntp)
{
- (new \Sharing(['Settings' => $this->pdo, 'NNTP' => $nntp]))->start();
+ (new Sharing(['Settings' => $this->pdo, 'NNTP' => $nntp]))->start();
}
/**
@@ -267,7 +282,7 @@ class PostProcess
{
$processTV = (is_numeric($processTV) ? $processTV : $this->pdo->getSetting('lookuptvrage'));
if ($processTV > 0) {
- (new \TvRage(['Echo' => $this->echooutput, 'Settings' => $this->pdo]))->processTvReleases($groupID, $guidChar, $processTV);
+ (new TvRage(['Echo' => $this->echooutput, 'Settings' => $this->pdo]))->processTvReleases($groupID, $guidChar, $processTV);
}
}
@@ -275,7 +290,7 @@ class PostProcess
{
if ($this->pdo->getSetting('lookupthetvdb') == 1)
{
- $thetvdb = new \TheTVDB($this->echooutput);
+ $thetvdb = new TheTVDB($this->echooutput);
$thetvdb->processReleases();
}
}
@@ -286,7 +301,7 @@ class PostProcess
public function processXXX()
{
if ($this->pdo->getSetting('lookupxxx') == 1) {
- (new \XXX(['Echo' => $this->echooutput, 'Settings' => $this->pdo]))->processXXXReleases();
+ (new XXX(['Echo' => $this->echooutput, 'Settings' => $this->pdo]))->processXXXReleases();
}
}
@@ -295,7 +310,7 @@ class PostProcess
*
* @note Called externally by tmux/bin/update_per_group and update/postprocess.php
*
- * @param \NNTP $nntp Class NNTP
+ * @param NNTP $nntp Class NNTP
* @param int|string $groupID (Optional) id of a group to work on.
* @param string $guidChar (Optional) First char of release GUID, can be used to select work.
*
@@ -314,7 +329,7 @@ class PostProcess
* @param string $messageID MessageID from NZB file.
* @param int $relID id of the release.
* @param int $groupID Group id of the release.
- * @param \NNTP $nntp Class NNTP
+ * @param NNTP $nntp Class NNTP
* @param int $show Only show result or apply iy.
*
* @return bool
@@ -344,15 +359,15 @@ class PostProcess
if (!in_array(
(int)$query['categoryid'],
array(
- \Category::CAT_BOOK_OTHER,
- \Category::CAT_GAME_OTHER,
- \Category::CAT_MOVIE_OTHER,
- \Category::CAT_MUSIC_OTHER,
- \Category::CAT_PC_MOBILEOTHER,
- \Category::CAT_TV_OTHER,
- \Category::CAT_MISC_HASHED,
- \Category::CAT_XXX_OTHER,
- \Category::CAT_MISC_OTHER
+ Category::CAT_BOOK_OTHER,
+ Category::CAT_GAME_OTHER,
+ Category::CAT_MOVIE_OTHER,
+ Category::CAT_MUSIC_OTHER,
+ Category::CAT_PC_MOBILEOTHER,
+ Category::CAT_TV_OTHER,
+ Category::CAT_MISC_HASHED,
+ Category::CAT_XXX_OTHER,
+ Category::CAT_MISC_OTHER
)
)
) {
diff --git a/newznab/processing/ProcessReleases.php b/newznab/processing/ProcessReleases.php
index 1e7211237..403fa5066 100644
--- a/newznab/processing/ProcessReleases.php
+++ b/newznab/processing/ProcessReleases.php
@@ -2,6 +2,18 @@
namespace newznab\processing;
use newznab\db\Settings;
+use newznab\controllers\Groups;
+use newznab\controllers\ConsoleTools;
+use newznab\controllers\Releases;
+use newznab\controllers\ReleaseCleaning;
+use newznab\controllers\ReleaseImage;
+use newznab\controllers\NZB;
+use newznab\controllers\Categorize;
+use newznab\controllers\Category;
+use newznab\controllers\RequestIDLocal;
+use newznab\controllers\RequestIDWeb;
+use newznab\controllers\PreHash;
+use newznab\controllers\Genres;
class ProcessReleases
{
@@ -18,7 +30,7 @@ class ProcessReleases
const FILE_COMPLETE = 1; // We have all the parts for the file (binaries table partcheck column).
/**
- * @var \Groups
+ * @var Groups
*/
public $groups;
@@ -63,27 +75,27 @@ class ProcessReleases
public $pdo;
/**
- * @var \ConsoleTools
+ * @var ConsoleTools
*/
public $consoleTools;
/**
- * @var \NZB
+ * @var NZB
*/
public $nzb;
/**
- * @var \ReleaseCleaning
+ * @var ReleaseCleaning
*/
public $releaseCleaning;
/**
- * @var \Releases
+ * @var Releases
*/
public $releases;
/**
- * @var \ReleaseImage
+ * @var ReleaseImage
*/
public $releaseImage;
@@ -112,12 +124,12 @@ class ProcessReleases
$this->echoCLI = ($options['Echo'] && NN_ECHOCLI);
$this->pdo = ($options['Settings'] instanceof Settings ? $options['Settings'] : new Settings());
- $this->consoleTools = ($options['ConsoleTools'] instanceof \ConsoleTools ? $options['ConsoleTools'] : new \ConsoleTools(['ColorCLI' => $this->pdo->log]));
- $this->groups = ($options['Groups'] instanceof \Groups ? $options['Groups'] : new \Groups(['Settings' => $this->pdo]));
- $this->nzb = ($options['NZB'] instanceof \NZB ? $options['NZB'] : new \NZB($this->pdo));
- $this->releaseCleaning = ($options['ReleaseCleaning'] instanceof \ReleaseCleaning ? $options['ReleaseCleaning'] : new \ReleaseCleaning($this->pdo));
- $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));
+ $this->consoleTools = ($options['ConsoleTools'] instanceof ConsoleTools ? $options['ConsoleTools'] : new ConsoleTools(['ColorCLI' => $this->pdo->log]));
+ $this->groups = ($options['Groups'] instanceof Groups ? $options['Groups'] : new Groups(['Settings' => $this->pdo]));
+ $this->nzb = ($options['NZB'] instanceof NZB ? $options['NZB'] : new NZB($this->pdo));
+ $this->releaseCleaning = ($options['ReleaseCleaning'] instanceof ReleaseCleaning ? $options['ReleaseCleaning'] : new ReleaseCleaning($this->pdo));
+ $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));
$this->tablePerGroup = ($this->pdo->getSetting('tablepergroup') == 0 ? false : true);
$this->collectionDelayTime = ($this->pdo->getSetting('delaytime') != '' ? (int)$this->pdo->getSetting('delaytime') : 2);
@@ -138,7 +150,7 @@ class ProcessReleases
* @param int $categorize
* @param int $postProcess
* @param string $groupName (optional)
- * @param \NNTP $nntp
+ * @param NNTP $nntp
* @param bool $echooutput
*
* @return int
@@ -258,7 +270,7 @@ class ProcessReleases
*/
public function categorizeRelease($type, $where = '')
{
- $cat = new \Categorize(['Settings' => $this->pdo]);
+ $cat = new Categorize(['Settings' => $this->pdo]);
$categorized = $total = 0;
$releases = $this->pdo->queryDirect(sprintf('SELECT id, %s, groupid FROM releases %s', $type, $where));
if ($releases && $releases->rowCount()) {
@@ -508,7 +520,7 @@ class ProcessReleases
$startTime = time();
$group = $this->groups->getCBPTableNames($this->tablePerGroup, $groupID);
- $categorize = new \Categorize(['Settings' => $this->pdo]);
+ $categorize = new Categorize(['Settings' => $this->pdo]);
$returnCount = $duplicate = 0;
if ($this->echoCLI) {
@@ -539,7 +551,7 @@ class ProcessReleases
}
if ($collections instanceof \Traversable) {
- $preDB = new \PreHash(['Echo' => $this->echoCLI, 'Settings' => $this->pdo]);
+ $preDB = new PreHash(['Echo' => $this->echoCLI, 'Settings' => $this->pdo]);
foreach ($collections as $collection) {
@@ -609,7 +621,7 @@ class ProcessReleases
'isrenamed' => ($properName === true ? 1 : 0),
'reqidstatus' => ($isReqID === true ? 1 : 0),
'prehashid' => ($preID === false ? 0 : $preID),
- 'nzbstatus' => \NZB::NZB_NONE
+ 'nzbstatus' => NZB::NZB_NONE
]
);
@@ -757,14 +769,14 @@ class ProcessReleases
if ($local === true) {
$foundRequestIDs = (
- new \RequestIDLocal(
+ new RequestIDLocal(
['Echo' => $this->echoCLI, 'ConsoleTools' => $this->consoleTools,
'Groups' => $this->groups, 'Settings' => $this->pdo]
)
)->lookupRequestIDs(['GroupID' => $groupID, 'limit' => $limit, 'time' => 168]);
} else {
$foundRequestIDs = (
- new \RequestIDWeb(
+ new RequestIDWeb(
['Echo' => $this->echoCLI, 'ConsoleTools' => $this->consoleTools,
'Groups' => $this->groups, 'Settings' => $this->pdo]
)
@@ -820,7 +832,7 @@ class ProcessReleases
* Post-process releases.
*
* @param int $postProcess
- * @param \NNTP $nntp
+ * @param NNTP $nntp
*
* @void
* @access public
@@ -1157,8 +1169,8 @@ class ProcessReleases
public function deleteReleases()
{
$startTime = time();
- $category = new \Category(['Settings' => $this->pdo]);
- $genres = new \Genres(['Settings' => $this->pdo]);
+ $category = new Category(['Settings' => $this->pdo]);
+ $genres = new Genres(['Settings' => $this->pdo]);
$passwordDeleted = $duplicateDeleted = $retentionDeleted = $completionDeleted = $disabledCategoryDeleted = 0;
$disabledGenreDeleted = $miscRetentionDeleted = $miscHashedDeleted = $categoryMinSizeDeleted = 0;
@@ -1188,7 +1200,7 @@ class ProcessReleases
$releases = $this->pdo->queryDirect(
sprintf(
'SELECT id, guid FROM releases WHERE passwordstatus = %d',
- \Releases::PASSWD_RAR
+ Releases::PASSWD_RAR
)
);
if ($releases instanceof \Traversable) {
@@ -1204,7 +1216,7 @@ class ProcessReleases
$releases = $this->pdo->queryDirect(
sprintf(
'SELECT id, guid FROM releases WHERE passwordstatus = %d',
- \Releases::PASSWD_POTENTIAL
+ Releases::PASSWD_POTENTIAL
)
);
if ($releases instanceof \Traversable) {
@@ -1325,7 +1337,7 @@ class ProcessReleases
FROM releases
WHERE categoryid = %d
AND adddate <= NOW() - INTERVAL %d HOUR',
- \Category::CAT_MISC_OTHER,
+ Category::CAT_MISC_OTHER,
$this->pdo->getSetting('miscotherretentionhours')
)
);
@@ -1345,7 +1357,7 @@ class ProcessReleases
FROM releases
WHERE categoryid = %d
AND adddate <= NOW() - INTERVAL %d HOUR',
- \Category::CAT_MISC_HASHED,
+ Category::CAT_MISC_HASHED,
$this->pdo->getSetting('mischashedretentionhours')
)
);
diff --git a/newznab/processing/post/AniDB.php b/newznab/processing/post/AniDB.php
index 50a7af039..46813474a 100644
--- a/newznab/processing/post/AniDB.php
+++ b/newznab/processing/post/AniDB.php
@@ -2,6 +2,8 @@
namespace newznab\processing\post;
use \newznab\db\Settings;
+use newznab\controllers\NZB;
+use newznab\controllers\Category;
class AniDB
{
@@ -48,8 +50,6 @@ class AniDB
$this->echooutput = ($options['Echo'] && NN_ECHOCLI);
$this->pdo = ($options['Settings'] instanceof Settings ? $options['Settings'] : new Settings());
- $s = new \Sites();
- $this->site = $s->get();
$qty = $this->pdo->getSetting('maxanidbprocessed');
$this->aniqty = !empty($qty) ? $qty : 100;
@@ -71,8 +71,8 @@ class AniDB
AND categoryid = %d
ORDER BY postdate DESC
LIMIT %d',
- \NZB::NZB_ADDED,
- \Category::CAT_TV_ANIME,
+ NZB::NZB_ADDED,
+ Category::CAT_TV_ANIME,
$this->aniqty
)
);
diff --git a/newznab/processing/post/ProcessAdditional.php b/newznab/processing/post/ProcessAdditional.php
index 8e44ebbe0..89b5a93de 100644
--- a/newznab/processing/post/ProcessAdditional.php
+++ b/newznab/processing/post/ProcessAdditional.php
@@ -6,6 +6,16 @@ require_once NN_LIBS . 'rarinfo/par2info.php';
use newznab\db\Settings;
use newznab\utility\Utility;
+use newznab\controllers\NZB;
+use newznab\controllers\Groups;
+use newznab\controllers\NNTP;
+use newznab\controllers\Categorize;
+use newznab\controllers\Nfo;
+use newznab\controllers\ReleaseFiles;
+use newznab\controllers\ReleaseExtra;
+use newznab\controllers\ReleaseImage;
+use newznab\controllers\NameFixer;
+use newznab\controllers\SphinxSearch;
class ProcessAdditional
{
@@ -45,7 +55,7 @@ class ProcessAdditional
protected $_release;
/**
- * @var \NZB
+ * @var NZB
*/
protected $_nzb;
@@ -56,7 +66,7 @@ class ProcessAdditional
protected $_nzbContents;
/**
- * @var \Groups
+ * @var Groups
*/
protected $_groups;
@@ -161,37 +171,37 @@ class ProcessAdditional
protected $_echoCLI;
/**
- * @var \NNTP
+ * @var NNTP
*/
protected $_nntp;
/**
- * @var \ReleaseFiles
+ * @var ReleaseFiles
*/
protected $_releaseFiles;
/**
- * @var \Categorize
+ * @var Categorize
*/
protected $_categorize;
/**
- * @var \NameFixer
+ * @var NameFixer
*/
protected $_nameFixer;
/**
- * @var \ReleaseExtra
+ * @var ReleaseExtra
*/
protected $_releaseExtra;
/**
- * @var \ReleaseImage
+ * @var ReleaseImage
*/
protected $_releaseImage;
/**
- * @var \Nfo
+ * @var Nfo
*/
protected $_nfo;
@@ -285,21 +295,19 @@ class ProcessAdditional
$this->_echoDebug = NN_DEBUG;
$this->pdo = ($options['Settings'] instanceof Settings ? $options['Settings'] : new Settings());
- $this->_nntp = ($options['NNTP'] instanceof \NNTP ? $options['NNTP'] : new \NNTP(['Echo' => $this->_echoCLI, 'Settings' => $this->pdo]));
+ $this->_nntp = ($options['NNTP'] instanceof NNTP ? $options['NNTP'] : new NNTP(['Echo' => $this->_echoCLI, 'Settings' => $this->pdo]));
- $this->_nzb = ($options['NZB'] instanceof \NZB ? $options['NZB'] : new \NZB($this->pdo));
- $this->_groups = ($options['Groups'] instanceof \Groups ? $options['Groups'] : new \Groups(['Settings' => $this->pdo]));
+ $this->_nzb = ($options['NZB'] instanceof NZB ? $options['NZB'] : new NZB($this->pdo));
+ $this->_groups = ($options['Groups'] instanceof Groups ? $options['Groups'] : new Groups(['Settings' => $this->pdo]));
$this->_archiveInfo = new \ArchiveInfo();
- $this->_releaseFiles = ($options['ReleaseFiles'] instanceof \ReleaseFiles ? $options['ReleaseFiles'] : new \ReleaseFiles($this->pdo));
- $this->_categorize = ($options['Categorize'] instanceof \Categorize ? $options['Categorize'] : new \Categorize(['Settings' => $this->pdo]));
- $this->_nameFixer = ($options['NameFixer'] instanceof \NameFixer ? $options['NameFixer'] : new \NameFixer(['Echo' =>$this->_echoCLI, 'Groups' => $this->_groups, 'Settings' => $this->pdo, 'Categorize' => $this->_categorize]));
- $this->_releaseExtra = ($options['ReleaseExtra'] instanceof \ReleaseExtra ? $options['ReleaseExtra'] : new \ReleaseExtra($this->pdo));
- $this->_releaseImage = ($options['ReleaseImage'] instanceof \ReleaseImage ? $options['ReleaseImage'] : new \ReleaseImage($this->pdo));
+ $this->_releaseFiles = ($options['ReleaseFiles'] instanceof ReleaseFiles ? $options['ReleaseFiles'] : new ReleaseFiles($this->pdo));
+ $this->_categorize = ($options['Categorize'] instanceof Categorize ? $options['Categorize'] : new Categorize(['Settings' => $this->pdo]));
+ $this->_nameFixer = ($options['NameFixer'] instanceof NameFixer ? $options['NameFixer'] : new NameFixer(['Echo' =>$this->_echoCLI, 'Groups' => $this->_groups, 'Settings' => $this->pdo, 'Categorize' => $this->_categorize]));
+ $this->_releaseExtra = ($options['ReleaseExtra'] instanceof ReleaseExtra ? $options['ReleaseExtra'] : new ReleaseExtra($this->pdo));
+ $this->_releaseImage = ($options['ReleaseImage'] instanceof ReleaseImage ? $options['ReleaseImage'] : new ReleaseImage($this->pdo));
$this->_par2Info = new \Par2Info();
- $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());
- $s = new \Sites();
- $this->site = $s->get();
+ $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 = ($this->pdo->getSetting('innerfileblacklist') == '' ? false : $this->pdo->getSetting('innerfileblacklist'));
$this->_maxNestedLevels = ($this->pdo->getSetting('maxnestedlevels') == 0 ? 3 : $this->pdo->getSetting('maxnestedlevels'));
diff --git a/newznab/utility/Utility.php b/newznab/utility/Utility.php
index bcd5ee17f..4d6c7d2eb 100644
--- a/newznab/utility/Utility.php
+++ b/newznab/utility/Utility.php
@@ -2,7 +2,7 @@
namespace newznab\utility;
use newznab\db\Settings;
-use ColorCLI;
+use newznab\controllers\ColorCLI;
use PHPMailer;
diff --git a/newznab/utility/Versions.php b/newznab/utility/Versions.php
index fca54af84..440259049 100644
--- a/newznab/utility/Versions.php
+++ b/newznab/utility/Versions.php
@@ -5,7 +5,7 @@ if (!defined('GIT_PRE_COMMIT')) {
define('GIT_PRE_COMMIT', false);
}
-use ColorCLI;
+use newznab\controllers\ColorCLI;
class Versions
{
diff --git a/resources/db/patches/0001_tmux.sql b/resources/db/patches/0001_tmux.sql
index 8de0a3a0f..c4dd0ac85 100644
--- a/resources/db/patches/0001_tmux.sql
+++ b/resources/db/patches/0001_tmux.sql
@@ -1,3 +1 @@
-DELETE FROM `tmux` WHERE `setting` = 'releases_threaded';
-
-UPDATE `tmux` set `value` = '1' where `setting` = 'sqlpatch';
\ No newline at end of file
+DELETE FROM `tmux` WHERE `setting` = 'releases_threaded';
\ No newline at end of file
diff --git a/resources/db/patches/0002_tmux.sql b/resources/db/patches/0002_tmux.sql
index 4a02cf8c8..5990f48ac 100644
--- a/resources/db/patches/0002_tmux.sql
+++ b/resources/db/patches/0002_tmux.sql
@@ -6,6 +6,4 @@ DELETE FROM `tmux` WHERE `setting` = 'optimize_timer';
INSERT IGNORE INTO `tmux` (`setting`, `value`) VALUES ('sphinx', '0'),
('sphinx_timer', '600'),
('delete_parts', '0'),
- ('delete_timer', '43200');
-
-UPDATE `tmux` set `value` = '2' where `setting` = 'sqlpatch';
\ No newline at end of file
+ ('delete_timer', '43200');
\ No newline at end of file
diff --git a/resources/db/patches/0004_tmux.sql b/resources/db/patches/0004_tmux.sql
index 42b29a7e1..943ba7420 100644
--- a/resources/db/patches/0004_tmux.sql
+++ b/resources/db/patches/0004_tmux.sql
@@ -1,3 +1 @@
-INSERT IGNORE INTO `tmux` (`setting`, `value`) VALUES ('partrepair', 1);
-
-UPDATE `tmux` set `value` = '4' where `setting` = 'sqlpatch';
\ No newline at end of file
+INSERT IGNORE INTO `tmux` (`setting`, `value`) VALUES ('partrepair', 1);
\ No newline at end of file
diff --git a/resources/db/patches/0005_releases.sql b/resources/db/patches/0005_releases.sql
index 39a2cb88c..6138b87d2 100644
--- a/resources/db/patches/0005_releases.sql
+++ b/resources/db/patches/0005_releases.sql
@@ -1,3 +1 @@
-ALTER TABLE `releases` DROP COLUMN `nzbstatus`;
-
-UPDATE `tmux` set `value` = '5' where `setting` = 'sqlpatch';
\ No newline at end of file
+ALTER TABLE `releases` DROP COLUMN `nzbstatus`;
\ No newline at end of file
diff --git a/resources/db/patches/0006_tmux.sql b/resources/db/patches/0006_tmux.sql
index 5e6d12b05..54c52798d 100644
--- a/resources/db/patches/0006_tmux.sql
+++ b/resources/db/patches/0006_tmux.sql
@@ -1,3 +1 @@
-INSERT IGNORE INTO `tmux` (`setting`, `value`) VALUES ('zippath', '');
-
-UPDATE `tmux` set `value` = '6' where `setting` = 'sqlpatch';
\ No newline at end of file
+INSERT IGNORE INTO `tmux` (`setting`, `value`) VALUES ('zippath', '');
\ No newline at end of file
diff --git a/resources/db/patches/0007_releases_tmux.sql b/resources/db/patches/0007_releases_tmux.sql
index 9866eb087..f0ffcccec 100644
--- a/resources/db/patches/0007_releases_tmux.sql
+++ b/resources/db/patches/0007_releases_tmux.sql
@@ -1,4 +1,2 @@
ALTER TABLE `releases` ADD `jpgstatus` TINYINT(1) NOT NULL DEFAULT 0;
-INSERT IGNORE INTO `tmux` (`setting`, `value`) VALUES ('processjpg', 0);
-
-UPDATE `tmux` set `value` = '7' where `setting` = 'sqlpatch';
\ No newline at end of file
+INSERT IGNORE INTO `tmux` (`setting`, `value`) VALUES ('processjpg', 0);
\ No newline at end of file
diff --git a/resources/db/patches/0008_releases.sql b/resources/db/patches/0008_releases.sql
index df3af6e57..4d83d6697 100644
--- a/resources/db/patches/0008_releases.sql
+++ b/resources/db/patches/0008_releases.sql
@@ -1,3 +1 @@
-ALTER TABLE `releases` ADD `prehashid` INT(12) NULL DEFAULT NULL;
-
-UPDATE `tmux` set `value` = '8' where `setting` = 'sqlpatch';
\ No newline at end of file
+ALTER TABLE `releases` ADD `prehashid` INT(12) NULL DEFAULT NULL;
\ No newline at end of file
diff --git a/resources/db/patches/0009_releases.sql b/resources/db/patches/0009_releases.sql
index 912b67608..783d6a5f3 100644
--- a/resources/db/patches/0009_releases.sql
+++ b/resources/db/patches/0009_releases.sql
@@ -1,2 +1 @@
-ALTER TABLE `releases` CHANGE COLUMN `prehashid` `prehashid` INT UNSIGNED NOT NULL DEFAULT '0';
-UPDATE `tmux` set `value` = '9' where `setting` = 'sqlpatch';
\ No newline at end of file
+ALTER TABLE `releases` CHANGE COLUMN `prehashid` `prehashid` INT UNSIGNED NOT NULL DEFAULT '0';
\ No newline at end of file
diff --git a/resources/db/patches/0010_releases.sql b/resources/db/patches/0010_releases.sql
index a342cca19..9adb8ef5f 100644
--- a/resources/db/patches/0010_releases.sql
+++ b/resources/db/patches/0010_releases.sql
@@ -1,2 +1 @@
-ALTER TABLE `releases` ADD INDEX `ix_releases_prehashid_searchname` (`prehashid`, `searchname`);
-UPDATE `tmux` set `value` = '10' where `setting` = 'sqlpatch';
\ No newline at end of file
+ALTER TABLE `releases` ADD INDEX `ix_releases_prehashid_searchname` (`prehashid`, `searchname`);
\ No newline at end of file
diff --git a/resources/db/patches/0011_prehash.sql b/resources/db/patches/0011_prehash.sql
index d3b69d8e1..e04b8e02c 100644
--- a/resources/db/patches/0011_prehash.sql
+++ b/resources/db/patches/0011_prehash.sql
@@ -1,3 +1,2 @@
ALTER TABLE `prehash` ADD INDEX `ix_prehash_size` (`size`);
-ALTER TABLE `prehash` ADD INDEX `ix_prehash_category` (`category`);
-UPDATE `tmux` set `value` = '11' where `setting` = 'sqlpatch';
\ No newline at end of file
+ALTER TABLE `prehash` ADD INDEX `ix_prehash_category` (`category`);
\ No newline at end of file
diff --git a/resources/db/patches/0012_prehash.sql b/resources/db/patches/0012_prehash.sql
index 777c03ccb..d6f9450f2 100644
--- a/resources/db/patches/0012_prehash.sql
+++ b/resources/db/patches/0012_prehash.sql
@@ -5,6 +5,4 @@ ALTER TABLE prehash ADD COLUMN nuked TINYINT(1) NOT NULL DEFAULT '0';
ALTER TABLE prehash ADD COLUMN nukereason VARCHAR(255) NULL;
/* How many files does this pre have ? */
-ALTER TABLE prehash ADD COLUMN files VARCHAR(50) NULL;
-
-UPDATE tmux SET value = '12' WHERE setting = 'sqlpatch';
\ No newline at end of file
+ALTER TABLE prehash ADD COLUMN files VARCHAR(50) NULL;
\ No newline at end of file
diff --git a/resources/db/patches/0013_tmux.sql b/resources/db/patches/0013_tmux.sql
index 3a88e5f8f..d79a75d66 100644
--- a/resources/db/patches/0013_tmux.sql
+++ b/resources/db/patches/0013_tmux.sql
@@ -1,4 +1,2 @@
INSERT IGNORE INTO tmux (setting, value) VALUE ('scrape_cz', 0);
INSERT IGNORE INTO tmux (setting, value) VALUE ('scrape_efnet', 0);
-
-UPDATE tmux SET value = '13' WHERE setting = 'sqlpatch';
diff --git a/resources/db/patches/0014_prehash.sql b/resources/db/patches/0014_prehash.sql
index 1ab9336ba..fa3ec74ce 100644
--- a/resources/db/patches/0014_prehash.sql
+++ b/resources/db/patches/0014_prehash.sql
@@ -5,6 +5,4 @@ ALTER TABLE prehash DROP INDEX ix_prehash_adddate;
ALTER TABLE prehash DROP COLUMN adddate;
/* Use tmux table to keep the last pre time (unixtime) */
-INSERT INTO tmux (setting, value) VALUES ('lastpretime', '0');
-
-UPDATE tmux SET value = '14' WHERE setting = 'sqlpatch';
\ No newline at end of file
+INSERT INTO tmux (setting, value) VALUES ('lastpretime', '0');
\ No newline at end of file
diff --git a/resources/db/patches/0015_sharing.sql b/resources/db/patches/0015_sharing.sql
index beffbb203..c0f552398 100644
--- a/resources/db/patches/0015_sharing.sql
+++ b/resources/db/patches/0015_sharing.sql
@@ -30,5 +30,3 @@ ALTER TABLE releasecomment ADD COLUMN shared TINYINT(1) NOT NULL DEFAULT '1';
ALTER TABLE releasecomment ADD COLUMN shareid VARCHAR(40) NOT NULL DEFAULT '';
ALTER TABLE releasecomment ADD COLUMN siteid VARCHAR(40) NOT NULL DEFAULT '';
ALTER TABLE releasecomment ADD COLUMN nzb_guid VARCHAR(32) NOT NULL DEFAULT '';
-
-UPDATE tmux SET value = '15' WHERE setting = 'sqlpatch';
diff --git a/resources/db/patches/0016_tmux.sql b/resources/db/patches/0016_tmux.sql
index 309827d83..3d83327e6 100644
--- a/resources/db/patches/0016_tmux.sql
+++ b/resources/db/patches/0016_tmux.sql
@@ -1,4 +1,2 @@
INSERT IGNORE INTO tmux (setting, value) VALUE ('nntpretries', '10');
INSERT IGNORE INTO tmux (setting, value) VALUE ('alternate_nntp', '0');
-
-UPDATE tmux SET value = '16' WHERE setting = 'sqlpatch';
diff --git a/resources/db/patches/0017_tmux.sql b/resources/db/patches/0017_tmux.sql
index d8a05e83a..234832d96 100644
--- a/resources/db/patches/0017_tmux.sql
+++ b/resources/db/patches/0017_tmux.sql
@@ -1,3 +1 @@
INSERT IGNORE INTO tmux (setting, value) VALUE ('sharing_timer', '60');
-
-UPDATE tmux SET value = '17' WHERE setting = 'sqlpatch';
diff --git a/resources/db/patches/0018_sharing.sql b/resources/db/patches/0018_sharing.sql
index 4987d9178..591c107d9 100644
--- a/resources/db/patches/0018_sharing.sql
+++ b/resources/db/patches/0018_sharing.sql
@@ -1,5 +1,3 @@
ALTER TABLE sharing ADD COLUMN max_download MEDIUMINT UNSIGNED NOT NULL DEFAULT '150';
UPDATE sharing SET max_pull = 20000;
-
-UPDATE tmux SET value = '18' WHERE setting = 'sqlpatch';
diff --git a/resources/db/patches/0019_sharing.sql b/resources/db/patches/0019_sharing.sql
index 31bbd6f19..84857456f 100644
--- a/resources/db/patches/0019_sharing.sql
+++ b/resources/db/patches/0019_sharing.sql
@@ -1,5 +1,3 @@
UPDATE releasecomment SET username = (SELECT username FROM users WHERE users.id = releasecomment.userid);
DELETE FROM users WHERE email = 'sharing@nZEDb.com' AND role = 0;
-
-UPDATE tmux SET value = '19' WHERE setting = 'sqlpatch';
diff --git a/resources/db/patches/0020_tmux.sql b/resources/db/patches/0020_tmux.sql
index d5ef2b670..d35b1a804 100644
--- a/resources/db/patches/0020_tmux.sql
+++ b/resources/db/patches/0020_tmux.sql
@@ -1,6 +1,2 @@
DELETE FROM `tmux` WHERE `setting` = 'delete_parts';
-DELETE FROM `tmux` WHERE `setting` = 'delete_timer';
-
-
-
-UPDATE `tmux` set `value` = '20' where `setting` = 'sqlpatch';
\ No newline at end of file
+DELETE FROM `tmux` WHERE `setting` = 'delete_timer';
\ No newline at end of file
diff --git a/resources/db/patches/0021_tmux.sql b/resources/db/patches/0021_tmux.sql
index e85265b97..b22b825ab 100644
--- a/resources/db/patches/0021_tmux.sql
+++ b/resources/db/patches/0021_tmux.sql
@@ -1,5 +1 @@
-DELETE FROM `tmux` WHERE `setting` = 'alternate_nntp';
-
-
-
-UPDATE `tmux` set `value` = '21' where `setting` = 'sqlpatch';
\ No newline at end of file
+DELETE FROM `tmux` WHERE `setting` = 'alternate_nntp';
\ No newline at end of file
diff --git a/resources/db/patches/0022_releases.sql b/resources/db/patches/0022_releases.sql
index 83a028d39..715d4d056 100644
--- a/resources/db/patches/0022_releases.sql
+++ b/resources/db/patches/0022_releases.sql
@@ -1,3 +1 @@
-ALTER TABLE `releases` ADD INDEX `ix_releases_releasenfoID` (`releasenfoid`);
-
-UPDATE `tmux` set `value` = '22' where `setting` = 'sqlpatch';
\ No newline at end of file
+ALTER TABLE `releases` ADD INDEX `ix_releases_releasenfoID` (`releasenfoid`);
\ No newline at end of file
diff --git a/resources/db/patches/0023_tmux.sql b/resources/db/patches/0023_tmux.sql
index 9e1d36d31..474cda7e6 100644
--- a/resources/db/patches/0023_tmux.sql
+++ b/resources/db/patches/0023_tmux.sql
@@ -1,3 +1 @@
INSERT IGNORE INTO tmux (setting, value) VALUE ('fanarttvkey', '');
-
-UPDATE tmux SET value = '23' WHERE setting = 'sqlpatch';
diff --git a/resources/db/patches/0024_tmux.sql b/resources/db/patches/0024_tmux.sql
index f93fc6039..800023298 100644
--- a/resources/db/patches/0024_tmux.sql
+++ b/resources/db/patches/0024_tmux.sql
@@ -1,3 +1 @@
INSERT IGNORE INTO tmux (setting, value) VALUE ('imdburl', '0');
-
-UPDATE tmux SET value = '24' WHERE setting = 'sqlpatch';
diff --git a/resources/db/patches/0025_tmux.sql b/resources/db/patches/0025_tmux.sql
index 175d3c8ca..d45ed14c6 100644
--- a/resources/db/patches/0025_tmux.sql
+++ b/resources/db/patches/0025_tmux.sql
@@ -1,3 +1 @@
INSERT IGNORE INTO tmux (setting, value) VALUE ('yydecoderpath', '');
-
-UPDATE tmux SET value = '25' WHERE setting = 'sqlpatch';
diff --git a/resources/db/patches/0026_tmux.sql b/resources/db/patches/0026_tmux.sql
index aa39cae34..fb7c7bebf 100644
--- a/resources/db/patches/0026_tmux.sql
+++ b/resources/db/patches/0026_tmux.sql
@@ -5,5 +5,3 @@ INSERT IGNORE INTO tmux (setting, value) VALUE ('processvideos', '0');
ALTER TABLE `releases` ADD `proc_pp` TINYINT(1) NOT NULL DEFAULT 0;
ALTER TABLE `releases` ADD `videostatus` TINYINT(1) NOT NULL DEFAULT 0;
ALTER TABLE `releases` ADD `audiostatus` TINYINT(1) NOT NULL DEFAULT 0;
-
-UPDATE tmux SET value = '26' WHERE setting = 'sqlpatch';
diff --git a/resources/db/patches/0027_prehash.sql b/resources/db/patches/0027_prehash.sql
index 6e0a1ab49..9db12ada4 100644
--- a/resources/db/patches/0027_prehash.sql
+++ b/resources/db/patches/0027_prehash.sql
@@ -5,5 +5,3 @@ ALTER TABLE prehash MODIFY COLUMN md5 VARCHAR(32) NOT NULL DEFAULT '';
UPDATE prehash SET sha1 = sha1(title);
CREATE UNIQUE INDEX ix_prehash_sha1 ON prehash(sha1);
-
-UPDATE tmux SET value = '27' WHERE setting = 'sqlpatch';
diff --git a/resources/db/patches/0028_tmux.sql b/resources/db/patches/0028_tmux.sql
index acc51a8ee..ce1fb2b9b 100644
--- a/resources/db/patches/0028_tmux.sql
+++ b/resources/db/patches/0028_tmux.sql
@@ -1,3 +1 @@
INSERT IGNORE INTO tmux (setting, value) VALUE ('bins_kill_timer', '0');
-
-UPDATE tmux SET value = '28' WHERE setting = 'sqlpatch';
diff --git a/resources/db/patches/0029_releases.sql b/resources/db/patches/0029_releases.sql
index b7cb1a3fe..7f874eafb 100644
--- a/resources/db/patches/0029_releases.sql
+++ b/resources/db/patches/0029_releases.sql
@@ -1,11 +1,7 @@
ALTER TABLE `releases` ADD COLUMN `nzbstatus` TINYINT(1) NOT NULL DEFAULT 1;
ALTER TABLE `releases` ADD COLUMN `nzb_guid` VARCHAR(50) NULL;
ALTER TABLE `releases` DROP INDEX `ix_releases_status`;
-ALTER TABLE `releases` ADD INDEX `ix_releases_status` (`nzbstatus`, `iscategorized`, `isrenamed`, `nfostatus`, `ishashed`, `passwordstatus`, `dehashstatus`, `releasenfoid`, `musicinfoid`, `consoleinfoid`, `bookinfoid`, `haspreview`, `categoryid`, `imdbid`, `rageid`);
+ALTER TABLE `releases` ADD INDEX `ix_releases_status` (`nzbstatus`, `iscategorized`, `isrenamed`, `nfostatus`, `ishashed`, `passwordstatus`, `dehashstatus`, `releasenfoid`, `musicinfoid`, `consoleinfoid`, `bookinfoid`, `haspreview`, `categoryid`, `imdbid);
CREATE INDEX `ix_releases_nzb_guid` ON `releases` (`nzb_guid`);
-UPDATE `releases` SET nzbstatus = 1 WHERE nzbstatus = 0;
-
-
-
-UPDATE `tmux` set `value` = '29' where `setting` = 'sqlpatch';
\ No newline at end of file
+UPDATE `releases` SET nzbstatus = 1 WHERE nzbstatus = 0;
\ No newline at end of file
diff --git a/resources/db/patches/0030_tmux.sql b/resources/db/patches/0030_tmux.sql
index 5dd7ee9b3..988eb0b87 100644
--- a/resources/db/patches/0030_tmux.sql
+++ b/resources/db/patches/0030_tmux.sql
@@ -1,3 +1 @@
-UPDATE `tmux` SET VALUE = 'http://reqid.nzedb.com/index.php?reqid=[REQUEST_ID]&group=[GROUP_NM]' WHERE `setting` = 'request_url';
-
-UPDATE `tmux` set `value` = '30' where `setting` = 'sqlpatch';
\ No newline at end of file
+UPDATE `tmux` SET VALUE = 'http://reqid.nzedb.com/index.php?reqid=[REQUEST_ID]&group=[GROUP_NM]' WHERE `setting` = 'request_url';
\ No newline at end of file
diff --git a/resources/db/patches/0031_releases.sql b/resources/db/patches/0031_releases.sql
index e6480beca..76d4bed70 100644
--- a/resources/db/patches/0031_releases.sql
+++ b/resources/db/patches/0031_releases.sql
@@ -1,4 +1,2 @@
ALTER TABLE `releases` DROP COLUMN `nzb_guid`;
-ALTER TABLE `releases` DROP INDEX `ix_releases_nzb_guid`;
-
-UPDATE `tmux` set `value` = '31' where `setting` = 'sqlpatch';
\ No newline at end of file
+ALTER TABLE `releases` DROP INDEX `ix_releases_nzb_guid`;
\ No newline at end of file
diff --git a/resources/db/patches/0032_releases.sql b/resources/db/patches/0032_releases.sql
index 6abf5362a..37b7e962e 100644
--- a/resources/db/patches/0032_releases.sql
+++ b/resources/db/patches/0032_releases.sql
@@ -1,6 +1,4 @@
DROP TRIGGER IF EXISTS check_insert;
DROP TRIGGER IF EXISTS check_update;
CREATE TRIGGER check_insert BEFORE INSERT ON releases FOR EACH ROW BEGIN IF NEW.searchname REGEXP '[a-fA-F0-9]{32}' OR NEW.name REGEXP '[a-fA-F0-9]{32}' THEN SET NEW.ishashed = 1;ELSEIF NEW.name REGEXP '^\[ ?([[:digit:]]{4,6}) ?\]|^REQ\s*([[:digit:]]{4,6})|^([[:digit:]]{4,6})-[[:digit:]]{1}\\[' THEN SET NEW.isrequestid = 1;ELSEIF NEW.releasenfoid = 0 THEN SET NEW.nfostatus = -1; END IF; END;
-CREATE TRIGGER check_update BEFORE UPDATE ON releases FOR EACH ROW BEGIN IF NEW.searchname REGEXP '[a-fA-F0-9]{32}' OR NEW.name REGEXP '[a-fA-F0-9]{32}' THEN SET NEW.ishashed = 1;ELSEIF NEW.name REGEXP '^\[ ?([[:digit:]]{4,6}) ?\]|^REQ\s*([[:digit:]]{4,6})|^([[:digit:]]{4,6})-[[:digit:]]{1}\\[' THEN SET NEW.isrequestid = 1;ELSEIF NEW.releasenfoid = 0 THEN SET NEW.nfostatus = -1; END IF; END;
-
-UPDATE `tmux` set `value` = '32' where `setting` = 'sqlpatch';
\ No newline at end of file
+CREATE TRIGGER check_update BEFORE UPDATE ON releases FOR EACH ROW BEGIN IF NEW.searchname REGEXP '[a-fA-F0-9]{32}' OR NEW.name REGEXP '[a-fA-F0-9]{32}' THEN SET NEW.ishashed = 1;ELSEIF NEW.name REGEXP '^\[ ?([[:digit:]]{4,6}) ?\]|^REQ\s*([[:digit:]]{4,6})|^([[:digit:]]{4,6})-[[:digit:]]{1}\\[' THEN SET NEW.isrequestid = 1;ELSEIF NEW.releasenfoid = 0 THEN SET NEW.nfostatus = -1; END IF; END;
\ No newline at end of file
diff --git a/resources/db/patches/0033_releases.sql b/resources/db/patches/0033_releases.sql
index e984cbf24..2154e2183 100644
--- a/resources/db/patches/0033_releases.sql
+++ b/resources/db/patches/0033_releases.sql
@@ -6,6 +6,4 @@ CREATE TRIGGER check_update BEFORE UPDATE ON releases FOR EACH ROW BEGIN IF NEW.
UPDATE releases set isrequestid = 1
WHERE name REGEXP '^\\[ ?([[:digit:]]{4,6}) ?\\]|^REQ\s*([[:digit:]]{4,6})|^([[:digit:]]{4,6})-[[:digit:]]{1}\\['
-AND isrequestid = 0;
-
-UPDATE `tmux` set `value` = '33' where `setting` = 'sqlpatch';
\ No newline at end of file
+AND isrequestid = 0;
\ No newline at end of file
diff --git a/resources/db/patches/0034_tmux.sql b/resources/db/patches/0034_tmux.sql
index 5f95fbfa8..4b1f1e2d5 100644
--- a/resources/db/patches/0034_tmux.sql
+++ b/resources/db/patches/0034_tmux.sql
@@ -1,5 +1,3 @@
DELETE FROM `tmux` WHERE `setting` = 'scrape_cz';
DELETE FROM `tmux` WHERE `setting` = 'scrape_efnet';
INSERT IGNORE INTO `tmux` (setting, value) VALUE ('scrape', '0');
-
-UPDATE `tmux` SET value = '34' WHERE `setting` = 'sqlpatch';
diff --git a/resources/db/patches/0035_prehash.sql b/resources/db/patches/0035_prehash.sql
index b309a51bf..c50593f57 100644
--- a/resources/db/patches/0035_prehash.sql
+++ b/resources/db/patches/0035_prehash.sql
@@ -9,6 +9,4 @@ DROP TRIGGER IF EXISTS check_rfupdate;
CREATE TRIGGER check_rfinsert BEFORE INSERT ON releasefiles FOR EACH ROW BEGIN IF NEW.name REGEXP '[a-fA-F0-9]{32}' THEN SET NEW.ishashed = 1; END IF; END;
CREATE TRIGGER check_rfupdate BEFORE UPDATE ON releasefiles FOR EACH ROW BEGIN IF NEW.name REGEXP '[a-fA-F0-9]{32}' THEN SET NEW.ishashed = 1; END IF; END;
-UPDATE `releasefiles` SET ishashed = 1 WHERE name REGEXP '[a-fA-F0-9]{32}';
-
-UPDATE `tmux` SET value = '35' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+UPDATE `releasefiles` SET ishashed = 1 WHERE name REGEXP '[a-fA-F0-9]{32}';
\ No newline at end of file
diff --git a/resources/db/patches/0036_tmux.sql b/resources/db/patches/0036_tmux.sql
index ccfc891fe..1dff48c5d 100644
--- a/resources/db/patches/0036_tmux.sql
+++ b/resources/db/patches/0036_tmux.sql
@@ -1,3 +1 @@
-DELETE FROM `tmux` WHERE `setting` = 'colors';
-
-UPDATE `tmux` SET value = '36' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+DELETE FROM `tmux` WHERE `setting` = 'colors';
\ No newline at end of file
diff --git a/resources/db/patches/0037_tmux.sql b/resources/db/patches/0037_tmux.sql
index b0d053408..8c19b32a5 100644
--- a/resources/db/patches/0037_tmux.sql
+++ b/resources/db/patches/0037_tmux.sql
@@ -1,3 +1 @@
-INSERT IGNORE INTO tmux (setting, value) VALUE ('run_sharing', '0');
-
-UPDATE `tmux` SET value = '37' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+INSERT IGNORE INTO tmux (setting, value) VALUE ('run_sharing', '0');
\ No newline at end of file
diff --git a/resources/db/patches/0038_releasesearch.sql b/resources/db/patches/0038_releasesearch.sql
index 3b63b781a..5b9e5c255 100644
--- a/resources/db/patches/0038_releasesearch.sql
+++ b/resources/db/patches/0038_releasesearch.sql
@@ -21,5 +21,3 @@ CREATE TRIGGER insert_search AFTER INSERT ON releases FOR EACH ROW BEGIN INSERT
CREATE TRIGGER update_search AFTER UPDATE ON releases FOR EACH ROW BEGIN IF NEW.guid != OLD.guid THEN UPDATE releasesearch SET guid = NEW.guid WHERE releaseid = OLD.id; END IF; IF NEW.name != OLD.name THEN UPDATE releasesearch SET name = NEW.name WHERE releaseid = OLD.id; END IF; IF NEW.searchname != OLD.searchname THEN UPDATE releasesearch SET searchname = NEW.searchname WHERE releaseid = OLD.id; END IF;END;
CREATE TRIGGER delete_search AFTER DELETE ON releases FOR EACH ROW BEGIN DELETE FROM releasesearch WHERE releaseid = OLD.id;END;
-UPDATE `tmux` SET value = '38' WHERE `setting` = 'sqlpatch';
-
diff --git a/resources/db/patches/0039_prehash.sql b/resources/db/patches/0039_prehash.sql
index 99a472b83..ca7165559 100644
--- a/resources/db/patches/0039_prehash.sql
+++ b/resources/db/patches/0039_prehash.sql
@@ -1,5 +1,3 @@
ALTER TABLE prehash ADD COLUMN searched tinyint(1) NOT NULL DEFAULT 0;
ALTER TABLE prehash ADD INDEX ix_prehash_searched (searched);
-ALTER TABLE releases DROP COLUMN proc_filenames;
-
-UPDATE `tmux` SET value = '39' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+ALTER TABLE releases DROP COLUMN proc_filenames;
\ No newline at end of file
diff --git a/resources/db/patches/0040_tmux.sql b/resources/db/patches/0040_tmux.sql
index 612bcc906..19af21428 100644
--- a/resources/db/patches/0040_tmux.sql
+++ b/resources/db/patches/0040_tmux.sql
@@ -1,3 +1 @@
-INSERT IGNORE INTO tmux (setting, value) VALUE ('lastpretime', '0');
-
-UPDATE `tmux` SET value = '40' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+INSERT IGNORE INTO tmux (setting, value) VALUE ('lastpretime', '0');
\ No newline at end of file
diff --git a/resources/db/patches/0041_predbhash.sql b/resources/db/patches/0041_predbhash.sql
index 05ab51b7b..898d9bd35 100644
--- a/resources/db/patches/0041_predbhash.sql
+++ b/resources/db/patches/0041_predbhash.sql
@@ -25,6 +25,4 @@ DROP TRIGGER IF EXISTS update_hashes;
CREATE TRIGGER update_hashes AFTER UPDATE ON prehash FOR EACH ROW BEGIN IF NEW.title != OLD.title THEN UPDATE predbhash SET hashes = CONCAT_WS(',', MD5(NEW.title), MD5(MD5(NEW.title)), SHA1(NEW.title)); END IF;END;
DROP TRIGGER IF EXISTS delete_hashes;
-CREATE TRIGGER delete_hashes AFTER DELETE ON prehash FOR EACH ROW BEGIN DELETE FROM predbhash WHERE pre_id = OLD.id;END;
-
-UPDATE `tmux` SET value = '41' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+CREATE TRIGGER delete_hashes AFTER DELETE ON prehash FOR EACH ROW BEGIN DELETE FROM predbhash WHERE pre_id = OLD.id;END;
\ No newline at end of file
diff --git a/resources/db/patches/0042_predbhash.sql b/resources/db/patches/0042_predbhash.sql
index d60d1a64b..c3cef23e2 100644
--- a/resources/db/patches/0042_predbhash.sql
+++ b/resources/db/patches/0042_predbhash.sql
@@ -1,4 +1,2 @@
DROP TRIGGER IF EXISTS update_hashes;
-CREATE TRIGGER update_hashes AFTER UPDATE ON prehash FOR EACH ROW BEGIN IF NEW.title != OLD.title THEN UPDATE predbhash SET hashes = CONCAT_WS(',', MD5(NEW.title), MD5(MD5(NEW.title)), SHA1(NEW.title)) WHERE pre_id = OLD.id; END IF;END;
-
-UPDATE `tmux` SET value = '42' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+CREATE TRIGGER update_hashes AFTER UPDATE ON prehash FOR EACH ROW BEGIN IF NEW.title != OLD.title THEN UPDATE predbhash SET hashes = CONCAT_WS(',', MD5(NEW.title), MD5(MD5(NEW.title)), SHA1(NEW.title)) WHERE pre_id = OLD.id; END IF;END;
\ No newline at end of file
diff --git a/resources/db/patches/0043_prehash.sql b/resources/db/patches/0043_prehash.sql
index 98c0d8486..494cdc6d4 100644
--- a/resources/db/patches/0043_prehash.sql
+++ b/resources/db/patches/0043_prehash.sql
@@ -1,3 +1,2 @@
ALTER TABLE prehash DROP md5;
-ALTER TABLE prehash DROP sha1;
-UPDATE `tmux` SET value = '43' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+ALTER TABLE prehash DROP sha1;
\ No newline at end of file
diff --git a/resources/db/patches/0044_releasecomment.sql b/resources/db/patches/0044_releasecomment.sql
index aa4733108..badaee480 100644
--- a/resources/db/patches/0044_releasecomment.sql
+++ b/resources/db/patches/0044_releasecomment.sql
@@ -1,5 +1,4 @@
ALTER TABLE releasecomment MODIFY text varchar(255);
DROP INDEX ix_releasecomment_text_releaseID ON releasecomment;
CREATE UNIQUE INDEX ix_releasecomment_text_releaseID ON releasecomment (text, releaseid);
-UPDATE `tmux` SET value = '44' WHERE `setting` = 'sqlpatch';
diff --git a/resources/db/patches/0045_prehash.sql b/resources/db/patches/0045_prehash.sql
index 4137cfa0b..05442e6ff 100644
--- a/resources/db/patches/0045_prehash.sql
+++ b/resources/db/patches/0045_prehash.sql
@@ -1,3 +1,2 @@
ALTER TABLE prehash DROP INDEX ix_prehash_title;
-ALTER IGNORE TABLE prehash ADD UNIQUE INDEX ix_prehash_title (title);
-UPDATE `tmux` SET value = '45' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+ALTER IGNORE TABLE prehash ADD UNIQUE INDEX ix_prehash_title (title);
\ No newline at end of file
diff --git a/resources/db/patches/0046_releasecomment.sql b/resources/db/patches/0046_releasecomment.sql
index 881821860..1892023e7 100644
--- a/resources/db/patches/0046_releasecomment.sql
+++ b/resources/db/patches/0046_releasecomment.sql
@@ -3,5 +3,4 @@ DROP TRIGGER IF EXISTS insert_MD5;
CREATE TRIGGER insert_MD5 BEFORE INSERT ON releasecomment FOR EACH ROW SET NEW.text_hash = MD5(NEW.text);
UPDATE releasecomment
SET text_hash = MD5(text);
-ALTER IGNORE TABLE releasecomment ADD UNIQUE INDEX ix_releasecomment_hash_releaseID (text_hash, releaseid);
-UPDATE `tmux` SET `value` = '46' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+ALTER IGNORE TABLE releasecomment ADD UNIQUE INDEX ix_releasecomment_hash_releaseID (text_hash, releaseid);
\ No newline at end of file
diff --git a/resources/db/patches/0047_users.sql b/resources/db/patches/0047_users.sql
index 6a45ae026..174dd98c8 100644
--- a/resources/db/patches/0047_users.sql
+++ b/resources/db/patches/0047_users.sql
@@ -1,5 +1,2 @@
ALTER TABLE users ADD COLUMN queuetype TINYINT(1) NOT NULL DEFAULT 1;
-/* Add a column to pick between Sab and NZBGet. */
-
-
-UPDATE `tmux` SET `value` = '47' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+/* Add a column to pick between Sab and NZBGet. */
\ No newline at end of file
diff --git a/resources/db/patches/0049_site.sql b/resources/db/patches/0049_site.sql
index e728599ae..3ac8db9b3 100644
--- a/resources/db/patches/0049_site.sql
+++ b/resources/db/patches/0049_site.sql
@@ -1,3 +1,2 @@
INSERT INTO `site` (`setting`, `value`) VALUES ('categorizeforeign', '1');
-INSERT INTO `site` (`setting`, `value`) VALUES ('catwebdl', '0');
-UPDATE `tmux` SET `value` = '49' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+INSERT INTO `site` (`setting`, `value`) VALUES ('catwebdl', '0');
\ No newline at end of file
diff --git a/resources/db/patches/0050_category.sql b/resources/db/patches/0050_category.sql
index 4575ba3ad..953eb36ac 100644
--- a/resources/db/patches/0050_category.sql
+++ b/resources/db/patches/0050_category.sql
@@ -88,6 +88,4 @@ INSERT INTO category (id, title, parentid) VALUES (7050, 'Other', 7000);
INSERT INTO category (id, title, parentid) VALUES (7060, 'Foreign', 7000);
INSERT INTO category (id, title, parentid) VALUES (8010, 'Misc', 8000);
-INSERT INTO category (id, title, parentid) VALUES (8020, 'Hashed', 8000);
-
-UPDATE `tmux` SET `value` = '50' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+INSERT INTO category (id, title, parentid) VALUES (8020, 'Hashed', 8000);
\ No newline at end of file
diff --git a/resources/db/patches/0051_tmux.sql b/resources/db/patches/0051_tmux.sql
index 286977e73..f270aabef 100644
--- a/resources/db/patches/0051_tmux.sql
+++ b/resources/db/patches/0051_tmux.sql
@@ -1,2 +1 @@
-INSERT IGNORE INTO tmux (setting, value) VALUE ('minsizetopostprocess', '1');
-UPDATE `tmux` SET `value` = '51' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+INSERT IGNORE INTO tmux (setting, value) VALUE ('minsizetopostprocess', '1');
\ No newline at end of file
diff --git a/resources/db/patches/0052~gamesinfo.sql b/resources/db/patches/0052~gamesinfo.sql
index 78da0f2df..09af7fd27 100644
--- a/resources/db/patches/0052~gamesinfo.sql
+++ b/resources/db/patches/0052~gamesinfo.sql
@@ -19,6 +19,4 @@ CREATE TABLE gamesinfo (
ENGINE = InnoDB
DEFAULT CHARSET = utf8
COLLATE = utf8_unicode_ci
- AUTO_INCREMENT = 1;
-
- UPDATE `tmux` SET `value` = '52' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+ AUTO_INCREMENT = 1;
\ No newline at end of file
diff --git a/resources/db/patches/0053~site.sql b/resources/db/patches/0053~site.sql
index cbd08d8a3..c7104f2df 100644
--- a/resources/db/patches/0053~site.sql
+++ b/resources/db/patches/0053~site.sql
@@ -1,2 +1 @@
-INSERT INTO `site` (`setting`, `value`) VALUES ('giantbombkey', '');
-UPDATE `tmux` SET `value` = '53' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+INSERT INTO `site` (`setting`, `value`) VALUES ('giantbombkey', '');
\ No newline at end of file
diff --git a/resources/db/patches/0054~releases.sql b/resources/db/patches/0054~releases.sql
index 948ea1e66..b5851ceb9 100644
--- a/resources/db/patches/0054~releases.sql
+++ b/resources/db/patches/0054~releases.sql
@@ -1,3 +1,2 @@
ALTER TABLE releases ADD COLUMN gamesinfo_id INT AFTER consoleinfoid;
-CREATE INDEX ix_releases_gamesinfo_id ON releases (gamesinfo_id);
-UPDATE `tmux` SET `value` = '54' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+CREATE INDEX ix_releases_gamesinfo_id ON releases (gamesinfo_id);
\ No newline at end of file
diff --git a/resources/db/patches/0055~users.sql b/resources/db/patches/0055~users.sql
index 3856ff3b1..ce26eaed1 100644
--- a/resources/db/patches/0055~users.sql
+++ b/resources/db/patches/0055~users.sql
@@ -1,2 +1 @@
-ALTER TABLE users ADD COLUMN gameview INT AFTER consoleview;
-UPDATE `tmux` SET `value` = '55' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+ALTER TABLE users ADD COLUMN gameview INT AFTER consoleview;
\ No newline at end of file
diff --git a/resources/db/patches/0056~menu.sql b/resources/db/patches/0056~menu.sql
index 267d4f9ed..e2ab76bb8 100644
--- a/resources/db/patches/0056~menu.sql
+++ b/resources/db/patches/0056~menu.sql
@@ -1,2 +1 @@
-INSERT INTO menu (href, title, tooltip, role, ordinal ) VALUES ('newposterwall', 'New Releases', "Newest Releases Poster Wall", 1, 11);
-UPDATE `tmux` SET `value` = '56' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+INSERT INTO menu (href, title, tooltip, role, ordinal ) VALUES ('newposterwall', 'New Releases', "Newest Releases Poster Wall", 1, 11);
\ No newline at end of file
diff --git a/resources/db/patches/0057~releases.sql b/resources/db/patches/0057~releases.sql
index 32db0690f..5bf14f411 100644
--- a/resources/db/patches/0057~releases.sql
+++ b/resources/db/patches/0057~releases.sql
@@ -1,2 +1 @@
-ALTER TABLE releases ADD COLUMN proc_sorter TINYINT(1) NOT NULL DEFAULT '0';
-UPDATE `tmux` SET `value` = '57' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+ALTER TABLE releases ADD COLUMN proc_sorter TINYINT(1) NOT NULL DEFAULT '0';
\ No newline at end of file
diff --git a/resources/db/patches/0058~tmux.sql b/resources/db/patches/0058~tmux.sql
index 3643d61ea..024893816 100644
--- a/resources/db/patches/0058~tmux.sql
+++ b/resources/db/patches/0058~tmux.sql
@@ -2,5 +2,4 @@ DELETE FROM `tmux` WHERE `setting` = 'dehash';
DELETE FROM `tmux` WHERE `setting` = 'dehash_timer';
DELETE FROM `tmux` WHERE `setting` = 'lookup_reqids';
DELETE FROM `tmux` WHERE `setting` = 'lookup_reqids_timer';
-DELETE FROM `tmux` WHERE `setting` = 'request_url';
-UPDATE `tmux` set `value` = '58' where `setting` = 'sqlpatch';
\ No newline at end of file
+DELETE FROM `tmux` WHERE `setting` = 'request_url';
\ No newline at end of file
diff --git a/resources/db/patches/0059~users.sql b/resources/db/patches/0059~users.sql
index b305d7cec..45b4f2002 100644
--- a/resources/db/patches/0059~users.sql
+++ b/resources/db/patches/0059~users.sql
@@ -1,2 +1 @@
-ALTER TABLE users ADD COLUMN xxxview INT AFTER gameview;
-UPDATE `tmux` set `value` = '59' where `setting` = 'sqlpatch';
\ No newline at end of file
+ALTER TABLE users ADD COLUMN xxxview INT AFTER gameview;
\ No newline at end of file
diff --git a/resources/db/patches/0060~xxxinfo.sql b/resources/db/patches/0060~xxxinfo.sql
index d5e26e114..169bcf98a 100644
--- a/resources/db/patches/0060~xxxinfo.sql
+++ b/resources/db/patches/0060~xxxinfo.sql
@@ -22,6 +22,4 @@ CREATE TABLE xxxinfo (
ENGINE = InnoDB
DEFAULT CHARSET = utf8
COLLATE = utf8_unicode_ci
- AUTO_INCREMENT = 1;
-
-UPDATE `tmux` SET `value` = '60' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+ AUTO_INCREMENT = 1;
\ No newline at end of file
diff --git a/resources/db/patches/0061~releases.sql b/resources/db/patches/0061~releases.sql
index 264095ede..f60e3637f 100644
--- a/resources/db/patches/0061~releases.sql
+++ b/resources/db/patches/0061~releases.sql
@@ -1,3 +1,2 @@
ALTER TABLE releases ADD COLUMN xxxinfo_id INT AFTER imdbid;
-CREATE INDEX ix_releases_xxxinfo_id ON releases (xxxinfo_id);
-UPDATE `tmux` SET `value` = '61' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+CREATE INDEX ix_releases_xxxinfo_id ON releases (xxxinfo_id);
\ No newline at end of file
diff --git a/resources/db/patches/0062~releases.sql b/resources/db/patches/0062~releases.sql
index e56e93e72..fbe254218 100644
--- a/resources/db/patches/0062~releases.sql
+++ b/resources/db/patches/0062~releases.sql
@@ -1,5 +1,4 @@
UPDATE releases SET gamesinfo_id = 0 WHERE gamesinfo_id IS NULL;
ALTER TABLE releases MODIFY COLUMN gamesinfo_id INT(10) SIGNED NOT NULL DEFAULT '0';
UPDATE releases SET xxxinfo_id = 0 WHERE xxxinfo_id IS NULL;
-ALTER TABLE releases MODIFY COLUMN xxxinfo_id INT(10) SIGNED NOT NULL DEFAULT '0';
-UPDATE `tmux` SET `value` = '62' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+ALTER TABLE releases MODIFY COLUMN xxxinfo_id INT(10) SIGNED NOT NULL DEFAULT '0';
\ No newline at end of file
diff --git a/resources/db/patches/0063~site.sql b/resources/db/patches/0063~site.sql
index af3fe2313..220bac9fb 100644
--- a/resources/db/patches/0063~site.sql
+++ b/resources/db/patches/0063~site.sql
@@ -1,2 +1 @@
-INSERT INTO `site` (`setting`, `value`) VALUES ('lookupxxx', 1);
-UPDATE `tmux` SET `value` = '63' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+INSERT INTO `site` (`setting`, `value`) VALUES ('lookupxxx', 1);
\ No newline at end of file
diff --git a/resources/db/patches/0064~site.sql b/resources/db/patches/0064~site.sql
index abdc614f4..30433e901 100644
--- a/resources/db/patches/0064~site.sql
+++ b/resources/db/patches/0064~site.sql
@@ -1,2 +1 @@
-INSERT INTO `site` (`setting`, `value`) VALUES ('maxxxxprocessed', 100);
-UPDATE `tmux` SET `value` = '64' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+INSERT INTO `site` (`setting`, `value`) VALUES ('maxxxxprocessed', 100);
\ No newline at end of file
diff --git a/resources/db/patches/0065~users.sql b/resources/db/patches/0065~users.sql
index d7f9cb618..a972c1c9f 100644
--- a/resources/db/patches/0065~users.sql
+++ b/resources/db/patches/0065~users.sql
@@ -1,4 +1,3 @@
ALTER TABLE users ADD COLUMN cp_api VARCHAR(255) NULL DEFAULT NULL;
ALTER TABLE users ADD COLUMN cp_url VARCHAR(255) NULL DEFAULT NULL;
-UPDATE `tmux` SET `value` = '65' WHERE `setting` = 'sqlpatch';
diff --git a/resources/db/patches/0066~genres.sql b/resources/db/patches/0066~genres.sql
index ad313c0a4..6436b9f9a 100644
--- a/resources/db/patches/0066~genres.sql
+++ b/resources/db/patches/0066~genres.sql
@@ -492,6 +492,4 @@ INSERT IGNORE INTO `genres` (`id`, `title`, `type`, `disabled`) VALUES
(631, 'Ass-to-mouth', 6000, 0),
(632, 'Parody', 6000, 0),
(633, 'Racing', 4000, 0),
-(634, 'Double Penetration (Dp)', 6000, 0);
-
-UPDATE `tmux` SET `value` = '66' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+(634, 'Double Penetration (Dp)', 6000, 0);
\ No newline at end of file
diff --git a/resources/db/patches/0067~gamesinfo.sql b/resources/db/patches/0067~gamesinfo.sql
index b92ea7bfd..e21d1fae5 100644
--- a/resources/db/patches/0067~gamesinfo.sql
+++ b/resources/db/patches/0067~gamesinfo.sql
@@ -1,5 +1,4 @@
ALTER TABLE gamesinfo ADD COLUMN backdrop TINYINT(1) DEFAULT 0 AFTER cover;
ALTER TABLE gamesinfo ADD COLUMN trailer VARCHAR(1000) DEFAULT '' AFTER backdrop;
ALTER TABLE gamesinfo ADD COLUMN classused VARCHAR(10) DEFAULT 'steam' AFTER trailer;
-UPDATE gamesinfo SET classused = 'gb';
-UPDATE `tmux` SET `value` = '67' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+UPDATE gamesinfo SET classused = 'gb';
\ No newline at end of file
diff --git a/resources/db/patches/0068~xxxinfo.sql b/resources/db/patches/0068~xxxinfo.sql
index 129bdf346..a02bac9a2 100644
--- a/resources/db/patches/0068~xxxinfo.sql
+++ b/resources/db/patches/0068~xxxinfo.sql
@@ -1,3 +1,2 @@
ALTER TABLE xxxinfo MODIFY COLUMN classused varchar(4) DEFAULT 'ade';
-UPDATE xxxinfo SET classused = 'aebn' WHERE classused = 'aeb';
-UPDATE `tmux` SET `value` = '68' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+UPDATE xxxinfo SET classused = 'aebn' WHERE classused = 'aeb';
\ No newline at end of file
diff --git a/resources/db/patches/0069~site.sql b/resources/db/patches/0069~site.sql
index 7535bb2be..0b0cefb9d 100644
--- a/resources/db/patches/0069~site.sql
+++ b/resources/db/patches/0069~site.sql
@@ -1,2 +1 @@
-INSERT INTO `site` (`setting`, `value`) VALUES ('anidbkey', '');
-UPDATE `tmux` SET `value` = '69' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+INSERT INTO `site` (`setting`, `value`) VALUES ('anidbkey', '');
\ No newline at end of file
diff --git a/resources/db/patches/0070~animetitles.sql b/resources/db/patches/0070~animetitles.sql
index f33f54c93..591829f4e 100644
--- a/resources/db/patches/0070~animetitles.sql
+++ b/resources/db/patches/0070~animetitles.sql
@@ -1,2 +1 @@
-ALTER TABLE animetitles CHANGE createddate unixtime INT(12) UNSIGNED NOT NULL;
-UPDATE `tmux` SET `value` = '70' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+ALTER TABLE animetitles CHANGE createddate unixtime INT(12) UNSIGNED NOT NULL;
\ No newline at end of file
diff --git a/resources/db/patches/0071~site.sql b/resources/db/patches/0071~site.sql
index f73998a23..abb70d344 100644
--- a/resources/db/patches/0071~site.sql
+++ b/resources/db/patches/0071~site.sql
@@ -1,2 +1 @@
-INSERT INTO site (setting, value) VALUES ('rottentomatoquality', 'profile');
-UPDATE `tmux` SET `value` = '71' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+INSERT INTO site (setting, value) VALUES ('rottentomatoquality', 'profile');
\ No newline at end of file
diff --git a/resources/db/patches/0072~site.sql b/resources/db/patches/0072~site.sql
index d7e21bb7e..e9dd8197e 100644
--- a/resources/db/patches/0072~site.sql
+++ b/resources/db/patches/0072~site.sql
@@ -20,6 +20,4 @@ CREATE TRIGGER check_update BEFORE UPDATE ON releases FOR EACH ROW BEGIN IF NEW.
CREATE TRIGGER insert_search AFTER INSERT ON releases FOR EACH ROW BEGIN INSERT INTO releasesearch (releaseid, guid, name, searchname) VALUES (NEW.id, NEW.guid, NEW.name, NEW.searchname);END;
CREATE TRIGGER update_search AFTER UPDATE ON releases FOR EACH ROW BEGIN IF NEW.guid != OLD.guid THEN UPDATE releasesearch SET guid = NEW.guid WHERE releaseid = OLD.id; END IF;IF NEW.name != OLD.name THEN UPDATE releasesearch SET name = NEW.name WHERE releaseid = OLD.id; END IF; IF NEW.searchname != OLD.searchname THEN UPDATE releasesearch SET searchname = NEW.searchname WHERE releaseid = OLD.id; END IF;END;
CREATE TRIGGER delete_search AFTER DELETE ON releases FOR EACH ROW BEGIN DELETE FROM releasesearch WHERE releaseid = OLD.id; END;
-CREATE TRIGGER insert_MD5 BEFORE INSERT ON releasecomment FOR EACH ROW SET NEW.text_hash = MD5(NEW.text);
-
-UPDATE `tmux` SET `value` = '72' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+CREATE TRIGGER insert_MD5 BEFORE INSERT ON releasecomment FOR EACH ROW SET NEW.text_hash = MD5(NEW.text);
\ No newline at end of file
diff --git a/resources/db/patches/0073~releases.sql b/resources/db/patches/0073~releases.sql
index b9ede6073..06731c0ee 100644
--- a/resources/db/patches/0073~releases.sql
+++ b/resources/db/patches/0073~releases.sql
@@ -1,2 +1 @@
-CREATE INDEX `ix_releases_xxxinfo_id` ON `releases` (`xxxinfo_id`);
-UPDATE `tmux` SET `value` = '73' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+CREATE INDEX `ix_releases_xxxinfo_id` ON `releases` (`xxxinfo_id`);
\ No newline at end of file
diff --git a/resources/db/patches/0074~releases.sql b/resources/db/patches/0074~releases.sql
index 9133e61d6..889bb1f05 100644
--- a/resources/db/patches/0074~releases.sql
+++ b/resources/db/patches/0074~releases.sql
@@ -1,2 +1 @@
-ALTER TABLE `releases` CHANGE `nzbstatus` `nzbstatus` TINYINT( 1 ) NOT NULL DEFAULT '0';
-UPDATE `tmux` SET `value` = '74' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+ALTER TABLE `releases` CHANGE `nzbstatus` `nzbstatus` TINYINT( 1 ) NOT NULL DEFAULT '0';
\ No newline at end of file
diff --git a/resources/db/patches/0075~site.sql b/resources/db/patches/0075~site.sql
index 739c7dd73..cf9daf5d8 100644
--- a/resources/db/patches/0075~site.sql
+++ b/resources/db/patches/0075~site.sql
@@ -1,2 +1 @@
-INSERT IGNORE INTO `site` (`setting`, `value`) VALUE ('alternate_nntp', '0');
-UPDATE `tmux` SET `value` = '75' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+INSERT IGNORE INTO `site` (`setting`, `value`) VALUE ('alternate_nntp', '0');
\ No newline at end of file
diff --git a/resources/db/patches/0078~site.sql b/resources/db/patches/0078~site.sql
index 2399a7c47..d7eae5826 100644
--- a/resources/db/patches/0078~site.sql
+++ b/resources/db/patches/0078~site.sql
@@ -46,6 +46,4 @@ INSERT INTO `site` (`setting`, `value`) VALUES
('maxnestedlevels', '3'),
('innerfileblacklist', ''),
('miscotherretentionhours', '0'),
- ('mischashedretentionhours', '0');
-
-UPDATE `tmux` SET `value` = '78' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+ ('mischashedretentionhours', '0');
\ No newline at end of file
diff --git a/resources/db/patches/0079~site.sql b/resources/db/patches/0079~site.sql
index 83ae30623..33998d846 100644
--- a/resources/db/patches/0079~site.sql
+++ b/resources/db/patches/0079~site.sql
@@ -1,2 +1 @@
-INSERT IGNORE INTO `site` (`setting`, `value`) VALUE ('maxnforetries', '5');
-UPDATE `tmux` SET `value` = '79' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+INSERT IGNORE INTO `site` (`setting`, `value`) VALUE ('maxnforetries', '5');
\ No newline at end of file
diff --git a/resources/db/patches/0080~site.sql b/resources/db/patches/0080~site.sql
index 2cf8072ce..7cc2a3a4e 100644
--- a/resources/db/patches/0080~site.sql
+++ b/resources/db/patches/0080~site.sql
@@ -1,4 +1,3 @@
INSERT IGNORE INTO `site` (`setting`, `value`) VALUES
('timeoutpath', ''),
- ('timeoutseconds', '0');
-UPDATE `tmux` SET `value` = '80' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+ ('timeoutseconds', '0');
\ No newline at end of file
diff --git a/resources/db/patches/0081~movieinfo.sql b/resources/db/patches/0081~movieinfo.sql
index f7d68a24d..7fb3b0118 100644
--- a/resources/db/patches/0081~movieinfo.sql
+++ b/resources/db/patches/0081~movieinfo.sql
@@ -1,2 +1 @@
-ALTER TABLE `movieinfo` ADD `type` VARCHAR( 32 ) NOT NULL AFTER `genre` ;
-UPDATE `tmux` SET `value` = '81' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+ALTER TABLE `movieinfo` ADD `type` VARCHAR( 32 ) NOT NULL AFTER `genre` ;
\ No newline at end of file
diff --git a/resources/db/patches/0082~tvrageepisodes.sql b/resources/db/patches/0082~tvrageepisodes.sql
index 105bac6bd..3f8efd30b 100644
--- a/resources/db/patches/0082~tvrageepisodes.sql
+++ b/resources/db/patches/0082~tvrageepisodes.sql
@@ -13,5 +13,4 @@ CREATE TABLE tvrageepisodes (
ENGINE = INNODB
DEFAULT CHARSET = utf8
COLLATE = utf8_unicode_ci
- AUTO_INCREMENT = 1;
-UPDATE `tmux` SET `value` = '82' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+ AUTO_INCREMENT = 1;
\ No newline at end of file
diff --git a/resources/db/patches/0083~site.sql b/resources/db/patches/0083~site.sql
index c93de7984..faba3a7cd 100644
--- a/resources/db/patches/0083~site.sql
+++ b/resources/db/patches/0083~site.sql
@@ -2,5 +2,4 @@ INSERT IGNORE INTO `site` (`setting`, `value`) VALUES
('lookup_reqids', '1'),
('reqidthreads', '1'),
('request_hours', '1'),
-('request_url', 'http://reqid.nzedb.com/index.php');
-UPDATE `tmux` SET `value` = '83' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+('request_url', 'http://reqid.nzedb.com/index.php');
\ No newline at end of file
diff --git a/resources/db/patches/0084~groups.sql b/resources/db/patches/0084~groups.sql
index 2d14de519..ad1df06c6 100644
--- a/resources/db/patches/0084~groups.sql
+++ b/resources/db/patches/0084~groups.sql
@@ -1,3 +1 @@
-ALTER TABLE `groups` ADD `backfill` TINYINT(1) NOT NULL DEFAULT '0' AFTER `active` ;
-
-UPDATE `tmux` set `value` = '84' where `setting` = 'sqlpatch';
\ No newline at end of file
+ALTER TABLE `groups` ADD `backfill` TINYINT(1) NOT NULL DEFAULT '0' AFTER `active` ;
\ No newline at end of file
diff --git a/resources/db/patches/0085~site.sql b/resources/db/patches/0085~site.sql
index 72968c22c..1d5adfae6 100644
--- a/resources/db/patches/0085~site.sql
+++ b/resources/db/patches/0085~site.sql
@@ -1,2 +1 @@
-INSERT IGNORE INTO `site` (`setting`, `value`) VALUE ('safebackfilldate', '2012-06-24');
-UPDATE `tmux` SET `value` = '85' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+INSERT IGNORE INTO `site` (`setting`, `value`) VALUE ('safebackfilldate', '2012-06-24');
\ No newline at end of file
diff --git a/resources/db/patches/0086~category.sql b/resources/db/patches/0086~category.sql
index cf4b5f42b..24c392303 100644
--- a/resources/db/patches/0086~category.sql
+++ b/resources/db/patches/0086~category.sql
@@ -1,2 +1 @@
-INSERT INTO category (id, title, parentid) VALUES (2080, 'WEB-DL', 2000);
-UPDATE `tmux` SET `value` = '86' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+INSERT INTO category (id, title, parentid) VALUES (2080, 'WEB-DL', 2000);
\ No newline at end of file
diff --git a/resources/db/patches/0087~site.sql b/resources/db/patches/0087~site.sql
index a146c1938..e9f0f9965 100644
--- a/resources/db/patches/0087~site.sql
+++ b/resources/db/patches/0087~site.sql
@@ -3,4 +3,3 @@ INSERT IGNORE INTO `site` (`setting`, `value`) VALUES
('maxpartrepair', '15000'),
('partrepairmaxtries', '3'),
('tablepergroup', '0');
-UPDATE `tmux` SET `value` = '87' WHERE `setting` = 'sqlpatch';
diff --git a/resources/db/patches/0088~site.sql b/resources/db/patches/0088~site.sql
index 1374b6131..0e881992a 100644
--- a/resources/db/patches/0088~site.sql
+++ b/resources/db/patches/0088~site.sql
@@ -1,3 +1,2 @@
INSERT IGNORE INTO `site` (`setting`, `value`) VALUE
- ('nntpproxy','0');
-UPDATE `tmux` SET `value` = '88' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+ ('nntpproxy','0');
\ No newline at end of file
diff --git a/resources/db/patches/0089~site.sql b/resources/db/patches/0089~site.sql
index d86ca3404..8e312a86a 100644
--- a/resources/db/patches/0089~site.sql
+++ b/resources/db/patches/0089~site.sql
@@ -1,2 +1 @@
-INSERT IGNORE INTO `site` (`setting`, `value`) VALUE ('book_reqids','7010');
-UPDATE `tmux` SET `value` = '89' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+INSERT IGNORE INTO `site` (`setting`, `value`) VALUE ('book_reqids','7010');
\ No newline at end of file
diff --git a/resources/db/patches/0090~bookinfo.sql b/resources/db/patches/0090~bookinfo.sql
index eefd31066..9cf1de6af 100644
--- a/resources/db/patches/0090~bookinfo.sql
+++ b/resources/db/patches/0090~bookinfo.sql
@@ -1,2 +1 @@
-ALTER TABLE `bookinfo` ADD `salesrank` INT(10) UNSIGNED DEFAULT NULL;
-UPDATE `tmux` SET `value` = '90' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+ALTER TABLE `bookinfo` ADD `salesrank` INT(10) UNSIGNED DEFAULT NULL;
\ No newline at end of file
diff --git a/resources/db/patches/0091~releasesearch.sql b/resources/db/patches/0091~releasesearch.sql
index cd4b0ac74..cb9071eae 100644
--- a/resources/db/patches/0091~releasesearch.sql
+++ b/resources/db/patches/0091~releasesearch.sql
@@ -10,6 +10,4 @@ DROP TRIGGER IF EXISTS insert_search;
DROP TRIGGER IF EXISTS update_search;
CREATE TRIGGER insert_search AFTER INSERT ON releases FOR EACH ROW BEGIN INSERT INTO releasesearch (releaseid, guid, name, searchname, fromname) VALUES (NEW.id, NEW.guid, NEW.name, NEW.searchname, NEW.fromname); END;
-CREATE TRIGGER update_search AFTER UPDATE ON releases FOR EACH ROW BEGIN IF NEW.guid != OLD.guid THEN UPDATE releasesearch SET guid = NEW.guid WHERE releaseid = OLD.id; END IF; IF NEW.name != OLD.name THEN UPDATE releasesearch SET name = NEW.name WHERE releaseid = OLD.id; END IF; IF NEW.searchname != OLD.searchname THEN UPDATE releasesearch SET searchname = NEW.searchname WHERE releaseid = OLD.id; END IF; IF NEW.fromname != OLD.fromname THEN UPDATE releasesearch SET fromname = NEW.fromname WHERE releaseid = OLD.id; END IF; END;
-
-UPDATE `tmux` SET `value` = '91' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+CREATE TRIGGER update_search AFTER UPDATE ON releases FOR EACH ROW BEGIN IF NEW.guid != OLD.guid THEN UPDATE releasesearch SET guid = NEW.guid WHERE releaseid = OLD.id; END IF; IF NEW.name != OLD.name THEN UPDATE releasesearch SET name = NEW.name WHERE releaseid = OLD.id; END IF; IF NEW.searchname != OLD.searchname THEN UPDATE releasesearch SET searchname = NEW.searchname WHERE releaseid = OLD.id; END IF; IF NEW.fromname != OLD.fromname THEN UPDATE releasesearch SET fromname = NEW.fromname WHERE releaseid = OLD.id; END IF; END;
\ No newline at end of file
diff --git a/resources/db/patches/0092~bookinfo.sql b/resources/db/patches/0092~bookinfo.sql
index 754386b96..ab08722a3 100644
--- a/resources/db/patches/0092~bookinfo.sql
+++ b/resources/db/patches/0092~bookinfo.sql
@@ -1,3 +1,2 @@
ALTER TABLE `bookinfo` ADD `overview` VARCHAR(3000) DEFAULT NULL;
-ALTER TABLE `bookinfo` ADD `genre` VARCHAR(255) NOT NULL;
-UPDATE `tmux` SET `value` = '92' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+ALTER TABLE `bookinfo` ADD `genre` VARCHAR(255) NOT NULL;
\ No newline at end of file
diff --git a/resources/db/patches/0093~anidb.sql b/resources/db/patches/0093~anidb.sql
index 1b69be901..57e7823d7 100644
--- a/resources/db/patches/0093~anidb.sql
+++ b/resources/db/patches/0093~anidb.sql
@@ -65,6 +65,4 @@ CREATE TABLE anidb_titles (
)
ENGINE = InnoDB
DEFAULT CHARSET = utf8
- COLLATE = utf8_unicode_ci;
-
-UPDATE `tmux` SET `value` = '93' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+ COLLATE = utf8_unicode_ci;
\ No newline at end of file
diff --git a/resources/db/patches/0094~site.sql b/resources/db/patches/0094~site.sql
index 89e215cf8..6000f3547 100644
--- a/resources/db/patches/0094~site.sql
+++ b/resources/db/patches/0094~site.sql
@@ -1,5 +1,4 @@
INSERT IGNORE INTO `site` (`setting`, `value`) VALUES
('intanidbupdate','7'),
('lastanidbupdate','0'),
- ('banned','0');
-UPDATE `tmux` SET `value` = '94' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+ ('banned','0');
\ No newline at end of file
diff --git a/resources/db/patches/0095~releases.sql b/resources/db/patches/0095~releases.sql
index 816755638..3a34f5291 100644
--- a/resources/db/patches/0095~releases.sql
+++ b/resources/db/patches/0095~releases.sql
@@ -12,5 +12,4 @@ ALTER TABLE releases CHANGE COLUMN proc_par2 proc_par2 TINYINT(1) NOT NULL DEFAU
ALTER TABLE releases CHANGE COLUMN proc_nfo proc_nfo TINYINT(1) NOT NULL DEFAULT 0;
ALTER TABLE releases CHANGE COLUMN proc_files proc_files TINYINT(1) NOT NULL DEFAULT 0;
-UPDATE releases set isrequestid = 1 WHERE name REGEXP '^\\[ ?([[:digit:]]{4,6}) ?\\]|^REQ\s*([[:digit:]]{4,6})|^([[:digit:]]{4,6})-[[:digit:]]{1}\\[' AND isrequestid = 0;
-UPDATE `tmux` SET `value` = '95' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+UPDATE releases set isrequestid = 1 WHERE name REGEXP '^\\[ ?([[:digit:]]{4,6}) ?\\]|^REQ\s*([[:digit:]]{4,6})|^([[:digit:]]{4,6})-[[:digit:]]{1}\\[' AND isrequestid = 0;
\ No newline at end of file
diff --git a/resources/db/patches/0096~site.sql b/resources/db/patches/0096~site.sql
index f68adb36e..01154e293 100644
--- a/resources/db/patches/0096~site.sql
+++ b/resources/db/patches/0096~site.sql
@@ -5,5 +5,3 @@ INSERT IGNORE INTO `site` (`setting`, `value`) VALUES
('grabstatus', 0),
('nzbsplitlevel', 1),
('maxsizetoformrelease', 0);
-
-UPDATE `tmux` set `value` = '96' where `setting` = 'sqlpatch';
diff --git a/resources/db/patches/0097~releases.sql b/resources/db/patches/0097~releases.sql
index ffebbecac..3514aa5c6 100644
--- a/resources/db/patches/0097~releases.sql
+++ b/resources/db/patches/0097~releases.sql
@@ -1,3 +1,2 @@
ALTER TABLE releases ADD COLUMN nzb_guid VARCHAR(50) NULL;
-ALTER TABLE releases ADD INDEX ix_releases_nzb_guid (nzb_guid);
-UPDATE `tmux` set `value` = '97' where `setting` = 'sqlpatch';
\ No newline at end of file
+ALTER TABLE releases ADD INDEX ix_releases_nzb_guid (nzb_guid);
\ No newline at end of file
diff --git a/resources/db/patches/0098~tmux.sql b/resources/db/patches/0098~tmux.sql
index 4db4ea6ea..7508f7daf 100644
--- a/resources/db/patches/0098~tmux.sql
+++ b/resources/db/patches/0098~tmux.sql
@@ -1,4 +1,3 @@
INSERT IGNORE INTO tmux (setting, value) VALUES
('dehash', '0'),
- ('dehash_timer', '30');
-UPDATE `tmux` set `value` = '98' where `setting` = 'sqlpatch';
\ No newline at end of file
+ ('dehash_timer', '30');
\ No newline at end of file
diff --git a/resources/db/patches/0099~releases.sql b/resources/db/patches/0099~releases.sql
index 5531fdd92..e1992fd2e 100644
--- a/resources/db/patches/0099~releases.sql
+++ b/resources/db/patches/0099~releases.sql
@@ -40,7 +40,6 @@ PARTITION books VALUES LESS THAN (8000),
PARTITION misc VALUES LESS THAN (9000) );
ALTER TABLE releases ADD INDEX ix_releases_adddate (adddate);
-ALTER TABLE releases ADD INDEX ix_releases_rageid (rageid);
ALTER TABLE releases ADD INDEX ix_releases_imdbid (imdbid);
ALTER TABLE releases ADD INDEX ix_releases_guid (guid);
ALTER TABLE releases ADD INDEX ix_releases_name (name);
@@ -52,9 +51,7 @@ ALTER TABLE releases ADD INDEX ix_releases_musicinfoid (musicinfoid);
ALTER TABLE releases ADD INDEX ix_releases_consoleinfoid (consoleinfoid);
ALTER TABLE releases ADD INDEX ix_releases_bookinfoid (bookinfoid);
ALTER TABLE releases ADD INDEX ix_releases_haspreview_passwordstatus (haspreview, passwordstatus);
-ALTER TABLE releases ADD INDEX ix_releases_status (nzbstatus, iscategorized, isrenamed, nfostatus, ishashed, isrequestid, passwordstatus, dehashstatus, reqidstatus, musicinfoid, consoleinfoid, bookinfoid, haspreview, categoryid, imdbid, rageid);
+ALTER TABLE releases ADD INDEX ix_releases_status (nzbstatus, iscategorized, isrenamed, nfostatus, ishashed, isrequestid, passwordstatus, dehashstatus, reqidstatus, musicinfoid, consoleinfoid, bookinfoid, haspreview, categoryid, imdbid);
ALTER TABLE releases ADD INDEX ix_releases_postdate_searchname (postdate, searchname);
ALTER TABLE releases ADD INDEX ix_releases_nzb_guid (nzb_guid);
ALTER TABLE releases ADD INDEX ix_releases_prehash_searchname (prehashid, searchname);
-
-UPDATE tmux set value = '99' where setting = 'sqlpatch';
diff --git a/resources/db/patches/0100~binaries.sql b/resources/db/patches/0100~binaries.sql
index 7fdba70d3..36896ea95 100644
--- a/resources/db/patches/0100~binaries.sql
+++ b/resources/db/patches/0100~binaries.sql
@@ -1,5 +1,3 @@
DROP TRIGGER IF EXISTS delete_binaries;
-CREATE TRIGGER delete_binaries BEFORE DELETE ON binaries FOR EACH ROW BEGIN DELETE FROM parts WHERE binaryID = OLD.id; END;
-
-UPDATE tmux set value = '100' where setting = 'sqlpatch';
\ No newline at end of file
+CREATE TRIGGER delete_binaries BEFORE DELETE ON binaries FOR EACH ROW BEGIN DELETE FROM parts WHERE binaryID = OLD.id; END;
\ No newline at end of file
diff --git a/resources/db/patches/0101~tmux.sql b/resources/db/patches/0101~tmux.sql
index 18b5d9789..e98b95837 100644
--- a/resources/db/patches/0101~tmux.sql
+++ b/resources/db/patches/0101~tmux.sql
@@ -1,4 +1,3 @@
INSERT IGNORE INTO `tmux` (`setting`, `value`) VALUES
('optimize', '0'),
- ('optimize_timer', '86400');
-UPDATE tmux set value = '101' where setting = 'sqlpatch';
\ No newline at end of file
+ ('optimize_timer', '86400');
\ No newline at end of file
diff --git a/resources/db/patches/0102~predb.sql b/resources/db/patches/0102~predb.sql
index 9f009997b..77eb633a1 100644
--- a/resources/db/patches/0102~predb.sql
+++ b/resources/db/patches/0102~predb.sql
@@ -1,2 +1 @@
-ALTER TABLE `predb` drop `MD5`;
-UPDATE tmux set value = '102' where setting = 'sqlpatch';
\ No newline at end of file
+ALTER TABLE `predb` drop `MD5`;
\ No newline at end of file
diff --git a/resources/db/patches/0103~site.sql b/resources/db/patches/0103~site.sql
index 6347448b3..32e4d9bd3 100644
--- a/resources/db/patches/0103~site.sql
+++ b/resources/db/patches/0103~site.sql
@@ -3,5 +3,3 @@ INSERT IGNORE INTO `site` (`setting`, `value`) VALUES
('lastanidbupdate', 0),
('timeoutpath', ''),
('timeoutseconds', 0);
-
-UPDATE `tmux` set `value` = '103' where `setting` = 'sqlpatch';
diff --git a/resources/db/patches/0104~releasecomment.sql b/resources/db/patches/0104~releasecomment.sql
index 1b54065b9..229a628d7 100644
--- a/resources/db/patches/0104~releasecomment.sql
+++ b/resources/db/patches/0104~releasecomment.sql
@@ -1,4 +1,3 @@
ALTER TABLE releasecomment DROP INDEX ix_releasecomment_hash_releaseID;
ALTER TABLE releasecomment DROP INDEX ix_releasecomment_hash_gid_sourceid;
-ALTER IGNORE TABLE releasecomment ADD UNIQUE INDEX ix_releasecomment_hash_gid (text_hash, gid);
-UPDATE `tmux` set `value` = '104' where `setting` = 'sqlpatch';
\ No newline at end of file
+ALTER IGNORE TABLE releasecomment ADD UNIQUE INDEX ix_releasecomment_hash_gid (text_hash, gid);
\ No newline at end of file
diff --git a/resources/db/patches/0105~site.sql b/resources/db/patches/0105~site.sql
index 50f984b50..53a72268d 100644
--- a/resources/db/patches/0105~site.sql
+++ b/resources/db/patches/0105~site.sql
@@ -1,3 +1,2 @@
INSERT IGNORE INTO `site` (`setting`, `value`) VALUES
- ('magic_file_path', '');
-UPDATE `tmux` set `value` = '105' where `setting` = 'sqlpatch';
\ No newline at end of file
+ ('magic_file_path', '');
\ No newline at end of file
diff --git a/resources/db/patches/0106~category.sql b/resources/db/patches/0106~category.sql
index 593c4e8d0..f9c78c4bc 100644
--- a/resources/db/patches/0106~category.sql
+++ b/resources/db/patches/0106~category.sql
@@ -1,2 +1 @@
-INSERT INTO category (id, title, parentid) VALUES (6080, 'SD', 6000);
-UPDATE `tmux` SET `value` = '106' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+INSERT INTO category (id, title, parentid) VALUES (6080, 'SD', 6000);
\ No newline at end of file
diff --git a/resources/db/patches/0107~prehash.sql b/resources/db/patches/0107~prehash.sql
index 937a83ad0..2517d2a07 100644
--- a/resources/db/patches/0107~prehash.sql
+++ b/resources/db/patches/0107~prehash.sql
@@ -1,3 +1,2 @@
UPDATE `prehash` SET `predate` = CONCAT('2014', substr(predate, 5)) WHERE `predate` LIKE '%2015-12%';
-UPDATE `prehash` SET `predate` = CONCAT('2015', substr(predate, 5)) WHERE `predate` LIKE '%2016-01%';
-UPDATE `tmux` SET `value` = '107' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+UPDATE `prehash` SET `predate` = CONCAT('2015', substr(predate, 5)) WHERE `predate` LIKE '%2016-01%';
\ No newline at end of file
diff --git a/resources/db/patches/0108~regexless.sql b/resources/db/patches/0108~regexless.sql
index 76fb875a0..eb52bb8f9 100644
--- a/resources/db/patches/0108~regexless.sql
+++ b/resources/db/patches/0108~regexless.sql
@@ -82,6 +82,4 @@ CREATE TABLE partrepair (
DEFAULT CHARSET = utf8
COLLATE = utf8_unicode_ci;
-CREATE TRIGGER delete_collections BEFORE DELETE ON collections FOR EACH ROW BEGIN DELETE FROM binaries WHERE collection_id = OLD.id;DELETE FROM parts WHERE collection_id = OLD.id;END;
-
-UPDATE `tmux` SET `value` = '108' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+CREATE TRIGGER delete_collections BEFORE DELETE ON collections FOR EACH ROW BEGIN DELETE FROM binaries WHERE collection_id = OLD.id;DELETE FROM parts WHERE collection_id = OLD.id;END;
\ No newline at end of file
diff --git a/resources/db/patches/0109~site.sql b/resources/db/patches/0109~site.sql
index c37c118dc..de1b63b98 100644
--- a/resources/db/patches/0109~site.sql
+++ b/resources/db/patches/0109~site.sql
@@ -1,4 +1,3 @@
INSERT IGNORE INTO `site` (`setting`, `value`) VALUES
('showdroppedyencparts', '0'),
-('delaytime', '2');
-UPDATE `tmux` set `value` = '109' where `setting` = 'sqlpatch';
\ No newline at end of file
+('delaytime', '2');
\ No newline at end of file
diff --git a/resources/db/patches/0110~category.sql b/resources/db/patches/0110~category.sql
index e1463a36f..3a47dd286 100644
--- a/resources/db/patches/0110~category.sql
+++ b/resources/db/patches/0110~category.sql
@@ -1,3 +1,2 @@
INSERT INTO category (id, title, parentid) VALUES (6041, 'HD Clips', 6000);
-INSERT INTO category (id, title, parentid) VALUES (6042, 'SD Clips', 6000);
-UPDATE `tmux` SET `value` = '110' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+INSERT INTO category (id, title, parentid) VALUES (6042, 'SD Clips', 6000);
\ No newline at end of file
diff --git a/resources/db/patches/0112~category.sql b/resources/db/patches/0112~category.sql
index e3cbaf2d1..a607f96f4 100644
--- a/resources/db/patches/0112~category.sql
+++ b/resources/db/patches/0112~category.sql
@@ -1,2 +1 @@
-INSERT INTO category (id, title, parentid) VALUES (6090, 'WEB-DL', 6000);
-UPDATE `tmux` SET `value` = '112' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+INSERT INTO category (id, title, parentid) VALUES (6090, 'WEB-DL', 6000);
\ No newline at end of file
diff --git a/resources/db/patches/0113~releases.sql b/resources/db/patches/0113~releases.sql
index f5ccd4713..daeed3af7 100644
--- a/resources/db/patches/0113~releases.sql
+++ b/resources/db/patches/0113~releases.sql
@@ -1,2 +1 @@
-ALTER TABLE releases ADD INDEX ix_releases_preid_searchname (preid, searchname);
-UPDATE `tmux` SET `value` = '113' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+ALTER TABLE releases ADD INDEX ix_releases_preid_searchname (preid, searchname);
\ No newline at end of file
diff --git a/resources/db/patches/0114~collection_regexes.sql b/resources/db/patches/0114~collection_regexes.sql
index 5a5417568..ea3470565 100644
--- a/resources/db/patches/0114~collection_regexes.sql
+++ b/resources/db/patches/0114~collection_regexes.sql
@@ -59,6 +59,4 @@ INSERT INTO collection_regexes (id, group_regex, regex, status, description, ord
1,
't2EI3CdWdF0hi5b8L9tkx[08/52] - "t2EI3CdWdF0hi5b8L9tkx.part07.rar" yEnc',
5
-);
-
-UPDATE `tmux` SET `value` = '114' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+);
\ No newline at end of file
diff --git a/resources/db/patches/0115~tmux.sql b/resources/db/patches/0115~tmux.sql
index c5d09ffbb..43c482c66 100644
--- a/resources/db/patches/0115~tmux.sql
+++ b/resources/db/patches/0115~tmux.sql
@@ -1,2 +1 @@
-INSERT IGNORE INTO `tmux` (`setting`, `value`) VALUES ('import_count','50000');
-UPDATE `tmux` SET `value` = '115' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+INSERT IGNORE INTO `tmux` (`setting`, `value`) VALUES ('import_count','50000');
\ No newline at end of file
diff --git a/resources/db/patches/0116~tmux.sql b/resources/db/patches/0116~tmux.sql
index 00b84c4da..9c816ca72 100644
--- a/resources/db/patches/0116~tmux.sql
+++ b/resources/db/patches/0116~tmux.sql
@@ -1,2 +1 @@
-INSERT IGNORE INTO `tmux` (`setting`, `value`) VALUES ('collections_kill','0');
-UPDATE `tmux` SET `value` = '116' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+INSERT IGNORE INTO `tmux` (`setting`, `value`) VALUES ('collections_kill','0');
\ No newline at end of file
diff --git a/resources/db/patches/0117~tmux.sql b/resources/db/patches/0117~tmux.sql
index 1dddec8a5..563c5a94c 100644
--- a/resources/db/patches/0117~tmux.sql
+++ b/resources/db/patches/0117~tmux.sql
@@ -1,3 +1,2 @@
DELETE FROM `tmux` WHERE `setting` = 'max_load';
-DELETE FROM `tmux` WHERE `setting` = 'max_load_releases';
-UPDATE `tmux` set `value` = '117' where `setting` = 'sqlpatch';
\ No newline at end of file
+DELETE FROM `tmux` WHERE `setting` = 'max_load_releases';
\ No newline at end of file
diff --git a/resources/db/patches/0118~release_naming_regexes.sql b/resources/db/patches/0118~release_naming_regexes.sql
index 7bfea98b4..7d33f8263 100644
--- a/resources/db/patches/0118~release_naming_regexes.sql
+++ b/resources/db/patches/0118~release_naming_regexes.sql
@@ -66,6 +66,4 @@ INSERT INTO release_naming_regexes (id, group_regex, regex, status, description,
1,
'[17319]-[FULL]-[#a.b.teevee@EFNet]-[ CSI.New.York.S05E22.720p.HDTV.X264-DIMENSION ]-[01/34] "csi.new.york.522.720p-dimension.nfo" (1/1) (1/1',
35
-);
-
-UPDATE `tmux` set `value` = '118' where `setting` = 'sqlpatch';
\ No newline at end of file
+);
\ No newline at end of file
diff --git a/resources/db/patches/0119~category_regex.sql b/resources/db/patches/0119~category_regex.sql
index 73237924f..58231749f 100644
--- a/resources/db/patches/0119~category_regex.sql
+++ b/resources/db/patches/0119~category_regex.sql
@@ -32,5 +32,4 @@ INSERT INTO category_regexes (id, group_regex, regex, status, description, ordin
'',
50,
1120
-);
-UPDATE `tmux` set `value` = '119' where `setting` = 'sqlpatch';
\ No newline at end of file
+);
\ No newline at end of file
diff --git a/resources/db/patches/0120~release_naming_regexes.sql b/resources/db/patches/0120~release_naming_regexes.sql
index 07d73b8a2..1e1c8caae 100644
--- a/resources/db/patches/0120~release_naming_regexes.sql
+++ b/resources/db/patches/0120~release_naming_regexes.sql
@@ -7840,5 +7840,4 @@ INSERT INTO release_naming_regexes (id, group_regex, regex, status, description,
1,
'//[ TOWN ]-[ www.town.ag ]-[ ANIME ] [01/17] - "[Chyuu] Nanatsu no Taizai - 12 [720p][D1F49539].par2" - 585,03 MB yEnc',
105
-);
-UPDATE `tmux` set `value` = '120' where `setting` = 'sqlpatch';
\ No newline at end of file
+);
\ No newline at end of file
diff --git a/resources/db/patches/0121~collection_regexes.sql b/resources/db/patches/0121~collection_regexes.sql
index bbbb54aec..96a9a2f69 100644
--- a/resources/db/patches/0121~collection_regexes.sql
+++ b/resources/db/patches/0121~collection_regexes.sql
@@ -4047,5 +4047,4 @@ VALUES (
1,
'//Store.Boligdroemme.S02E06.DANiS H.HDTV.x264-TVBYEN - [01/28] - "store.boligdroemme.s02e06.danis h.hdtv.x264-tvbyen.nfo" yEnc',
5
-);
-UPDATE `tmux` set `value` = '121' where `setting` = 'sqlpatch';
\ No newline at end of file
+);
\ No newline at end of file
diff --git a/resources/db/patches/0122~general.sql b/resources/db/patches/0122~general.sql
index a117ca47a..39ede5adc 100644
--- a/resources/db/patches/0122~general.sql
+++ b/resources/db/patches/0122~general.sql
@@ -7,5 +7,4 @@ CALL alter_tables();
DROP PROCEDURE IF EXISTS alter_tables;
ALTER TABLE musicinfo ADD FULLTEXT INDEX ix_musicinfo_artist_title_ft (artist, title);
ALTER TABLE bookinfo ADD FULLTEXT INDEX ix_bookinfo_author_title_ft (author, title);
-ALTER TABLE consoleinfo ADD FULLTEXT INDEX ix_consoleinfo_title_platform_ft (title, platform);
-UPDATE `tmux` set `value` = '122' where `setting` = 'sqlpatch';
\ No newline at end of file
+ALTER TABLE consoleinfo ADD FULLTEXT INDEX ix_consoleinfo_title_platform_ft (title, platform);
\ No newline at end of file
diff --git a/resources/db/patches/0123~release_naming_regexes.sql b/resources/db/patches/0123~release_naming_regexes.sql
index 974f4dc70..b81ef2550 100644
--- a/resources/db/patches/0123~release_naming_regexes.sql
+++ b/resources/db/patches/0123~release_naming_regexes.sql
@@ -13,5 +13,4 @@ VALUES (
1,
'//(Navy CIS - Drei Folgen) [35/63] - "NCIS.part34.rar" yEnc',
10
-);
-UPDATE `tmux` set `value` = '123' where `setting` = 'sqlpatch';
\ No newline at end of file
+);
\ No newline at end of file
diff --git a/resources/db/patches/0124~movieinfo.sql b/resources/db/patches/0124~movieinfo.sql
index 91102758c..8b1db4967 100644
--- a/resources/db/patches/0124~movieinfo.sql
+++ b/resources/db/patches/0124~movieinfo.sql
@@ -1,2 +1 @@
-ALTER TABLE movieinfo ADD COLUMN banner TINYINT(1) UNSIGNED NOT NULL DEFAULT '0';
-UPDATE `tmux` set `value` = '124' where `setting` = 'sqlpatch';
\ No newline at end of file
+ALTER TABLE movieinfo ADD COLUMN banner TINYINT(1) UNSIGNED NOT NULL DEFAULT '0';
\ No newline at end of file
diff --git a/resources/db/patches/0125~faileddownloads.sql b/resources/db/patches/0125~faileddownloads.sql
index c4cb54623..f42058ea1 100644
--- a/resources/db/patches/0125~faileddownloads.sql
+++ b/resources/db/patches/0125~faileddownloads.sql
@@ -9,5 +9,4 @@ CREATE TABLE dnzb_failures (
DEFAULT CHARSET =utf8
COLLATE =utf8_unicode_ci
AUTO_INCREMENT =1;
- CREATE UNIQUE INDEX ux_dnzb_failures ON dnzb_failures (userid, guid);
- UPDATE `tmux` set `value` = '125' where `setting` = 'sqlpatch';
\ No newline at end of file
+ CREATE UNIQUE INDEX ux_dnzb_failures ON dnzb_failures (userid, guid);
\ No newline at end of file
diff --git a/resources/db/patches/0127~site.sql b/resources/db/patches/0127~site.sql
index 297c5499d..03951e622 100644
--- a/resources/db/patches/0127~site.sql
+++ b/resources/db/patches/0127~site.sql
@@ -1,2 +1 @@
-UPDATE `site` SET value = 'http://reqid.newznab-tmux.pw/' where setting = 'request_url';
-UPDATE `tmux` SET `value` = '127' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+UPDATE `site` SET value = 'http://reqid.newznab-tmux.pw/' where setting = 'request_url';
\ No newline at end of file
diff --git a/resources/db/patches/0128~collection_regexes.sql b/resources/db/patches/0128~collection_regexes.sql
index 858d2d963..43f07bde3 100644
--- a/resources/db/patches/0128~collection_regexes.sql
+++ b/resources/db/patches/0128~collection_regexes.sql
@@ -4046,5 +4046,4 @@ VALUES (
1,
'//Store.Boligdroemme.S02E06.DANiS H.HDTV.x264-TVBYEN - [01/28] - "store.boligdroemme.s02e06.danis h.hdtv.x264-tvbyen.nfo" yEnc',
5
-);
-UPDATE `tmux` SET `value` = '128' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+);
\ No newline at end of file
diff --git a/resources/db/patches/0129~category_regexes.sql b/resources/db/patches/0129~category_regexes.sql
index 6c741d61a..539b77693 100644
--- a/resources/db/patches/0129~category_regexes.sql
+++ b/resources/db/patches/0129~category_regexes.sql
@@ -8,5 +8,4 @@ INSERT INTO category_regexes (id, group_regex, regex, status, description, ordin
'',
50,
1120
-);
-UPDATE `tmux` SET `value` = '129' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+);
\ No newline at end of file
diff --git a/resources/db/patches/0130~release_naming_regexes.sql b/resources/db/patches/0130~release_naming_regexes.sql
index aca73b38b..1872353ae 100644
--- a/resources/db/patches/0130~release_naming_regexes.sql
+++ b/resources/db/patches/0130~release_naming_regexes.sql
@@ -7871,5 +7871,4 @@ VALUES (
1,
'//(Navy CIS - Drei Folgen) [35/63] - "NCIS.part34.rar" yEnc',
10
-);
-UPDATE `tmux` SET `value` = '130' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+);
\ No newline at end of file
diff --git a/resources/db/patches/0131~blacklist.sql b/resources/db/patches/0131~blacklist.sql
index dbb943011..e2d47c1a3 100644
--- a/resources/db/patches/0131~blacklist.sql
+++ b/resources/db/patches/0131~blacklist.sql
@@ -1,2 +1 @@
-insert into binaryblacklist (groupname, msgcol, regex, description) VALUES ('alt.binaries.*', '2', 'DVD@Freakz\.net|DVD@Frz\.net|DVD@Hookie\.com|DVDz@FZ\.net|DVDZ@MOvIEs\.net|emixface@gmail\.com|Firm@DVD\.net|Frkz@XviD\.net|HD@movies\.com|ilove@movies\.com|ILOVE@MOvIEs\.net|info@dvd\.et|info@XviD\.net|info@xvid2\.net|max0204@gmail\.com|moovee@4u\.tv|Movie@Freaks\.net|Movie@post\.com|Movie@ZL\.net|Movies@movie\.net|moviess@mov\.net|Moviez@XviD\.com|MOVZ@rel\.com|power@live\.de|Power@post\.com|Ran@Movies\.com|RD@mov\.net|seti312@gmail\.com|TOP@imdbmovies\.com|USER@domain\.com|VIDZ@pwrpst\.net|XviD@movies\.net|Xvid@pwrpst\.net|XviD@world\.net|XvidZ@MOvIEs\.net|Xvidz@video\.net|moviess@movies\.net|Para@tropz\.com|Mov@ing\.com|MV@ing\.com|HDMovies@love\.com|Daco@Co\.com|dfrebgf@frednmp\.com|Xvido@Co\.com|movies@montain\.com|mov@ies\.com|movies@movie\.com', 'codec poster');
-UPDATE `tmux` SET `value` = '131' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+insert into binaryblacklist (groupname, msgcol, regex, description) VALUES ('alt.binaries.*', '2', 'DVD@Freakz\.net|DVD@Frz\.net|DVD@Hookie\.com|DVDz@FZ\.net|DVDZ@MOvIEs\.net|emixface@gmail\.com|Firm@DVD\.net|Frkz@XviD\.net|HD@movies\.com|ilove@movies\.com|ILOVE@MOvIEs\.net|info@dvd\.et|info@XviD\.net|info@xvid2\.net|max0204@gmail\.com|moovee@4u\.tv|Movie@Freaks\.net|Movie@post\.com|Movie@ZL\.net|Movies@movie\.net|moviess@mov\.net|Moviez@XviD\.com|MOVZ@rel\.com|power@live\.de|Power@post\.com|Ran@Movies\.com|RD@mov\.net|seti312@gmail\.com|TOP@imdbmovies\.com|USER@domain\.com|VIDZ@pwrpst\.net|XviD@movies\.net|Xvid@pwrpst\.net|XviD@world\.net|XvidZ@MOvIEs\.net|Xvidz@video\.net|moviess@movies\.net|Para@tropz\.com|Mov@ing\.com|MV@ing\.com|HDMovies@love\.com|Daco@Co\.com|dfrebgf@frednmp\.com|Xvido@Co\.com|movies@montain\.com|mov@ies\.com|movies@movie\.com', 'codec poster');
\ No newline at end of file
diff --git a/resources/db/patches/0132~site.sql b/resources/db/patches/0132~site.sql
index b7445169d..d3c9c43a1 100644
--- a/resources/db/patches/0132~site.sql
+++ b/resources/db/patches/0132~site.sql
@@ -1,2 +1 @@
-DELETE FROM settings WHERE setting = 'rottentomatoquality';
-UPDATE `tmux` SET `value` = '132' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+DELETE FROM settings WHERE setting = 'rottentomatoquality';
\ No newline at end of file
diff --git a/resources/db/patches/0133~collection_regexes.sql b/resources/db/patches/0133~collection_regexes.sql
index df323329c..3a10621bd 100644
--- a/resources/db/patches/0133~collection_regexes.sql
+++ b/resources/db/patches/0133~collection_regexes.sql
@@ -4039,5 +4039,4 @@ VALUES (
1,
'//Store.Boligdroemme.S02E06.DANiS H.HDTV.x264-TVBYEN - [01/28] - "store.boligdroemme.s02e06.danis h.hdtv.x264-tvbyen.nfo" yEnc',
5
-);
-UPDATE `tmux` SET `value` = '133' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+);
\ No newline at end of file
diff --git a/resources/db/patches/0134~collection_regexes.sql b/resources/db/patches/0134~collection_regexes.sql
index bc0a12d21..3a10621bd 100644
--- a/resources/db/patches/0134~collection_regexes.sql
+++ b/resources/db/patches/0134~collection_regexes.sql
@@ -4039,5 +4039,4 @@ VALUES (
1,
'//Store.Boligdroemme.S02E06.DANiS H.HDTV.x264-TVBYEN - [01/28] - "store.boligdroemme.s02e06.danis h.hdtv.x264-tvbyen.nfo" yEnc',
5
-);
-UPDATE `tmux` SET `value` = '134' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+);
\ No newline at end of file
diff --git a/resources/db/patches/0135~collection_regexes.sql b/resources/db/patches/0135~collection_regexes.sql
index 6d00e4bef..a7a1631ad 100644
--- a/resources/db/patches/0135~collection_regexes.sql
+++ b/resources/db/patches/0135~collection_regexes.sql
@@ -6,5 +6,4 @@ VALUES (
1,
'Uploader.Presents-Black.Sails.S02E02.Die.schwarze.Flagge.GERMAN.DUBBED.BLURAYRiP.x264-SOF [00/23]"sof-black-sails-s02e02.nzb" yEnc',
10
-);
-UPDATE `tmux` SET `value` = '135' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+);
\ No newline at end of file
diff --git a/resources/db/patches/0136~release_naming_regexes.sql b/resources/db/patches/0136~release_naming_regexes.sql
index 02c90ca8a..4c0cd5ad5 100644
--- a/resources/db/patches/0136~release_naming_regexes.sql
+++ b/resources/db/patches/0136~release_naming_regexes.sql
@@ -13,5 +13,4 @@ VALUES (
1,
'Uploader.Presents-Black.Sails.S02E02.Die.schwarze.Flagge.GERMAN.DUBBED.BLURAYRiP.x264-SOF [00/23]"sof-black-sails-s02e02.nzb" yEnc',
10
-);
-UPDATE `tmux` SET `value` = '136' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+);
\ No newline at end of file
diff --git a/resources/db/patches/0137~groups.sql b/resources/db/patches/0137~groups.sql
index 2430152e8..c86601ce3 100644
--- a/resources/db/patches/0137~groups.sql
+++ b/resources/db/patches/0137~groups.sql
@@ -1,2 +1 @@
-INSERT INTO groups (name, description) VALUES ('alt.binaries.fz', 'This group contains german Movies and TV.') ON DUPLICATE KEY UPDATE name = 'alt.binaries.fz';
-UPDATE `tmux` SET `value` = '137' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+INSERT INTO groups (name, description) VALUES ('alt.binaries.fz', 'This group contains german Movies and TV.') ON DUPLICATE KEY UPDATE name = 'alt.binaries.fz';
\ No newline at end of file
diff --git a/resources/db/patches/0138~collection_regexes.sql b/resources/db/patches/0138~collection_regexes.sql
index 819331244..ca7d98510 100644
--- a/resources/db/patches/0138~collection_regexes.sql
+++ b/resources/db/patches/0138~collection_regexes.sql
@@ -27,5 +27,4 @@ VALUES (
1,
'JN Dutplanet.net - [02/16] - "JN Dutplanet.net Foreigner - I Want To Know What Love Is - The Ballads [2014]FLAC.part1.rar" yEnc',
5
-);
-UPDATE `tmux` SET `value` = '138' WHERE `setting` = 'sqlpatch';
+);
\ No newline at end of file
diff --git a/resources/db/patches/0139~users.sql b/resources/db/patches/0139~users.sql
index d92cadd77..601e1c22c 100644
--- a/resources/db/patches/0139~users.sql
+++ b/resources/db/patches/0139~users.sql
@@ -1,4 +1,2 @@
ALTER TABLE users ADD COLUMN style VARCHAR(255) NULL DEFAULT NULL;
/* Add a column to pick a site theme */
-
-UPDATE `tmux` SET `value` = '139' WHERE `setting` = 'sqlpatch';
diff --git a/resources/db/patches/0140~collection_regexes.sql b/resources/db/patches/0140~collection_regexes.sql
index d53003c4a..089b07ba1 100644
--- a/resources/db/patches/0140~collection_regexes.sql
+++ b/resources/db/patches/0140~collection_regexes.sql
@@ -28,5 +28,4 @@ VALUES (
1,
'JN Dutplanet.net - [02/16] - "JN Dutplanet.net Foreigner - I Want To Know What Love Is - The Ballads [2014]FLAC.part1.rar" yEnc',
5
-);
-UPDATE `tmux` SET `value` = '140' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+);
\ No newline at end of file
diff --git a/resources/db/patches/0141~collection_regexes.sql b/resources/db/patches/0141~collection_regexes.sql
index d20b7792f..12caa5914 100644
--- a/resources/db/patches/0141~collection_regexes.sql
+++ b/resources/db/patches/0141~collection_regexes.sql
@@ -28,5 +28,4 @@ VALUES (
1,
'JN Dutplanet.net - [02/16] - "JN Dutplanet.net Foreigner - I Want To Know What Love Is - The Ballads [2014]FLAC.part1.rar" yEnc',
5
-);
-UPDATE `tmux` SET `value` = '141' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+);
\ No newline at end of file
diff --git a/resources/db/patches/0142~collection_regexes.sql b/resources/db/patches/0142~collection_regexes.sql
index afb68cce4..d9ad40c58 100644
--- a/resources/db/patches/0142~collection_regexes.sql
+++ b/resources/db/patches/0142~collection_regexes.sql
@@ -28,5 +28,4 @@ VALUES (
1,
'JN Dutplanet.net - [02/16] - "JN Dutplanet.net Foreigner - I Want To Know What Love Is - The Ballads [2014]FLAC.part1.rar" yEnc',
5
-);
-UPDATE `tmux` SET `value` = '142' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+);
\ No newline at end of file
diff --git a/resources/db/patches/0143~collection_regexes.sql b/resources/db/patches/0143~collection_regexes.sql
index e10fd5205..b9d1fbfed 100644
--- a/resources/db/patches/0143~collection_regexes.sql
+++ b/resources/db/patches/0143~collection_regexes.sql
@@ -14,4 +14,3 @@ VALUES (
'Dragonlance Second Generation - Dragons of Summer Flame (NMR 32 kbps) "Dragonlance Second Generation - Dragons of Summer Flame.nzb" 000/141 yEnc',
85
);
-UPDATE `tmux` SET `value` = '143' WHERE `setting` = 'sqlpatch';
diff --git a/resources/db/patches/0144~site.sql b/resources/db/patches/0144~site.sql
index 683b55323..d3c3d47fc 100644
--- a/resources/db/patches/0144~site.sql
+++ b/resources/db/patches/0144~site.sql
@@ -1,3 +1 @@
-INSERT INTO `site` (`setting`, `value`) VALUES ('coverspath', './resources/covers');
-
-UPDATE `tmux` SET `value` = '144' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+INSERT INTO `site` (`setting`, `value`) VALUES ('coverspath', './resources/covers');
\ No newline at end of file
diff --git a/resources/db/patches/0145~collection_regexes.sql b/resources/db/patches/0145~collection_regexes.sql
index 8b3b6ecf3..c1fba681a 100644
--- a/resources/db/patches/0145~collection_regexes.sql
+++ b/resources/db/patches/0145~collection_regexes.sql
@@ -7,5 +7,4 @@ VALUES (
1,
'//[27849]-[altbinEFNet]-[Full]- "ppt-sogz.001" - 7,62 GB - yEnc ::: //[27925]--[altbinEFNet]-[Full]- "unl_p2rd.par2" yEnc ::: //[27608]-[FULL]-[#altbin@EFNet]-[007/136] "27608-1.005" yEnc ::: //[30605]-[altbinEFNet]-[FULL]- [10/165] - "plaza-the.witcher.3.wild.hunt.r09" yEnc',
5
-);
-UPDATE `tmux` SET `value` = '145' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+);
\ No newline at end of file
diff --git a/resources/db/patches/0146~collection_regexes.sql b/resources/db/patches/0146~collection_regexes.sql
index c3628e000..aed678302 100644
--- a/resources/db/patches/0146~collection_regexes.sql
+++ b/resources/db/patches/0146~collection_regexes.sql
@@ -7,5 +7,4 @@ VALUES (
1,
'//[27849]-[altbinEFNet]-[Full]- "ppt-sogz.001" - 7,62 GB - yEnc ::: //[27925]--[altbinEFNet]-[Full]- "unl_p2rd.par2" yEnc ::: //[27608]-[FULL]-[#altbin@EFNet]-[007/136] "27608-1.005" yEnc ::: //[30605]-[altbinEFNet]-[FULL]- [10/165] - "plaza-the.witcher.3.wild.hunt.r09" yEnc ::: //[]-[#altbin@EFNet]-[Full]-[ACE.LIGHTNING.PLUS.6.TRAINER-DEViANCE]-[0/8] - "deviance.nfo" yEnc',
5
-);
-UPDATE `tmux` SET `value` = '146' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+);
\ No newline at end of file
diff --git a/resources/db/patches/0147~site.sql b/resources/db/patches/0147~site.sql
index 79a574a50..321c881de 100644
--- a/resources/db/patches/0147~site.sql
+++ b/resources/db/patches/0147~site.sql
@@ -1,2 +1 @@
-INSERT INTO `site` (`setting`, `value`) VALUES ('userselstyle', '0');
-UPDATE `tmux` SET `value` = '147' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+INSERT INTO `site` (`setting`, `value`) VALUES ('userselstyle', '0');
\ No newline at end of file
diff --git a/resources/db/patches/0148~site.sql b/resources/db/patches/0148~site.sql
index 241336767..5c348edac 100644
--- a/resources/db/patches/0148~site.sql
+++ b/resources/db/patches/0148~site.sql
@@ -1,2 +1 @@
-INSERT INTO `site` (`setting`, `value`) VALUES ('processthumbnails', '0');
-UPDATE `tmux` SET `value` = '148' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
+INSERT INTO `site` (`setting`, `value`) VALUES ('processthumbnails', '0');
\ No newline at end of file
diff --git a/resources/db/patches/0149~settings.sql b/resources/db/patches/0149~settings.sql
index f20cfe6a3..7635b423f 100644
--- a/resources/db/patches/0149~settings.sql
+++ b/resources/db/patches/0149~settings.sql
@@ -10,5 +10,4 @@ ALTER TABLE site
ADD PRIMARY KEY (section, subsection, name),
ADD UNIQUE INDEX ui_settings_setting (setting);
RENAME TABLE site TO settings;
-UPDATE settings SET value = 149 WHERE setting = 'sqlpatch';
diff --git a/resources/db/patches/0175~releases.sql b/resources/db/patches/0175~releases.sql
index 2d81c4110..b688d2c9f 100644
--- a/resources/db/patches/0175~releases.sql
+++ b/resources/db/patches/0175~releases.sql
@@ -6,7 +6,7 @@
CREATE TABLE releases_tmp LIKE releases;
ALTER TABLE releases_tmp MODIFY nzb_guid BINARY(16) NULL;
-INSERT INTO releases_tmp (SELECT id, gid, name, searchname, totalpart, groupid, size, postdate, adddate, updatedate, guid, fromname, completion, categoryid, regexid, rageid, tvdbid, seriesfull, season, episode, tvtitle, tvairdate, imdbid, episodeinfoid, musicinfoid, consoleinfoid, bookinfoid, preid, anidbid, reqid, releasenfoid, grabs, comments, passwordstatus, rarinnerfilecount, haspreview, dehashstatus, nfostatus, jpgstatus, audiostatus, videostatus, reqidstatus, prehashid, iscategorized, isrenamed, ishashed, isrequestid, proc_pp, proc_par2, proc_nfo, proc_files, gamesinfo_id, xxxinfo_id, proc_sorter, nzbstatus, UNHEX(nzb_guid) FROM releases);
+INSERT INTO releases_tmp (SELECT id, gid, name, searchname, totalpart, groupid, size, postdate, adddate, updatedate, guid, fromname, completion, categoryid, regexid, tvinfoid, seriesfull, season, episode, tvtitle, tvairdate, imdbid, episodeinfoid, musicinfoid, consoleinfoid, bookinfoid, preid, anidbid, reqid, releasenfoid, grabs, comments, passwordstatus, rarinnerfilecount, haspreview, dehashstatus, nfostatus, jpgstatus, audiostatus, videostatus, reqidstatus, prehashid, iscategorized, isrenamed, ishashed, isrequestid, proc_pp, proc_par2, proc_nfo, proc_files, gamesinfo_id, xxxinfo_id, proc_sorter, nzbstatus, UNHEX(nzb_guid) FROM releases);
DROP TABLE releases;
ALTER TABLE releases_tmp RENAME releases;
\ No newline at end of file
diff --git a/resources/db/patches/0184~releases.sql b/resources/db/patches/0184~releases.sql
index 3e647870e..0152f5344 100644
--- a/resources/db/patches/0184~releases.sql
+++ b/resources/db/patches/0184~releases.sql
@@ -43,7 +43,6 @@ ALTER TABLE releases
ADD INDEX ix_releases_postdate_searchname (postdate,searchname),
ADD INDEX ix_releases_guid (guid),
ADD INDEX ix_releases_nzb_guid (nzb_guid),
- ADD INDEX ix_releases_rageid (rageid),
ADD INDEX ix_releases_imdbid (imdbid),
ADD INDEX ix_releases_xxxinfo_id (xxxinfo_id),
ADD INDEX ix_releases_musicinfoid (musicinfoid,passwordstatus),
diff --git a/www/admin/ajax.php b/www/admin/ajax.php
index f0cd655e9..85a068753 100644
--- a/www/admin/ajax.php
+++ b/www/admin/ajax.php
@@ -1,5 +1,12 @@
$admin->settings]);
diff --git a/www/admin/ajax_regex-list.php b/www/admin/ajax_regex-list.php
index 57f208c3f..eb1741a07 100644
--- a/www/admin/ajax_regex-list.php
+++ b/www/admin/ajax_regex-list.php
@@ -1,6 +1,9 @@
$admin->settings]))->deleteRegex($id);
+ (new Regexes(['Settings' => $admin->settings]))->deleteRegex($id);
print "Regex $id deleted.";
break;
case 2:
$id = (int) $_GET['bin_id'];
- (new \Binaries(['Settings' => $admin->settings]))->deleteBlacklist($id);
+ (new Binaries(['Settings' => $admin->settings]))->deleteBlacklist($id);
print "Blacklist $id deleted.";
break;
}
\ No newline at end of file
diff --git a/www/admin/ajax_sharing_settings.php b/www/admin/ajax_sharing_settings.php
index f9596ad34..bffcbe43d 100644
--- a/www/admin/ajax_sharing_settings.php
+++ b/www/admin/ajax_sharing_settings.php
@@ -2,9 +2,14 @@
require_once './config.php';
+use newznab\controllers\AdminPage;
+use newznab\db\Settings;
+use newznab\controllers\Sharing;
+use newznab\controllers\ReleaseComments;
+
// Login check.
$admin = new AdminPage;
-$db = new newznab\db\Settings();
+$db = new Settings();
if (isset($_GET['site_ID']) && isset($_GET['site_status'])) {
$db->queryExec(sprintf('UPDATE sharing_sites SET enabled = %d WHERE id = %d', $_GET['site_status'], $_GET['site_ID']));
diff --git a/www/admin/ajax_welcome_msg.php b/www/admin/ajax_welcome_msg.php
index 3d743a66a..9c692d1b2 100644
--- a/www/admin/ajax_welcome_msg.php
+++ b/www/admin/ajax_welcome_msg.php
@@ -1,6 +1,9 @@
$page->settings, 'Table_Name' => 'category_regexes']);
diff --git a/www/admin/category_regexes-list.php b/www/admin/category_regexes-list.php
index 10296d0ff..f6e0e49d9 100644
--- a/www/admin/category_regexes-list.php
+++ b/www/admin/category_regexes-list.php
@@ -1,6 +1,9 @@
$page->settings, 'Table_Name' => 'category_regexes']);
diff --git a/www/admin/collection_regexes-edit.php b/www/admin/collection_regexes-edit.php
index fd6e4e448..04e9b9cef 100644
--- a/www/admin/collection_regexes-edit.php
+++ b/www/admin/collection_regexes-edit.php
@@ -1,6 +1,10 @@
$page->settings, 'Table_Name' => 'collection_regexes']);
$error = '';
diff --git a/www/admin/collection_regexes-list.php b/www/admin/collection_regexes-list.php
index 239a6adc4..d3b09e6c4 100644
--- a/www/admin/collection_regexes-list.php
+++ b/www/admin/collection_regexes-list.php
@@ -1,6 +1,9 @@
$page->settings, 'Table_Name' => 'collection_regexes']);
diff --git a/www/admin/collection_regexes-test.php b/www/admin/collection_regexes-test.php
index d663dd4ab..add39673d 100644
--- a/www/admin/collection_regexes-test.php
+++ b/www/admin/collection_regexes-test.php
@@ -1,6 +1,9 @@
title = "Collections Regex Test";
diff --git a/www/admin/comments-delete.php b/www/admin/comments-delete.php
index 8521650d0..bb88c5f22 100644
--- a/www/admin/comments-delete.php
+++ b/www/admin/comments-delete.php
@@ -1,6 +1,9 @@
settings);
diff --git a/www/admin/config.php b/www/admin/config.php
index fabf2a79f..e271aa62a 100644
--- a/www/admin/config.php
+++ b/www/admin/config.php
@@ -1,7 +1,5 @@
\ No newline at end of file
diff --git a/www/admin/console-edit.php b/www/admin/console-edit.php
index f18447eac..b7e306f06 100644
--- a/www/admin/console-edit.php
+++ b/www/admin/console-edit.php
@@ -2,6 +2,10 @@
require_once './config.php';
+use newznab\controllers\AdminPage;
+use newznab\controllers\Console;
+use newznab\controllers\Genres;
+
$page = new AdminPage();
$console = new Console(['Settings' => $page->settings]);
$gen = new Genres();
diff --git a/www/admin/console-list.php b/www/admin/console-list.php
index 6cc5424fb..781331a0e 100644
--- a/www/admin/console-list.php
+++ b/www/admin/console-list.php
@@ -2,6 +2,9 @@
require_once './config.php';
+use newznab\controllers\AdminPage;
+use newznab\controllers\Console;
+
$page = new AdminPage();
$con = new Console(['Settings' => $page->settings]);
diff --git a/www/admin/content-add.php b/www/admin/content-add.php
index e184bbc29..b1cc3e2cc 100644
--- a/www/admin/content-add.php
+++ b/www/admin/content-add.php
@@ -1,6 +1,11 @@
$page->settings]);
diff --git a/www/admin/content-delete.php b/www/admin/content-delete.php
index aff67f04c..696433b97 100644
--- a/www/admin/content-delete.php
+++ b/www/admin/content-delete.php
@@ -2,6 +2,9 @@
require_once './config.php';
+use newznab\controllers\AdminPage;
+use newznab\controllers\Contents;
+
$page = new AdminPage();
if (isset($_GET['id']))
diff --git a/www/admin/content-list.php b/www/admin/content-list.php
index 48d230d53..47ce73e60 100644
--- a/www/admin/content-list.php
+++ b/www/admin/content-list.php
@@ -1,6 +1,9 @@
$page->settings]);
diff --git a/www/admin/db-optimise.php b/www/admin/db-optimise.php
deleted file mode 100644
index 58c24141b..000000000
--- a/www/admin/db-optimise.php
+++ /dev/null
@@ -1,14 +0,0 @@
-optimise();
-
-$page->title = "DB Table Optimise";
-$page->smarty->assign('tablelist',$tablelist);
-$page->content = $page->smarty->fetch('db-optimise.tpl');
-$page->render();
diff --git a/www/admin/failrel-list.php b/www/admin/failrel-list.php
index aab37f9c1..9afa56cee 100644
--- a/www/admin/failrel-list.php
+++ b/www/admin/failrel-list.php
@@ -2,6 +2,9 @@
require_once("config.php");
+use newznab\controllers\AdminPage;
+use newznab\controllers\DnzbFailures;
+
$page = new AdminPage();
$failed = new DnzbFailures(['Settings' => $page->settings]);
diff --git a/www/admin/forum-delete.php b/www/admin/forum-delete.php
index e672021db..4b1e92994 100644
--- a/www/admin/forum-delete.php
+++ b/www/admin/forum-delete.php
@@ -1,6 +1,9 @@
$page->settings]);
$gen = new Genres(['Settings' => $page->settings]);
@@ -42,7 +46,7 @@ if (isset($_REQUEST["id"])) {
default:
$page->title = "Game Edit";
$page->smarty->assign('game', $game);
- $page->smarty->assign('genres', $gen->getGenres(\Genres::GAME_TYPE));
+ $page->smarty->assign('genres', $gen->getGenres(Genres::GAME_TYPE));
break;
}
}
diff --git a/www/admin/game-list.php b/www/admin/game-list.php
index e6c94d193..b04dd9639 100644
--- a/www/admin/game-list.php
+++ b/www/admin/game-list.php
@@ -1,6 +1,9 @@
$page->settings]);
diff --git a/www/admin/group-bulk.php b/www/admin/group-bulk.php
index 1a0a67472..2388abb00 100644
--- a/www/admin/group-bulk.php
+++ b/www/admin/group-bulk.php
@@ -2,6 +2,9 @@
require_once './config.php';
+use newznab\controllers\AdminPage;
+use newznab\controllers\Groups;
+
$page = new AdminPage();
// set the current action
diff --git a/www/admin/group-edit.php b/www/admin/group-edit.php
index c2e0e7f0e..325a2a532 100644
--- a/www/admin/group-edit.php
+++ b/www/admin/group-edit.php
@@ -2,6 +2,9 @@
require_once './config.php';
+use newznab\controllers\AdminPage;
+use newznab\controllers\Groups;
+
$page = new AdminPage();
$groups = new Groups(['Settings' => $page->settings]);
$id = 0;
diff --git a/www/admin/group-list-active.php b/www/admin/group-list-active.php
index 9e61326cc..abe384ec5 100644
--- a/www/admin/group-list-active.php
+++ b/www/admin/group-list-active.php
@@ -1,6 +1,9 @@
$page->settings]);
diff --git a/www/admin/group-list-inactive.php b/www/admin/group-list-inactive.php
index 3b49e88af..ba9633a39 100644
--- a/www/admin/group-list-inactive.php
+++ b/www/admin/group-list-inactive.php
@@ -1,6 +1,9 @@
$page->settings]);
diff --git a/www/admin/group-list.php b/www/admin/group-list.php
index c0a27c431..7e51853b6 100644
--- a/www/admin/group-list.php
+++ b/www/admin/group-list.php
@@ -2,6 +2,9 @@
require_once './config.php';
+use newznab\controllers\AdminPage;
+use newznab\controllers\Groups;
+
$page = new AdminPage();
$groups = new Groups(['Settings' => $page->settings]);
diff --git a/www/admin/index.php b/www/admin/index.php
index 2317accb8..cc1f0e094 100644
--- a/www/admin/index.php
+++ b/www/admin/index.php
@@ -3,6 +3,7 @@
require_once './config.php';
use newznab\db\Settings;
+use newznab\controllers\AdminPage;
$page = new AdminPage();
diff --git a/www/admin/menu-delete.php b/www/admin/menu-delete.php
index f5a8211f6..0bc6a2fc2 100644
--- a/www/admin/menu-delete.php
+++ b/www/admin/menu-delete.php
@@ -1,6 +1,9 @@
title = "Menu Add";
$menu = new Menu();
diff --git a/www/admin/menu-list.php b/www/admin/menu-list.php
index ac0007d54..7302ecca1 100644
--- a/www/admin/menu-list.php
+++ b/www/admin/menu-list.php
@@ -2,6 +2,9 @@
require_once './config.php';
+use newznab\controllers\AdminPage;
+use newznab\controllers\Menu;
+
$page = new AdminPage();
$menu = new Menu();
diff --git a/www/admin/movie-add.php b/www/admin/movie-add.php
index 0e54a7f37..d805558dc 100644
--- a/www/admin/movie-add.php
+++ b/www/admin/movie-add.php
@@ -2,6 +2,9 @@
require_once './config.php';
+use newznab\controllers\AdminPage;
+use newznab\controllers\Movie;
+
$page = new AdminPage();
$movie = new Movie(['Settings' => $page->settings]);
$id = 0;
diff --git a/www/admin/movie-edit.php b/www/admin/movie-edit.php
index 97f2af5b1..cfcf8004f 100644
--- a/www/admin/movie-edit.php
+++ b/www/admin/movie-edit.php
@@ -2,6 +2,9 @@
require_once './config.php';
+use newznab\controllers\AdminPage;
+use newznab\controllers\Movie;
+
$page = new AdminPage();
$movie = new Movie();
$id = 0;
diff --git a/www/admin/movie-list.php b/www/admin/movie-list.php
index e1d33b2d9..927620da4 100644
--- a/www/admin/movie-list.php
+++ b/www/admin/movie-list.php
@@ -2,6 +2,9 @@
require_once './config.php';
+use newznab\controllers\AdminPage;
+use newznab\controllers\Movie;
+
$page = new AdminPage();
$movie = new Movie(['Settings' => $page->settings]);
diff --git a/www/admin/music-edit.php b/www/admin/music-edit.php
index 2adab58e1..a21716111 100644
--- a/www/admin/music-edit.php
+++ b/www/admin/music-edit.php
@@ -2,6 +2,10 @@
require_once './config.php';
+use newznab\controllers\AdminPage;
+use newznab\controllers\Music;
+use newznab\controllers\Genres;
+
$page = new AdminPage();
$music = new Music();
$gen = new Genres();
diff --git a/www/admin/music-list.php b/www/admin/music-list.php
index 5380ef43b..6272816a3 100644
--- a/www/admin/music-list.php
+++ b/www/admin/music-list.php
@@ -2,6 +2,9 @@
require_once './config.php';
+use newznab\controllers\AdminPage;
+use newznab\controllers\Music;
+
$page = new AdminPage();
$m = new Music();
diff --git a/www/admin/nzb-export.php b/www/admin/nzb-export.php
index d3fcb1a07..fbbc3507a 100644
--- a/www/admin/nzb-export.php
+++ b/www/admin/nzb-export.php
@@ -1,6 +1,10 @@
serverurl;
/* #newznab-tmux */
diff --git a/www/admin/preview-list.php b/www/admin/preview-list.php
index e2fab6650..e9682e6fa 100644
--- a/www/admin/preview-list.php
+++ b/www/admin/preview-list.php
@@ -2,6 +2,10 @@
require_once './config.php';
+use newznab\controllers\AdminPage;
+use newznab\controllers\Releases;
+use newznab\controllers\Category;
+
$page = new AdminPage();
$releases = new Releases();
$category = new Category();
diff --git a/www/admin/rage-delete.php b/www/admin/rage-delete.php
index cb941357c..0af934817 100644
--- a/www/admin/rage-delete.php
+++ b/www/admin/rage-delete.php
@@ -1,6 +1,9 @@
$page->settings]);
diff --git a/www/admin/rage-list.php b/www/admin/rage-list.php
index f64ca3d2c..967c467a3 100644
--- a/www/admin/rage-list.php
+++ b/www/admin/rage-list.php
@@ -2,6 +2,9 @@
require_once './config.php';
+use newznab\controllers\AdminPage;
+use newznab\controllers\TvRage;
+
$page = new AdminPage();
$tvrage = new TvRage();
diff --git a/www/admin/rage-remove.php b/www/admin/rage-remove.php
index 06e4d1903..7d7fe7922 100644
--- a/www/admin/rage-remove.php
+++ b/www/admin/rage-remove.php
@@ -2,6 +2,9 @@
require_once './config.php';
+use newznab\controllers\AdminPage;
+use newznab\controllers\Releases;
+
$page = new AdminPage();
$releases = new Releases();
diff --git a/www/admin/regex-edit.php b/www/admin/regex-edit.php
index 084377c4a..6b1c5fc82 100644
--- a/www/admin/regex-edit.php
+++ b/www/admin/regex-edit.php
@@ -2,6 +2,10 @@
require_once './config.php';
+use newznab\controllers\AdminPage;
+use newznab\controllers\Category;
+use newznab\controllers\ReleaseRegex;
+
$page = new AdminPage();
$category = new Category();
$reg = new ReleaseRegex();
diff --git a/www/admin/regex-list.php b/www/admin/regex-list.php
index 60f5a9cf9..eac265cc9 100644
--- a/www/admin/regex-list.php
+++ b/www/admin/regex-list.php
@@ -2,6 +2,9 @@
require_once './config.php';
+use newznab\controllers\AdminPage;
+use newznab\controllers\ReleaseRegex;
+
$page = new AdminPage();
$reg = new ReleaseRegex();
diff --git a/www/admin/regex-submit.php b/www/admin/regex-submit.php
index d0e887b9e..8bb66e121 100644
--- a/www/admin/regex-submit.php
+++ b/www/admin/regex-submit.php
@@ -2,6 +2,9 @@
require_once './config.php';
+use newznab\controllers\AdminPage;
+use newznab\controllers\ReleaseRegex;
+
$page = new AdminPage();
$page->title = "Submit your regex expressions to newznab";
@@ -12,7 +15,7 @@ if (count($regexList))
{
$regexSerialize = serialize($regexList);
$regexFilename = 'releaseregex-' . time() . '.regex';
-
+
// User wants to submit their regex's
if (isset($_POST['regex_submit_please']))
{
@@ -27,11 +30,11 @@ if (count($regexList))
$post = array(
"regex" => $regexSerialize
);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
$response = curl_exec($ch);
-
+
curl_close($ch);
-
+
if ($response == 'OK')
{
$page->smarty->assign('upload_status', 'OK');
diff --git a/www/admin/regex-test.php b/www/admin/regex-test.php
index b7dc126bb..0a1cd8e95 100644
--- a/www/admin/regex-test.php
+++ b/www/admin/regex-test.php
@@ -2,6 +2,11 @@
require_once './config.php';
+use newznab\controllers\AdminPage;
+use newznab\controllers\ReleaseRegex;
+use newznab\controllers\Groups;
+use newznab\controllers\Category;
+
$page = new AdminPage();
$reg = new ReleaseRegex();
diff --git a/www/admin/release-delete.php b/www/admin/release-delete.php
index 51381e3aa..d462011fb 100644
--- a/www/admin/release-delete.php
+++ b/www/admin/release-delete.php
@@ -1,6 +1,9 @@
$page->settings]);
$category = new Category(['Settings' => $page->settings]);
diff --git a/www/admin/release-files.php b/www/admin/release-files.php
index e5e136ee5..1e8fc1288 100644
--- a/www/admin/release-files.php
+++ b/www/admin/release-files.php
@@ -2,6 +2,11 @@
require_once './config.php';
+use newznab\controllers\AdminPage;
+use newznab\controllers\Releases;
+use newznab\controllers\Users;
+use newznab\controllers\NZB;
+
$page = new AdminPage;
$users = new Users;
$releases = new Releases;
diff --git a/www/admin/release-list.php b/www/admin/release-list.php
index 279ca794d..f96556e14 100644
--- a/www/admin/release-list.php
+++ b/www/admin/release-list.php
@@ -2,6 +2,9 @@
require_once './config.php';
+use newznab\controllers\AdminPage;
+use newznab\controllers\Releases;
+
$page = new AdminPage();
$releases = new Releases();
diff --git a/www/admin/release_naming_regexes-edit.php b/www/admin/release_naming_regexes-edit.php
index a61dc8fde..117511550 100644
--- a/www/admin/release_naming_regexes-edit.php
+++ b/www/admin/release_naming_regexes-edit.php
@@ -1,6 +1,10 @@
$page->settings, 'Table_Name' => 'release_naming_regexes']);
diff --git a/www/admin/release_naming_regexes-list.php b/www/admin/release_naming_regexes-list.php
index be1dda3ed..7b19e99df 100644
--- a/www/admin/release_naming_regexes-list.php
+++ b/www/admin/release_naming_regexes-list.php
@@ -1,6 +1,9 @@
$page->settings, 'Table_Name' => 'release_naming_regexes']);
diff --git a/www/admin/release_naming_regexes-test.php b/www/admin/release_naming_regexes-test.php
index fc0325bdc..8ffcf0e16 100644
--- a/www/admin/release_naming_regexes-test.php
+++ b/www/admin/release_naming_regexes-test.php
@@ -1,6 +1,9 @@
title = "Release Naming Regex Test";
diff --git a/www/admin/role-delete.php b/www/admin/role-delete.php
index 1421df714..1de8059c9 100644
--- a/www/admin/role-delete.php
+++ b/www/admin/role-delete.php
@@ -1,6 +1,9 @@
title = 'Sharing Settings';
diff --git a/www/admin/site-debug.php b/www/admin/site-debug.php
index 4f6a2b278..fa6e55902 100644
--- a/www/admin/site-debug.php
+++ b/www/admin/site-debug.php
@@ -2,6 +2,9 @@
require_once './config.php';
+use newznab\controllers\AdminPage;
+use newznab\db\Settings;
+
$page = new AdminPage();
$s = $page->settings;
@@ -18,7 +21,7 @@ unset($s->sabapikey);
unset($s->sabcompletedir);
unset($s->sabvdir);
-$db = new newznab\db\Settings;
+$db = new Settings();
$totalsize = 0;
$alltables = $db->query("show table status");
foreach ($alltables as $tablename)
diff --git a/www/admin/site-edit.php b/www/admin/site-edit.php
index 1f1eb6cb1..ba27bca99 100644
--- a/www/admin/site-edit.php
+++ b/www/admin/site-edit.php
@@ -2,6 +2,10 @@
require_once './config.php';
+use newznab\controllers\AdminPage;
+use newznab\controllers\Sites;
+use newznab\controllers\SABnzbd;
+
use newznab\db\Settings;
$page = new AdminPage();
diff --git a/www/admin/site-stats.php b/www/admin/site-stats.php
index 66a460b7f..fa1a269ae 100644
--- a/www/admin/site-stats.php
+++ b/www/admin/site-stats.php
@@ -2,6 +2,10 @@
require_once './config.php';
+use newznab\controllers\AdminPage;
+use newznab\controllers\Users;
+use newznab\controllers\Releases;
+
$page = new AdminPage();
$users = new Users();
$releases = new Releases();
diff --git a/www/admin/spotnab-delete.php b/www/admin/spotnab-delete.php
index 5de200de9..ee10dfaea 100644
--- a/www/admin/spotnab-delete.php
+++ b/www/admin/spotnab-delete.php
@@ -1,6 +1,9 @@
title = 'View Logs';
diff --git a/www/autoloader.php b/www/autoloader.php
index 7d35a1d9d..b2ae842c4 100644
--- a/www/autoloader.php
+++ b/www/autoloader.php
@@ -21,4 +21,4 @@ spl_autoload_register(
}
);
-?>
+?>
\ No newline at end of file
diff --git a/www/automated.config.php b/www/automated.config.php
deleted file mode 100644
index 56cef3fd4..000000000
--- a/www/automated.config.php
+++ /dev/null
@@ -1,132 +0,0 @@
-users->isLoggedIn()) {
$page->show403();
}
diff --git a/www/pages/ajax_mymovies.php b/www/pages/ajax_mymovies.php
index 5ef585050..03d84715c 100644
--- a/www/pages/ajax_mymovies.php
+++ b/www/pages/ajax_mymovies.php
@@ -1,5 +1,7 @@
users->isLoggedIn()) {
diff --git a/www/pages/ajax_prehashinfo.php b/www/pages/ajax_prehashinfo.php
index fe6f1657d..60a62f06b 100644
--- a/www/pages/ajax_prehashinfo.php
+++ b/www/pages/ajax_prehashinfo.php
@@ -1,4 +1,6 @@
users->isLoggedIn()) {
$page->show403();
}
diff --git a/www/pages/ajax_preinfo.php b/www/pages/ajax_preinfo.php
index 1e5f0db2e..6680d216b 100644
--- a/www/pages/ajax_preinfo.php
+++ b/www/pages/ajax_preinfo.php
@@ -1,5 +1,7 @@
users->isLoggedIn() || $page->userdata["canpre"] != 1)
$page->show403();
diff --git a/www/pages/ajax_rarfilelist.php b/www/pages/ajax_rarfilelist.php
index 282e2ee22..6b10ecdbf 100644
--- a/www/pages/ajax_rarfilelist.php
+++ b/www/pages/ajax_rarfilelist.php
@@ -1,4 +1,5 @@
users->isLoggedIn())
$page->show403();
diff --git a/www/pages/ajax_release-admin.php b/www/pages/ajax_release-admin.php
index a82bdc317..7267d75cb 100644
--- a/www/pages/ajax_release-admin.php
+++ b/www/pages/ajax_release-admin.php
@@ -1,4 +1,7 @@
users->isLoggedIn())
$page->show403();
diff --git a/www/pages/anime.php b/www/pages/anime.php
index b058b2cf4..dc8418e3b 100644
--- a/www/pages/anime.php
+++ b/www/pages/anime.php
@@ -1,5 +1,9 @@
users->isLoggedIn())
$page->show403();
diff --git a/www/pages/api.php b/www/pages/api.php
index 061ab7ca0..893e93d1e 100644
--- a/www/pages/api.php
+++ b/www/pages/api.php
@@ -1,6 +1,8 @@
users->isLoggedIn())
diff --git a/www/pages/books.php b/www/pages/books.php
index 2841003a5..31fb37cfc 100644
--- a/www/pages/books.php
+++ b/www/pages/books.php
@@ -4,6 +4,10 @@ if (!$page->users->isLoggedIn()) {
$page->show403();
}
+use newznab\controllers\Books;
+use newznab\controllers\Category;
+use newznab\controllers\DnzbFailures;
+
$book = new Books(['Settings' => $page->settings]);
$cat = new Category(['Settings' => $page->settings]);
$fail = new DnzbFailures(['Settings' => $page->settings]);
diff --git a/www/pages/browse.php b/www/pages/browse.php
index c427b3197..6af17a155 100644
--- a/www/pages/browse.php
+++ b/www/pages/browse.php
@@ -1,5 +1,8 @@
$page->settings]);
if (!$page->users->isLoggedIn())
diff --git a/www/pages/browsegroup.php b/www/pages/browsegroup.php
index 268781ec1..5be072cd4 100644
--- a/www/pages/browsegroup.php
+++ b/www/pages/browsegroup.php
@@ -3,6 +3,8 @@ if (!$page->users->isLoggedIn()) {
$page->show403();
}
+use newznab\controllers\Groups;
+
$groups = new Groups(['Settings' => $page->settings]);
$grouplist = $groups->getAll();
diff --git a/www/pages/calendar.php b/www/pages/calendar.php
index a8da23431..cb4c1a968 100644
--- a/www/pages/calendar.php
+++ b/www/pages/calendar.php
@@ -4,6 +4,8 @@ if (!$page->users->isLoggedIn()) {
$page->show403();
}
+use newznab\controllers\TvRage;
+
$tvrage = new TvRage(['Settings' => $page->settings]);
$date = date("Y-m-d");
diff --git a/www/pages/cart.php b/www/pages/cart.php
index 7863fa7bf..b18e3c4e6 100644
--- a/www/pages/cart.php
+++ b/www/pages/cart.php
@@ -4,6 +4,8 @@ if (!$page->users->isLoggedIn()) {
$page->show403();
}
+use newznab\controllers\Releases;
+
if (isset($_GET["add"])) {
$releases = new Releases(['Settings' => $page->settings]);
$guids = explode(',', $_GET['add']);
diff --git a/www/pages/console.php b/www/pages/console.php
index bddf95f6a..97430e0d2 100644
--- a/www/pages/console.php
+++ b/www/pages/console.php
@@ -4,6 +4,11 @@ if (!$page->users->isLoggedIn()) {
$page->show403();
}
+use newznab\controllers\Console;
+use newznab\controllers\Category;
+use newznab\controllers\Genres;
+use newznab\controllers\DnzbFailures;
+
$console = new Console(['Settings' => $page->settings]);
$cat = new Category(['Settings' => $page->settings]);
$gen = new Genres(['Settings' => $page->settings]);
diff --git a/www/pages/consolemodal.php b/www/pages/consolemodal.php
index c29aa6dc1..f89cae0fc 100644
--- a/www/pages/consolemodal.php
+++ b/www/pages/consolemodal.php
@@ -3,6 +3,8 @@
if (!$page->users->isLoggedIn())
$page->show403();
+use newznab\controllers\Console;
+
if (isset($_GET["id"]) && ctype_digit($_GET["id"]))
{
$console = new Console(['Settings' => $page->settings]);
diff --git a/www/pages/contact-us.php b/www/pages/contact-us.php
index 261c5ffc8..118c7edbc 100644
--- a/www/pages/contact-us.php
+++ b/www/pages/contact-us.php
@@ -1,6 +1,7 @@
$page->settings]);
$role = 0;
diff --git a/www/pages/details.php b/www/pages/details.php
index 397cb7e85..d48fd88ed 100644
--- a/www/pages/details.php
+++ b/www/pages/details.php
@@ -1,5 +1,22 @@
users->isLoggedIn())
$page->show403();
diff --git a/www/pages/dlbrowse.php b/www/pages/dlbrowse.php
index e3312b4b1..ccbe69d09 100644
--- a/www/pages/dlbrowse.php
+++ b/www/pages/dlbrowse.php
@@ -2,6 +2,7 @@
use newznab\db\Settings;
use newznab\utility\Utility;
+use newznab\controllers\Releases;
if (!$page->users->isLoggedIn())
$page->show403();
diff --git a/www/pages/failed.php b/www/pages/failed.php
index 85f1b8116..dd6ec6287 100644
--- a/www/pages/failed.php
+++ b/www/pages/failed.php
@@ -1,4 +1,5 @@
users->isLoggedIn()) {
header('Location: ' . WWW_TOP . '/');
diff --git a/www/pages/forum.php b/www/pages/forum.php
index 7c15b5f18..f3b20546a 100644
--- a/www/pages/forum.php
+++ b/www/pages/forum.php
@@ -1,4 +1,5 @@
users->isLoggedIn())
$page->show403();
diff --git a/www/pages/games.php b/www/pages/games.php
index 12e38cdb3..c6e7e102a 100644
--- a/www/pages/games.php
+++ b/www/pages/games.php
@@ -1,5 +1,10 @@
users->isLoggedIn()) {
$page->show403();
}
diff --git a/www/pages/getnzb.php b/www/pages/getnzb.php
index fdff57e69..26240ea67 100644
--- a/www/pages/getnzb.php
+++ b/www/pages/getnzb.php
@@ -1,6 +1,8 @@
settings);
$rel = new Releases(['Settings' => $page->settings]);
diff --git a/www/pages/login.php b/www/pages/login.php
index bbda2557a..11a5e9b3a 100644
--- a/www/pages/login.php
+++ b/www/pages/login.php
@@ -1,5 +1,8 @@
smarty->assign(['error' => '', 'username' => '', 'rememberme' => '']);
$captcha = new Captcha($page);
diff --git a/www/pages/movie.php b/www/pages/movie.php
index 2f578f6c2..841af16dd 100644
--- a/www/pages/movie.php
+++ b/www/pages/movie.php
@@ -1,5 +1,7 @@
users->isLoggedIn()) {
$page->show403();
}
diff --git a/www/pages/movies.php b/www/pages/movies.php
index f30e62b1e..123128297 100644
--- a/www/pages/movies.php
+++ b/www/pages/movies.php
@@ -1,5 +1,9 @@
$page->settings]);
$cat = new Category(['Settings' => $page->settings]);
$fail = new DnzbFailures(['Settings' => $page->settings]);
diff --git a/www/pages/movietrailer.php b/www/pages/movietrailer.php
index 837673256..26a7b5ab5 100644
--- a/www/pages/movietrailer.php
+++ b/www/pages/movietrailer.php
@@ -1,5 +1,7 @@
users->isLoggedIn())
diff --git a/www/pages/music.php b/www/pages/music.php
index e1f1ebd45..ae3358a18 100644
--- a/www/pages/music.php
+++ b/www/pages/music.php
@@ -1,5 +1,10 @@
users->isLoggedIn()) {
$page->show403();
}
diff --git a/www/pages/musicmodal.php b/www/pages/musicmodal.php
index b4bb7098a..1467a3057 100644
--- a/www/pages/musicmodal.php
+++ b/www/pages/musicmodal.php
@@ -1,5 +1,7 @@
users->isLoggedIn())
diff --git a/www/pages/mymoviesedit.php b/www/pages/mymoviesedit.php
index 4a386d2ed..b70273232 100644
--- a/www/pages/mymoviesedit.php
+++ b/www/pages/mymoviesedit.php
@@ -1,5 +1,7 @@
users->isLoggedIn()) {
$page->show403();
diff --git a/www/pages/myshows.php b/www/pages/myshows.php
index 61d99fd8c..f4dab2fba 100644
--- a/www/pages/myshows.php
+++ b/www/pages/myshows.php
@@ -1,6 +1,8 @@
users->isLoggedIn())
$page->show403();
diff --git a/www/pages/newposterwall.php b/www/pages/newposterwall.php
index 4516b562e..681a77f03 100644
--- a/www/pages/newposterwall.php
+++ b/www/pages/newposterwall.php
@@ -4,6 +4,10 @@ if (!$page->users->isLoggedIn()) {
$page->show403();
}
+use newznab\controllers\Releases;
+use newznab\controllers\Contents;
+use newznab\controllers\Category;
+
$releases = new Releases(['Settings' => $page->settings]);
$contents = new Contents(['Settings' => $page->settings]);
$category = new Category(['Settings' => $page->settings]);
diff --git a/www/pages/nfo.php b/www/pages/nfo.php
index 9a8d03ada..ee0396a8e 100644
--- a/www/pages/nfo.php
+++ b/www/pages/nfo.php
@@ -1,6 +1,7 @@
users->isLoggedIn()) {
$page->show403();
diff --git a/www/pages/nzbvortex.php b/www/pages/nzbvortex.php
index 9333f4751..e20b54bbe 100644
--- a/www/pages/nzbvortex.php
+++ b/www/pages/nzbvortex.php
@@ -2,6 +2,7 @@
if (!$page->users->isLoggedIn())
$page->show403();
+use newznab\controllers\NZBVortex;
try
{
diff --git a/www/pages/predb.php b/www/pages/predb.php
index da784bc2c..ff8baae12 100644
--- a/www/pages/predb.php
+++ b/www/pages/predb.php
@@ -1,5 +1,7 @@
users->isLoggedIn() || $page->userdata["canpre"] != 1)
diff --git a/www/pages/prehash.php b/www/pages/prehash.php
index b6b686f31..dc3094e4d 100644
--- a/www/pages/prehash.php
+++ b/www/pages/prehash.php
@@ -1,5 +1,7 @@
users->isLoggedIn()) {
$page->show403();
}
diff --git a/www/pages/profile.php b/www/pages/profile.php
index e45daed3b..b0cdb975a 100644
--- a/www/pages/profile.php
+++ b/www/pages/profile.php
@@ -1,5 +1,9 @@
users->isLoggedIn())
$page->show403();
diff --git a/www/pages/profileedit.php b/www/pages/profileedit.php
index c6095268f..9f3a2e0d2 100644
--- a/www/pages/profileedit.php
+++ b/www/pages/profileedit.php
@@ -1,6 +1,10 @@
users->isLoggedIn()) {
$page->show403();
}
diff --git a/www/pages/queuedata.php b/www/pages/queuedata.php
index 38874a173..e4e43d889 100644
--- a/www/pages/queuedata.php
+++ b/www/pages/queuedata.php
@@ -1,5 +1,8 @@
users->isLoggedIn())
$page->show403();
diff --git a/www/pages/register.php b/www/pages/register.php
index 4cf578fac..463de22b7 100644
--- a/www/pages/register.php
+++ b/www/pages/register.php
@@ -1,6 +1,8 @@
users->isLoggedIn()) {
diff --git a/www/pages/rss.php b/www/pages/rss.php
index 8d49b4ca7..bace53abf 100644
--- a/www/pages/rss.php
+++ b/www/pages/rss.php
@@ -1,6 +1,8 @@
$page->settings]);
$releases = new Releases(['Settings' => $page->settings]);
diff --git a/www/pages/sabqueuedata.php b/www/pages/sabqueuedata.php
index 8b414d00c..da5c2ef6e 100644
--- a/www/pages/sabqueuedata.php
+++ b/www/pages/sabqueuedata.php
@@ -1,5 +1,7 @@
users->isLoggedIn()) {
$page->show403();
}
diff --git a/www/pages/search.php b/www/pages/search.php
index e6323ce65..09acea116 100644
--- a/www/pages/search.php
+++ b/www/pages/search.php
@@ -1,5 +1,8 @@
users->isLoggedIn()) {
$page->show403();
}
diff --git a/www/pages/sendtonzbget.php b/www/pages/sendtonzbget.php
index c38460ff6..1582ae4d1 100644
--- a/www/pages/sendtonzbget.php
+++ b/www/pages/sendtonzbget.php
@@ -1,5 +1,6 @@
users->isLoggedIn())
$page->show403();
diff --git a/www/pages/sendtoqueue.php b/www/pages/sendtoqueue.php
index 9bc4038dc..fddab1fb8 100644
--- a/www/pages/sendtoqueue.php
+++ b/www/pages/sendtoqueue.php
@@ -1,4 +1,6 @@
users->isLoggedIn()) {
$page->show403();
diff --git a/www/pages/sendtosab.php b/www/pages/sendtosab.php
index 2d85d0432..05ab7163c 100644
--- a/www/pages/sendtosab.php
+++ b/www/pages/sendtosab.php
@@ -1,5 +1,7 @@
users->isLoggedIn())
$page->show403();
diff --git a/www/pages/series.php b/www/pages/series.php
index b80e6d9ab..e54a3b21d 100644
--- a/www/pages/series.php
+++ b/www/pages/series.php
@@ -1,5 +1,10 @@
users->isLoggedIn()) {
$page->show403();
}
diff --git a/www/pages/sitemap.php b/www/pages/sitemap.php
index bf920942f..b20a0b0c3 100644
--- a/www/pages/sitemap.php
+++ b/www/pages/sitemap.php
@@ -1,5 +1,8 @@
smarty;
$arPages = array();
diff --git a/www/pages/upcoming.php b/www/pages/upcoming.php
index c0a54e552..e4fb0fc9b 100644
--- a/www/pages/upcoming.php
+++ b/www/pages/upcoming.php
@@ -1,5 +1,7 @@
users->isLoggedIn()) {
$page->show403();
}
diff --git a/www/pages/xxx.php b/www/pages/xxx.php
index b8e3c9275..21334cef5 100644
--- a/www/pages/xxx.php
+++ b/www/pages/xxx.php
@@ -1,5 +1,9 @@
users->isLoggedIn()) {
$page->show403();
}
diff --git a/www/pages/xxxmodal.php b/www/pages/xxxmodal.php
index c18360cea..1f20eedb4 100644
--- a/www/pages/xxxmodal.php
+++ b/www/pages/xxxmodal.php
@@ -1,5 +1,7 @@
users->isLoggedIn()) {
$page->show403();
}
diff --git a/www/smarty.php b/www/smarty.php
new file mode 100644
index 000000000..2d8a0ef86
--- /dev/null
+++ b/www/smarty.php
@@ -0,0 +1,59 @@
+.
+ * @author niel
+ * @copyright 2015 NN
+ */
+require_once realpath(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'constants.php');
+require_once realpath(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'autoloader.php');
+require_once 'autoloader.php';
+
+use newznab\config\Configure;
+
+try {
+ $config = new Configure('smarty');
+} catch (\RuntimeException $e) {
+ if ($e->getCode() == 1) {
+ if (file_exists(NN_WWW . 'config.php')) {
+ echo "Move: .../www/config.php to .../nzedb/config/config.php
\n Remove any line that says require_once 'automated.config.php';
\n";
+ if (file_exists(NN_WWW . 'settings.php')) {
+ echo "Move: .../www/settings.php to .../nzedb/config/settings.php
\n";
+ }
+ exit();
+ } else if (is_dir("install")) {
+ header("location: install");
+ exit();
+ }
+ }
+}
+
+if (function_exists('ini_set') && function_exists('ini_get')) {
+ ini_set('include_path', NN_WWW . PATH_SEPARATOR . ini_get('include_path'));
+}
+
+// Path to smarty files. (not prefixed with NN as the name is needed in smarty files).
+define('SMARTY_DIR', NN_LIBS . 'smarty' . DS);
+
+$www_top = str_replace("\\", "/", dirname($_SERVER['PHP_SELF']));
+if (strlen($www_top) == 1) {
+ $www_top = "";
+}
+
+// Used everywhere an href is output, includes the full path to the NN install.
+define('WWW_TOP', $www_top);
+
+?>