diff --git a/bin/.gitignore b/bin/.gitignore
deleted file mode 100644
index 847c290e9..000000000
--- a/bin/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-processAlternate*
-processAdditional*
-
diff --git a/bin/config.php b/bin/config.php
deleted file mode 100644
index 05d1da552..000000000
--- a/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 DB();
- $namefixer = new Namefixer(true);
- $pieces = explode(' ', $argv[1]);
- if (isset($pieces[1]) && $pieces[0] == 'nfo') {
- $release = $pieces[1];
- if ($res = $db->queryOneRow(sprintf('SELECT rel.guid AS guid, nfo.releaseid AS nfoid, rel.groupid, rel.categoryid, rel.name, rel.searchname, uncompress(nfo) AS textstring, rel.id AS releaseid FROM releases rel INNER JOIN releasenfo nfo ON (nfo.releaseid = rel.id) WHERE rel.id = %d', $release))) {
- //ignore encrypted nfos
- if (preg_match('/^=newz\[NZB\]=\w+/', $res['textstring'])) {
- $namefixer->done = $namefixer->matched = false;
- $db->queryDirect(sprintf('UPDATE releases SET proc_nfo = 1 WHERE id = %d', $res['releaseid']));
- $namefixer->checked++;
- echo '.';
- } else {
- //echo $res['textstring']."\n";
- $namefixer->done = $namefixer->matched = false;
- if ($namefixer->checkName($res, true, 'NFO, ', 1, 1) !== true) {
- echo '.';
- }
- $namefixer->checked++;
- }
- }
- } else if (isset($pieces[1]) && $pieces[0] == 'filename') {
- $release = $pieces[1];
- if ($res = $db->queryOneRow(sprintf('SELECT relfiles.name AS textstring, rel.categoryid, rel.searchname, '
- . 'rel.groupid, relfiles.releaseid AS fileid, rel.id AS releaseid, rel.name FROM releases rel '
- . 'INNER JOIN releasefiles relfiles ON (relfiles.releaseid = rel.id) WHERE rel.id = %d', $release))) {
- $namefixer->done = $namefixer->matched = false;
- if ($namefixer->checkName($res, true, 'Filenames, ', 1, 1) !== true) {
- echo '.';
- }
- $namefixer->checked++;
- }
- } else if (isset($pieces[1]) && $pieces[0] == 'md5') {
- $release = $pieces[1];
- if ($res = $db->queryOneRow(sprintf('SELECT r.id AS releaseid, r.name, r.searchname, r.categoryid, r.groupid, dehashstatus, rf.name AS filename FROM releases r LEFT JOIN releasefiles rf ON r.id = rf.releaseid WHERE r.id = %d', $release))) {
- if (preg_match('/[a-fA-F0-9]{32,40}/i', $res['name'], $matches)) {
- $namefixer->matchPredbHash($matches[0], $res, 1, 1, true, 1);
- } else if (preg_match('/[a-fA-F0-9]{32,40}/i', $res['filename'], $matches)) {
- $namefixer->matchPredbHash($matches[0], $res, 1, 1, true, 1);
- } else {
- $db->queryExec(sprintf("UPDATE releases SET dehashstatus = %d - 1 WHERE id = %d", $res['dehashstatus'], $res['releaseid']));
- echo '.';
- }
- }
- } else if (isset($pieces[1]) && $pieces[0] == 'par2') {
- $nntp = new NNTP();
- if ($nntp->doConnect() === false) {
- exit($c->error("Unable to connect to usenet."));
- }
-
- $relID = $pieces[1];
- $guid = $pieces[2];
- $groupID = $pieces[3];
- $nzbcontents = new NZBContents(array('echo' => true, 'nntp' => $nntp, 'nfo' => new Info(), 'db' => $db, 'pp' => new PProcess(true)));
- $res = $nzbcontents->checkPAR2($guid, $relID, $groupID, 1, 1);
- if ($res === false) {
- echo '.';
- }
-
- $nntp->doQuit();
-
- } else if (isset($pieces[1]) && $pieces[0] == 'predbft') {
- $pre = $pieces[1];
- if ($res = $db->queryOneRow(sprintf('SELECT id AS preid, title, source, searched FROM prehash '
- . 'WHERE id = %d', $pre
- )
- )
- ) {
- $namefixer->done = $namefixer->matched = false;
- $ftmatched = $searched = 0;
- $ftmatched = $namefixer->matchPredbFT($res, 1, 1, true, 1);
- if ($ftmatched > 0) {
- $searched = 1;
- } elseif ($ftmatched < 0) {
- $searched = -6;
- echo "*";
- } else {
- $searched = $res['searched'] - 1;
- echo ".";
- }
- $db->queryExec(sprintf("UPDATE prehash SET searched = %d WHERE id = %d", $searched, $res['preid']));
- $namefixer->checked++;
- }
-
- }
-}
diff --git a/bin/groupfixrelnames.php b/bin/groupfixrelnames.php
deleted file mode 100644
index 5f198cbcf..000000000
--- a/bin/groupfixrelnames.php
+++ /dev/null
@@ -1,214 +0,0 @@
-get();
-
-if (!isset($argv[1])) {
- exit($pdo->log->error("This script is not intended to be run manually, it is called from groupfixrelnames_threaded.py."));
-} else if (isset($argv[1])) {
- $namefixer = new \NameFixer(['Settings' => $pdo]);
- $pieces = explode(' ', $argv[1]);
- $guidChar = $pieces[1];
- $maxperrun = $pieces[2];
- $thread = $pieces[3];
-
- switch (true) {
- case $pieces[0] === 'nfo' && isset($guidChar) && isset($maxperrun) && is_numeric($maxperrun):
- $releases = $pdo->queryDirect(
- sprintf('
- SELECT r.id AS releaseid, r.guid, r.groupid, r.categoryid, r.name, r.searchname,
- uncompress(nfo) AS textstring
- FROM releases r
- INNER JOIN releasenfo rn ON r.id = rn.releaseid
- WHERE r.guid %s
- AND r.nzbstatus = 1
- AND r.proc_nfo = 0
- AND r.nfostatus = 1
- AND r.prehashid = 0
- ORDER BY r.postdate DESC
- LIMIT %s',
- $pdo->likeString($guidChar, false, true),
- $maxperrun
- )
- );
-
- if ($releases instanceof Traversable) {
- foreach ($releases as $release) {
- if (preg_match('/^=newz\[NZB\]=\w+/', $release['textstring'])) {
- $namefixer->done = $namefixer->matched = false;
- $pdo->queryDirect(sprintf('UPDATE releases SET proc_nfo = 1 WHERE id = %d', $release['releaseid']));
- $namefixer->checked++;
- echo '.';
- } else {
- $namefixer->done = $namefixer->matched = false;
- if ($namefixer->checkName($release, true, 'NFO, ', 1, 1) !== true) {
- echo '.';
- }
- $namefixer->checked++;
- }
- }
- }
- break;
- case $pieces[0] === 'filename' && isset($guidChar) && isset($maxperrun) && is_numeric($maxperrun):
- $releases = $pdo->queryDirect(
- sprintf('
- SELECT rf.name AS textstring, rf.releaseid AS fileid,
- r.id AS releaseid, r.name, r.searchname, r.categoryid, r.groupid
- FROM releases r
- INNER JOIN releasefiles rf ON r.id = rf.releaseid
- WHERE r.guid %s
- AND r.nzbstatus = 1 AND r.proc_files = 0
- AND r.prehashid = 0
- ORDER BY r.postdate ASC
- LIMIT %s',
- $pdo->likeString($guidChar, false, true),
- $maxperrun
- )
- );
-
- if ($releases instanceof Traversable) {
- foreach ($releases as $release) {
- $namefixer->done = $namefixer->matched = false;
- if ($namefixer->checkName($release, true, 'Filenames, ', 1, 1) !== true) {
- echo '.';
- }
- $namefixer->checked++;
- }
- }
- break;
- case $pieces[0] === 'md5' && isset($guidChar) && isset($maxperrun) && is_numeric($maxperrun):
- $releases = $pdo->queryDirect(
- sprintf('
- SELECT DISTINCT r.id AS releaseid, r.name, r.searchname, r.categoryid, r.groupid, r.dehashstatus,
- rf.name AS filename
- FROM releases r
- LEFT OUTER JOIN releasefiles rf ON r.id = rf.releaseid AND rf.ishashed = 1
- WHERE r.guid %s
- AND nzbstatus = 1 AND r.ishashed = 1
- AND r.dehashstatus BETWEEN -6 AND 0
- AND r.prehashid = 0
- ORDER BY r.dehashstatus DESC, r.postdate ASC
- LIMIT %s',
- $pdo->likeString($guidChar, false, true),
- $maxperrun
- )
- );
-
- if ($releases instanceof Traversable) {
- foreach ($releases as $release) {
- if (preg_match('/[a-fA-F0-9]{32,40}/i', $release['name'], $matches)) {
- $namefixer->matchPredbHash($matches[0], $release, 1, 1, true, 1);
- } else if (preg_match('/[a-fA-F0-9]{32,40}/i', $release['filename'], $matches)) {
- $namefixer->matchPredbHash($matches[0], $release, 1, 1, true, 1);
- } else {
- $pdo->queryExec(sprintf("UPDATE releases SET dehashstatus = %d - 1 WHERE id = %d", $release['dehashstatus'], $release['releaseid']));
- echo '.';
- }
- }
- }
- break;
- case $pieces[0] === 'par2' && isset($guidChar) && isset($maxperrun) && is_numeric($maxperrun):
- $releases = $pdo->queryDirect(
- sprintf('
- SELECT r.id AS releaseid, r.guid, r.groupid
- FROM releases r
- WHERE r.guid %s
- AND r.nzbstatus = 1
- AND r.proc_par2 = 0
- AND r.prehashid = 0
- ORDER BY r.postdate ASC
- LIMIT %s',
- $pdo->likeString($guidChar, false, true),
- $maxperrun
- )
- );
-
- if ($releases instanceof Traversable) {
- $nntp = new NNTP(['Settings' => $pdo]);
- if (($site->alternate_nntp == '1' ? $nntp->doConnect(true, true) : $nntp->doConnect()) !== true) {
- exit($pdo->log->error("Unable to connect to usenet."));
- }
-
- $Nfo = new Info(['Settings' => $pdo, 'Echo' => true]);
- $nzbcontents = new NZBContents(
- array(
- 'Echo' => true, 'NNTP' => $nntp, 'Nfo' => $Nfo, 'Settings' => $pdo,
- 'PostProcess' => new PProcess(['Settings' => $pdo, 'Nfo' => $Nfo, 'NameFixer' => $namefixer])
- )
- );
- foreach ($releases as $release) {
- $res = $nzbcontents->checkPAR2($release['guid'], $release['releaseid'], $release['groupid'], 1, 1);
- if ($res === false) {
- echo '.';
- }
- }
- }
- break;
- case $pieces[0] === 'miscsorter' && isset($guidChar) && isset($maxperrun) && is_numeric($maxperrun):
- $releases = $pdo->queryDirect(
- sprintf('
- SELECT r.id AS releaseid
- FROM releases r
- WHERE r.guid %s
- AND r.nzbstatus = 1 AND r.nfostatus = 1
- AND r.proc_sorter = 0 AND r.isrenamed = 0
- AND r.prehashid = 0
- ORDER BY r.postdate DESC
- LIMIT %s',
- $pdo->likeString($guidChar, false, true),
- $maxperrun
- )
- );
-
- if ($releases instanceof Traversable) {
- $sorter = new MiscSorter(true, $pdo);
- foreach ($releases as $release) {
- $res = $sorter->nfosorter(null, $release['releaseid']);
- }
- }
- break;
- case $pieces[0] === 'predbft' && isset($maxperrun) && is_numeric($maxperrun) && isset($thread) && is_numeric($thread):
- $pres = $pdo->queryDirect(
- sprintf('
- SELECT p.id AS prehashid, p.title, p.source, p.searched
- FROM prehash p
- WHERE LENGTH(title) >= 15 AND title NOT REGEXP "[\"\<\> ]"
- AND searched = 0
- AND DATEDIFF(NOW(), predate) > 1
- ORDER BY predate ASC
- LIMIT %s
- OFFSET %s',
- $maxperrun,
- $thread * $maxperrun - $maxperrun
- )
- );
-
- if ($pres instanceof Traversable) {
- foreach ($pres as $pre) {
- $namefixer->done = $namefixer->matched = false;
- $ftmatched = $searched = 0;
- $ftmatched = $namefixer->matchPredbFT($pre, 1, 1, true, 1);
- if ($ftmatched > 0) {
- $searched = 1;
- } elseif ($ftmatched < 0) {
- $searched = -6;
- echo "*";
- } else {
- $searched = $pre['searched'] - 1;
- echo ".";
- }
- $pdo->queryExec(sprintf("UPDATE prehash SET searched = %d WHERE id = %d", $searched, $pre['prehashid']));
- $namefixer->checked++;
- }
- }
- }
-}
\ No newline at end of file
diff --git a/bin/monitor.php b/bin/monitor.php
deleted file mode 100644
index 16eec9669..000000000
--- a/bin/monitor.php
+++ /dev/null
@@ -1,364 +0,0 @@
-get('niceness');
-
-$tmux_niceness = (isset($tmux->niceness) ? $tmux->niceness : 2);
-
-$runVar['constants'] = $pdo->queryOneRow($tRun->getConstantSettings());
-
-$PHP = ($tRun->command_exist("php5") ? 'php5' : 'php');
-$PYTHON = ($tRun->command_exist("python3") ? 'python3 -OOu' : 'python -OOu');
-
-//assign shell commands
-$show_time = (NN_DEBUG ? "/usr/bin/time" : "");
-$runVar['commands']['_php'] = $show_time . " nice -n{$tmux_niceness} $PHP";
-$runVar['commands']['_phpn'] = "nice -n{$tmux_niceness} $PHP";
-$runVar['commands']['_python'] = $show_time . " nice -n{$tmux_niceness} $PYTHON";
-$runVar['commands']['_sleep'] = "{$runVar['commands']['_phpn']} {$runVar['paths']['lib']}showsleep.php";
-
-//spawn IRCScraper as soon as possible
-$tRun->runPane('scraper', $runVar);
-
-//get list of panes by name
-$runVar['panes'] = $tRun->getListOfPanes($runVar['constants']);
-
-//totals per category in db, results by parentid
-$catcntqry = "SELECT c.parentid AS parentid, COUNT(r.id) AS count FROM category c, releases r WHERE r.categoryid = c.id GROUP BY c.parentid";
-
-//create timers and set to now
-$runVar['timers']['timer1'] = $runVar['timers']['timer2'] = $runVar['timers']['timer3'] =
-$runVar['timers']['timer4'] = $runVar['timers']['timer5'] = time();
-
-$runVar['timers']['query']['tmux_time'] = $runVar['timers']['query']['split_time'] = $runVar['timers']['query']['init_time'] = $runVar['timers']['query']['proc1_time'] =
-$runVar['timers']['query']['proc2_time'] = $runVar['timers']['query']['proc3_time'] = $runVar['timers']['query']['split1_time'] = $runVar['timers']['query']['init1_time'] =
-$runVar['timers']['query']['proc11_time'] = $runVar['timers']['query']['proc21_time'] = $runVar['timers']['query']['proc31_time'] = $runVar['timers']['query']['tpg_time'] =
-$runVar['timers']['query']['tpg1_time'] = 0;
-
-// Analyze tables
-printf($pdo->log->info("\nAnalyzing your tables to refresh your indexes."));
-$pdo->optimise(false, 'analyze', false, ['releases']);
-passthru('clear');
-
-$runVar['settings']['monitor'] = 0;
-$runVar['counts']['iterations'] = 1;
-$runVar['modsettings']['fc']['firstrun'] = true;
-$runVar['modsettings']['fc']['num'] = 0;
-
-while ($runVar['counts']['iterations'] > 0) {
-
- //check the db connection
- if ($pdo->ping(true) == false) {
- unset($pdo);
- $pdo = new DB();
- }
-
- $timer01 = time();
- // These queries are very fast, run every loop -- tmux and site settings
- $runVar['settings'] = $pdo->queryOneRow($tRun->getMonitorSettings(), false);
- $runVar['timers']['query']['tmux_time'] = (time() - $timer01);
-
- $runVar['settings']['book_reqids'] = (!empty($runVar['settings']['book_reqids'])
- ? $runVar['settings']['book_reqids'] : \Category::CAT_PARENT_BOOK);
-
- //get usenet connection info
- $runVar['connections'] = $tOut->getConnectionsInfo($runVar['constants']);
-
- $runVar['modsettings']['clean'] = ($runVar['settings']['post_non'] == 2 ? ' clean ' : ' ');
- $runVar['constants']['pre_lim'] = ($runVar['counts']['iterations'] > 1 ? '7' : '');
-
- //assign scripts
- $runVar['scripts']['releases'] = ($runVar['constants']['tablepergroup'] == 0
- ? "{$runVar['commands']['_php']} {$runVar['paths']['misc']}update_scripts/nix_scripts/tmux/bin/update_releases.php 1 false"
- : "{$runVar['commands']['_php']} {$runVar['paths']['misc']}update_scripts/nix_scripts/multiprocessing/releases.php"
- );
-
- switch((int) $runVar['settings']['binaries_run']) {
- case 1:
- $runVar['scripts']['binaries'] = "{$runVar['commands']['_php']} {$runVar['paths']['misc']}update_scripts/nix_scripts/multiprocessing/binaries.php 0";
- break;
- case 2:
- $runVar['scripts']['binaries'] = "{$runVar['commands']['_php']} {$runVar['paths']['misc']}update_scripts/nix_scripts/multiprocessing/safe.php binaries";
- break;
- default:
- $runVar['scripts']['binaries'] = 0;
- }
-
- switch ((int) $runVar['settings']['backfill']) {
- case 1:
- $runVar['scripts']['backfill'] = "{$runVar['commands']['_php']} {$runVar['paths']['misc']}update_scripts/nix_scripts/multiprocessing/backfill.php";
- break;
- case 2:
- $runVar['scripts']['backfill'] = "{$runVar['commands']['_python']} {$runVar['paths']['misc']}update_scripts/nix_scripts/tmux/python/backfill_threaded.py group";
- break;
- case 4:
- $runVar['scripts']['backfill'] = "{$runVar['commands']['_php']} {$runVar['paths']['misc']}update_scripts/nix_scripts/multiprocessing/safe.php backfill";
- }
-
- //get usenet connection counts
- unset ($runVar['conncounts']);
- $runVar['conncounts'] = $tOut->getUSPConnections('primary', $runVar['connections']);
-
- if ($runVar['constants']['alternate_nntp'] == 1) {
- $runVar['conncounts'] += $tOut->getUSPConnections('alternate', $runVar['connections']);
- }
-
- //run queries only after time exceeded, these queries can take awhile
- if ($runVar['counts']['iterations'] == 1 || (time() - $runVar['timers']['timer2'] >= $runVar['settings']['monitor'] && $runVar['settings']['is_running'] == 1)) {
-
- $runVar['counts']['proc1'] = $runVar['counts']['proc2'] = $runVar['counts']['proc3'] = $splitqry = $newOldqry = false;
- $runVar['counts']['now']['total_work'] = 0;
- $runVar['modsettings']['fix_crap'] = explode(', ', ($runVar['settings']['fix_crap']));
-
- echo $pdo->log->info("\nThe numbers(queries) above are currently being refreshed. \nNo pane(script) can be (re)started until these have completed.\n");
- $timer02 = time();
-
- $splitqry = $newOldqry = '';
-
- $splitqry = $tRun->proc_query(4, $runVar['settings']['book_reqids'], $runVar['settings']['request_hours'], $db_name);
- $newOldqry = $tRun->proc_query(6, $runVar['settings']['book_reqids'], $runVar['settings']['request_hours'], $db_name);
-
- $splitres = $pdo->queryOneRow($splitqry, false);
- $runVar['timers']['newOld'] = $pdo->queryOneRow($newOldqry, false);
-
- //assign split query results to main var
- if (is_array($splitres)) {
- foreach ($splitres AS $splitkey => $split) {
- $runVar['counts']['now'][$splitkey] = $split;
- }
- }
-
- $runVar['timers']['query']['split_time'] = (time() - $timer02);
- $runVar['timers']['query']['split1_time'] = (time() - $timer01);
-
- $timer03 = time();
-
- //This is subpartition compatible -- loops through all partitions and adds their total row counts instead of doing a slow query count
- $partitions = $pdo->queryDirect(
- sprintf("
- SELECT SUM(TABLE_ROWS) AS count, PARTITION_NAME AS category
- FROM INFORMATION_SCHEMA.PARTITIONS
- WHERE TABLE_NAME = 'releases'
- AND TABLE_SCHEMA = %s
- GROUP BY PARTITION_NAME",
- $pdo->escapeString($db_name)
- )
- );
- foreach ($partitions as $partition) {
- $runVar['counts']['now'][$partition['category']] = $partition['count'];
- }
- unset($partitions);
-
- $runVar['timers']['query']['init_time'] = (time() - $timer03);
- $runVar['timers']['query']['init1_time'] = (time() - $timer01);
-
- $timer04 = time();
- $proc1qry = $tRun->proc_query(1, $runVar['settings']['book_reqids'], $runVar['settings']['request_hours'], $db_name);
- $proc1res = $pdo->queryOneRow(($proc1qry !== false ? $proc1qry : ''), $tRun->rand_bool($runVar['counts']['iterations']));
- $runVar['timers']['query']['proc1_time'] = (time() - $timer04);
- $runVar['timers']['query']['proc11_time'] = (time() - $timer01);
-
- $timer05 = time();
- $proc2qry = $tRun->proc_query(2, $runVar['settings']['book_reqids'], $runVar['settings']['request_hours'], $db_name);
- $proc2res = $pdo->queryOneRow(($proc2qry !== false ? $proc2qry : ''), $tRun->rand_bool($runVar['counts']['iterations']));
- $runVar['timers']['query']['proc2_time'] = (time() - $timer05);
- $runVar['timers']['query']['proc21_time'] = (time() - $timer01);
-
- $timer06 = time();
- $proc3qry = $tRun->proc_query(3, $runVar['settings']['book_reqids'], $runVar['settings']['request_hours'], $db_name);
- $proc3res = $pdo->queryOneRow(($proc3qry !== false ? $proc3qry : ''), $tRun->rand_bool($runVar['counts']['iterations']));
- $runVar['timers']['query']['proc3_time'] = (time() - $timer06);
- $runVar['timers']['query']['proc31_time'] = (time() - $timer01);
-
- $timer07 = time();
- if ($runVar['constants']['tablepergroup'] == 1) {
- $sql = 'SHOW TABLE STATUS';
-
- $tables = $pdo->queryDirect($sql);
- $age = time();
-
- $runVar['counts']['now']['binaries_table'] = 0;
- $runVar['counts']['now']['parts_table'] = $runVar['counts']['now']['parterpair_table'] = 0;
-
- if ($tables instanceof \Traversable) {
- foreach ($tables as $row) {
- $cntsql = '';
-
- $tbl = $row['name'];
- $stamp = 'UNIX_TIMESTAMP(MIN(dateadded))';
- $orderlim = '';
- $cntsql = sprintf('
- SELECT TABLE_ROWS AS count
- FROM INFORMATION_SCHEMA.TABLES
- WHERE TABLE_NAME = %s
- AND TABLE_SCHEMA = %s',
- $pdo->escapeString($tbl),
- $pdo->escapeString($db_name)
- );
-
- if (strpos($tbl, 'binaries_') !== false) {
- $run = $pdo->queryOneRow($cntsql, $tRun->rand_bool($runVar['counts']['iterations']));
- if (isset($run['count']) && is_numeric($run['count'])) {
- $runVar['counts']['now']['binaries_table'] += $run['count'];
- }
- } else if (strpos($tbl, 'parts_') !== false) {
- $run = $pdo->queryOneRow($cntsql, $tRun->rand_bool($runVar['counts']['iterations']));
- if (isset($run['count']) && is_numeric($run['count'])) {
- $runVar['counts']['now']['parts_table'] += $run['count'];
- }
- } else if (strpos($tbl, 'partrepair_') !== false) {
- $run = $pdo->queryOneRow($cntsql, $tRun->rand_bool($runVar['counts']['iterations']));
- if (isset($run['count']) && is_numeric($run['count'])) {
- $runVar['counts']['now']['partrepair_table'] += $run['count'];
- }
- }
- }
-
-
- //free up memory used by now stale data
- unset($run, $run1, $tables);
-
- $runVar['timers']['query']['tpg_time'] = (time() - $timer07);
- $runVar['timers']['query']['tpg1_time'] = (time() - $timer01);
- }
- }
- $runVar['timers']['timer2'] = time();
-
- //assign postprocess values from $proc
- if (is_array($proc1res)) {
- foreach ($proc1res AS $proc1key => $proc1) {
- $runVar['counts']['now'][$proc1key] = $proc1;
- }
- } else {
- errorOnSQL($pdo);
- }
-
- if (is_array($proc2res)) {
- foreach ($proc2res AS $proc2key => $proc2) {
- $runVar['counts']['now'][$proc2key] = $proc2;
- }
- } else {
- errorOnSQL($pdo);
- }
- if (is_array($proc3res)) {
- foreach ($proc3res AS $proc3key => $proc3) {
- $runVar['counts']['now'][$proc3key] = $proc3;
- }
- } else {
- errorOnSQL($pdo);
- }
-
- // now that we have merged our query data we can unset these to free up memory
- unset($proc1res, $proc2res, $proc3res, $splitres);
-
- // Zero out any post proc counts when that type of pp has been turned off
- foreach ($runVar['settings'] as $settingkey => $setting) {
- if (strpos($settingkey, 'process') == 0 && $setting == 0) {
- $runVar['counts']['now'][$settingkey] = $runVar['counts']['start'][$settingkey] = 0;
- }
- }
-
- //set initial start postproc values from work queries -- this is used to determine diff variables
- if ($runVar['counts']['iterations'] == 1) {
- $runVar['counts']['start'] = $runVar['counts']['now'];
- }
-
- foreach ($runVar['counts']['now'] as $key => $proc) {
-
- //if key is a process type, add it to total_work
- if (strpos($key, 'process') === 0) {
- $runVar['counts']['now']['total_work'] += $proc;
- }
-
- //calculate diffs
- $runVar['counts']['diff'][$key] = number_format($proc - $runVar['counts']['start'][$key]);
-
- //calculate percentages -- if user has no releases, set 0 for each key or this will fail on divide by zero
- $runVar['counts']['percent'][$key] = ($runVar['counts']['now']['releases'] > 0
- ? sprintf("%02s", floor(($proc / $runVar['counts']['now']['releases']) * 100)) : 0);
- }
-
- $runVar['counts']['now']['total_work'] += $runVar['counts']['now']['work'];
-
- // Set initial total work count for diff
- if ($runVar['counts']['iterations'] == 1) {
- $runVar['counts']['start']['total_work'] = $runVar['counts']['now']['total_work'];
- }
-
- // Set diff total work count
- $runVar['counts']['diff']['total_work'] = number_format($runVar['counts']['now']['total_work'] - $runVar['counts']['start']['total_work']);
- }
-
- //set kill switches
- $runVar['killswitch']['pp'] = (($runVar['settings']['postprocess_kill'] < $runVar['counts']['now']['total_work']) && ($runVar['settings']['postprocess_kill'] != 0)
- ? true
- : false
- );
-
- $tOut->updateMonitorPane($runVar);
-
- //begin pane run execution
- if ($runVar['settings']['is_running'] === '1') {
-
- //run main updating function(s)
- $tRun->runPane('main', $runVar);
-
- //run nzb-import
- $tRun->runPane('import', $runVar);
-
- //run postprocess_releases amazon
- $tRun->runPane('amazon', $runVar);
-
- //respawn IRCScraper if it has been killed
- $tRun->runPane('scraper', $runVar);
-
- //run sharing regardless of sequential setting
- $tRun->runPane('sharing', $runVar);
-
- //update tv and theaters
- $tRun->runPane('updatetv', $runVar);
-
- //run these if complete sequential not set
- if ($runVar['constants']['sequential'] != 2) {
-
- //fix names
- $tRun->runPane('fixnames', $runVar);
-
- //dehash releases
- $tRun->runPane('dehash', $runVar);
-
- // Remove crap releases.
- $tRun->runPane('removecrap', $runVar);
-
- //run postprocess_releases additional
- $tRun->runPane('ppadditional', $runVar);
-
- //run postprocess_releases non amazon
- $tRun->runPane('nonamazon', $runVar);
- }
-
- } else if ($runVar['settings']['is_running'] === '0') {
- $tRun->runPane('notrunning', $runVar);
- }
-
- $runVar['counts']['iterations']++;
- sleep(10);
-}
-
-function errorOnSQL($pdo)
-{
- echo $pdo->log->error(PHP_EOL . "Monitor encountered severe errors retrieving process data from MySQL. Please diagnose and try running again." . PHP_EOL);
- exit;
-}
\ No newline at end of file
diff --git a/bin/postprocess.php b/bin/postprocess.php
deleted file mode 100644
index 8784f6bcd..000000000
--- a/bin/postprocess.php
+++ /dev/null
@@ -1,151 +0,0 @@
-get();
-/**
-Array with possible arguments for run and
-whether or not those methods of operation require NNTP
- **/
-
-$args = array(
- 'additional' => true,
- 'all' => true,
- 'allinf' => true,
- 'amazon' => false,
- 'anime' => false,
- 'book' => false,
- 'console' => false,
- 'games' => false,
- 'movies' => false,
- 'music' => false,
- 'nfo' => true,
- 'pre' => true,
- 'sharing' => true,
- 'spotnab' => true,
- 'tv' => false,
- 'tvdb' => false,
- 'xxx' => false,
-);
-
-$bool = array(
- 'true',
- 'false'
-);
-
-if (!isset($argv[1]) || !in_array($argv[1], $args) || !isset($argv[2]) || !in_array($argv[2], $bool)) {
- exit(
- $pdo->log->error(
- "\nIncorrect arguments.\n"
- . "The second argument (true/false) determines wether to echo or not.\n\n"
- . "php postprocess.php all true ...: Does all the types of post processing.\n"
- . "php postprocess.php pre true ...: Processes all Predb sites.\n"
- . "php postprocess.php nfo true ...: Processes NFO files.\n"
- . "php postprocess.php movies true ...: Processes movies.\n"
- . "php postprocess.php music true ...: Processes music.\n"
- . "php postprocess.php console true ...: Processes console games.\n"
- . "php postprocess.php games true ...: Processes games.\n"
- . "php postprocess.php book true ...: Processes books.\n"
- . "php postprocess.php anime true ...: Processes anime.\n"
- . "php postprocess.php tv true ...: Processes tv.\n"
- . "php postprocess.php tvdb true ...: Processes tvdb.\n"
- . "php postprocess.php xxx true ...: Processes xxx.\n"
- . "php postprocess.php additional true ...: Processes previews/mediainfo/etc...\n"
- . "php postprocess.php sharing true ...: Processes uploading/downloading comments.\n"
- . "php postprocess.php spotnab true ...: Processes uploading/downloading comments from spotnab.\n"
- . "php postprocess.php allinf true ...: Does all the types of post processing on a loop, sleeping 15 seconds between.\n"
- . "php postprocess.php amazon true ...: Does all the amazon (books/console/games/music/xxx).\n"
- )
- );
-}
-
-$nntp = null;
-if ($args[$argv[1]] === true) {
- $nntp = new NNTP(['Settings' => $pdo]);
- if (($site->alternate_nntp == 1 ? $nntp->doConnect(true, true) : $nntp->doConnect()) !== true) {
- exit($pdo->log->error("Unable to connect to usenet." . PHP_EOL));
- }
-}
-
-$postProcess = new PProcess(['Settings' => $pdo, 'Echo' => ($argv[2] === 'true' ? true : false)]);
-$pp = new PostProcess(true);
-
-$charArray = ['a','b','c','d','e','f','0','1','2','3','4','5','6','7','8','9'];
-
-switch ($argv[1]) {
-
- case 'all':
- $postProcess->processAll($nntp);
- break;
- case 'allinf':
- $i = 1;
- while ($i = 1) {
- $postProcess->processAll($nntp);
- sleep(15);
- }
- break;
- case 'additional':
- $postProcess->processAdditional($nntp, '', (isset($argv[3]) && in_array($argv[3], $charArray) ? $argv[3] : ''));
- break;
- case 'amazon':
- $postProcess->processBooks();
- $postProcess->processConsoles();
- $postProcess->processGames();
- $postProcess->processMusic();
- $postProcess->processXXX();
- break;
- case 'anime':
- $postProcess->processAnime();
- break;
- case 'book':
- $postProcess->processBooks();
- $pp->processBooks();
- break;
- case 'console':
- $postProcess->processConsoles();
- break;
- case 'games':
- $postProcess->processGames();
- break;
- case 'nfo':
- $postProcess->processNfos($nntp, '', (isset($argv[3]) && in_array($argv[3], $charArray) ? $argv[3] : ''));
- break;
- case 'movies':
- $postProcess->processMovies('', (isset($argv[3]) && in_array($argv[3], $charArray) ? $argv[3] : ''));
- break;
- case 'music':
- $postProcess->processMusic();
- $pp->processMusic();
- break;
- case 'pre':
- break;
- case 'sharing':
- $postProcess->processSharing($nntp);
- break;
- case 'spotnab':
- $postProcess->processSpotnab($nntp);
- break;
- case 'tv':
- $postProcess->processTV('', (isset($argv[3]) && in_array($argv[3], $charArray) ? $argv[3] : ''));
- break;
- case 'tvdb':
- $postProcess->processTvDB();
- break;
- case 'xxx':
- $postProcess->processXXX();
- break;
- default:
- exit;
-}
\ No newline at end of file
diff --git a/bin/postprocess_threaded.php b/bin/postprocess_threaded.php
deleted file mode 100644
index 19a711a76..000000000
--- a/bin/postprocess_threaded.php
+++ /dev/null
@@ -1,49 +0,0 @@
-error("This script is not intended to be run manually, it is called from postprocess_threaded.py."));
-}
-
-
-$tmux = new Tmux;
-$torun = $tmux->get()->post;
-
-$pieces = explode(' =+= ', $argv[1]);
-
-$postprocess = new PProcess(['Echo' => true]);
-if (isset($pieces[6])) {
- // Create the connection here and pass
- $nntp = new NNTP();
- if ($nntp->doConnect() === false) {
- exit($c->error("Unable to connect to usenet."));
- }
-
- $postprocess->processAdditional($nntp, $argv[1]);
- $nntp->doQuit();
-} else if (isset($pieces[3])) {
- // Create the connection here and pass
- $nntp = new NNTP();
- if ($nntp->doConnect() === false) {
- exit($c->error("Unable to connect to usenet."));
- }
-
- $postprocess->processNfos($argv[1], $nntp);
- $nntp->doQuit();
-
-} else if (isset($pieces[2])) {
- $postprocess->processMovies($argv[1]);
- echo '.';
-} else if (isset($pieces[1])) {
- $postprocess->processTv($argv[1]);
-}
diff --git a/bin/tmux-mem-cpu-load b/bin/tmux-mem-cpu-load
deleted file mode 100755
index 348f64ec6..000000000
Binary files a/bin/tmux-mem-cpu-load and /dev/null differ
diff --git a/bin/tmux-mem-cpu-load-x32 b/bin/tmux-mem-cpu-load-x32
deleted file mode 100755
index e750ee63f..000000000
Binary files a/bin/tmux-mem-cpu-load-x32 and /dev/null differ
diff --git a/bin/update_binaries.php b/bin/update_binaries.php
deleted file mode 100644
index eb6091f4f..000000000
--- a/bin/update_binaries.php
+++ /dev/null
@@ -1,55 +0,0 @@
-header("Updating group {$group}");
-
- $g = new Groups;
- $group = $g->getByName($group);
-
- $bin = new Binaries;
- $bin->updateGroup($group);
-} else {
- $binaries = new Binaries;
- $binaries->updateAllGroups();
-}
-
-function relativeTime($_time)
-{
- $d = array();
- $d[0] = array(1, "sec");
- $d[1] = array(60, "min");
- $d[2] = array(3600, "hr");
- $d[3] = array(86400, "day");
- $d[4] = array(31104000, "yr");
-
- $w = array();
-
- $return = "";
- $now = TIME();
- $diff = ($now - $_time);
- $secondsLeft = $diff;
-
- for ($i = 4; $i > -1; $i--) {
- $w[$i] = intval($secondsLeft / $d[$i][0]);
- $secondsLeft -= ($w[$i] * $d[$i][0]);
- if ($w[$i] != 0) {
- //$return.= abs($w[$i]). " " . $d[$i][1] . (($w[$i]>1)?'s':'') ." ";
- $return .= $w[$i] . " " . $d[$i][1] . (($w[$i] > 1) ? 's' : '') . " ";
- }
- }
-
- //$return .= ($diff>0)?"ago":"left";
- return $return;
-}
-
-echo $c->header("Group update process completed in: " . relativeTime($time) . "\n");
-
diff --git a/bin/update_groups.php b/bin/update_groups.php
deleted file mode 100644
index f299186fb..000000000
--- a/bin/update_groups.php
+++ /dev/null
@@ -1,59 +0,0 @@
- $pdo]);
-if ($nntp->doConnect() !== true) {
- exit($pdo->log->error("Unable to connect to usenet."));
-}
-
-echo $pdo->log->header("Getting first/last for all your active groups.");
-$data = $nntp->getGroups();
-if ($nntp->isError($data)) {
- exit($pdo->log->error("Failed to getGroups() from nntp server."));
-}
-
-echo $pdo->log->header("Inserting new values into shortgroups table.");
-
-$pdo->queryExec('TRUNCATE TABLE shortgroups');
-
-// Put into an array all active groups
-$res = $pdo->query('SELECT name FROM groups WHERE active = 1 OR backfill = 1');
-
-foreach ($data as $newgroup) {
- if (myInArray($res, $newgroup['group'], 'name')) {
- $pdo->queryInsert(sprintf('INSERT INTO shortgroups (name, first_record, last_record, updated) VALUES (%s, %s, %s, NOW())', $pdo->escapeString($newgroup['group']), $pdo->escapeString($newgroup['first']), $pdo->escapeString($newgroup['last'])));
- echo $pdo->log->primary('Updated ' . $newgroup['group']);
- }
-}
-echo $pdo->log->header('Running time: ' . $consoleTools->convertTimer(TIME() - $start));
-
-function myInArray($array, $value, $key)
-{
- //loop through the array
- foreach ($array as $val) {
- //if $val is an array cal myInArray again with $val as array input
- if (is_array($val)) {
- if (myInArray($val, $value, $key)) {
- return true;
- }
- } else {
- //else check if the given key has $value as value
- if ($array[$key] == $value) {
- return true;
- }
- }
- }
- return false;
-}
\ No newline at end of file
diff --git a/bin/update_releases.php b/bin/update_releases.php
deleted file mode 100644
index bfdf432f7..000000000
--- a/bin/update_releases.php
+++ /dev/null
@@ -1,76 +0,0 @@
-get();
-$pdo = new DB();
-
-if (isset($argv[2]) && $argv[2] === 'true') {
- // Create the connection here and pass
- $nntp = new \NNTP(['Settings' => $pdo]);
- if ($nntp->doConnect() !== true) {
- exit($pdo->log->error("Unable to connect to usenet."));
- }
-}
-if ($site->tablepergroup === 1) {
- exit($pdo->log->error("You are using 'tablepergroup', you must use .../misc/update_scripts/nix_scripts/multiprocessing/releases.php"));
-}
-
-$groupName = isset($argv[3]) ? $argv[3] : '';
-if (isset($argv[1]) && isset($argv[2])) {
- $consoletools = new \ConsoleTools(['ColorCLI' => $pdo->log]);
- $releases = new Releases(['Settings' => $pdo, 'ConsoleTools' => $consoletools]);
- if ($argv[1] == 1 && $argv[2] == 'true') {
- $releases->processReleases(1, 1, $groupName, $nntp, true);
- } else if ($argv[1] == 1 && $argv[2] == 'false') {
- $releases->processReleases(1, 2, $groupName, $nntp, true);
- } else if ($argv[1] == 2 && $argv[2] == 'true') {
- $releases->processReleases(2, 1, $groupName, $nntp, true);
- } else if ($argv[1] == 2 && $argv[2] == 'false') {
- $releases->processReleases(2, 2, $groupName, $nntp, true);
- } else if ($argv[1] == 4 && ($argv[2] == 'true' || $argv[2] == 'false')) {
- echo $pdo->log->header("Moving all releases to other -> misc, this can take a while, be patient.");
- $releases->resetCategorize();
- } else if ($argv[1] == 5 && ($argv[2] == 'true' || $argv[2] == 'false')) {
- echo $pdo->log->header("Categorizing all non-categorized releases in other->misc using usenet subject. This can take a while, be patient.");
- $timestart = TIME();
- $relcount = $releases->categorizeRelease('name', 'WHERE iscategorized = 0 AND categoryid = 8010');
- $time = $consoletools->convertTime(TIME() - $timestart);
- echo $pdo->log->primary("\n" . 'Finished categorizing ' . $relcount . ' releases in ' . $time . " seconds, using the usenet subject.");
- } else if ($argv[1] == 6 && $argv[2] == 'true') {
- echo $pdo->log->header("Categorizing releases in all sections using the searchname. This can take a while, be patient.");
- $timestart = TIME();
- $relcount = $releases->categorizeRelease('searchname', '');
- $consoletools = new \ConsoleTools(['ColorCLI' => $pdo->log]);
- $time = $consoletools->convertTime(TIME() - $timestart);
- echo $pdo->log->primary("\n" . 'Finished categorizing ' . $relcount . ' releases in ' . $time . " seconds, using the search name.");
- } else if ($argv[1] == 6 && $argv[2] == 'false') {
- echo $pdo->log->header("Categorizing releases in misc sections using the searchname. This can take a while, be patient.");
- $timestart = TIME();
- $relcount = $releases->categorizeRelease('searchname', 'WHERE categoryid IN (1090, 2020, 3050, 5050, 6050, 8010)');
- $consoletools = new \ConsoleTools(['ColorCLI' => $pdo->log]);
- $time = $consoletools->convertTime(TIME() - $timestart);
- echo $pdo->log->primary("\n" . 'Finished categorizing ' . $relcount . ' releases in ' . $time . " seconds, using the search name.");
- } else {
- exit($pdo->log->error("Wrong argument, type php update_releases.php to see a list of valid arguments."));
- }
-} else {
- exit($pdo->log->error("\nWrong set of arguments.\n"
- . "php update_releases.php 1 true ...: Creates releases and attempts to categorize new releases\n"
- . "php update_releases.php 2 true ...: Creates releases and leaves new releases in other -> misc\n"
- . "\nYou must pass a second argument whether to post process or not, true or false\n"
- . "You can pass a third optional argument, a group name (ex.: alt.binaries.multimedia).\n"
- . "\nExtra commands::\n"
- . "php update_releases.php 4 true ...: Puts all releases in other-> misc (also resets to look like they have never been categorized)\n"
- . "php update_releases.php 5 true ...: Categorizes all releases in other-> misc (which have not been categorized already)\n"
- . "php update_releases.php 6 false ...: Categorizes releases in misc sections using the search name\n"
- . "php update_releases.php 6 true ...: Categorizes releases in all sections using the search name\n"));
-}
\ No newline at end of file
diff --git a/lib/DB/db.sql b/lib/DB/db.sql
deleted file mode 100644
index aa93c1375..000000000
--- a/lib/DB/db.sql
+++ /dev/null
@@ -1,1278 +0,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`, `rageid`);
-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;
-ALTER TABLE users ADD COLUMN cp_api VARCHAR(255) NULL DEFAULT NULL;
-ALTER TABLE users ADD COLUMN cp_url VARCHAR(255) NULL DEFAULT NULL;
-ALTER TABLE users ADD COLUMN queuetype TINYINT(1) NOT NULL DEFAULT 1;
-
-
-DROP TABLE IF EXISTS prehash;
-CREATE TABLE prehash (
- id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
- filename VARCHAR(255) NOT NULL DEFAULT '',
- title VARCHAR(255) NOT NULL DEFAULT '',
- nfo VARCHAR(255) NULL,
- size VARCHAR(50) NULL,
- category VARCHAR(255) NULL,
- predate DATETIME DEFAULT NULL,
- source VARCHAR(50) NOT NULL DEFAULT '',
- requestid INT(10) UNSIGNED NOT NULL DEFAULT '0',
- groupid INT(10) UNSIGNED NOT NULL DEFAULT '0',
- nuked TINYINT(1) NOT NULL DEFAULT '0',
- nukereason VARCHAR(255) NULL,
- files VARCHAR(50) NULL,
- searched TINYINT(1) NOT NULL DEFAULT '0',
- PRIMARY KEY (id)
-)
- ENGINE =INNODB
- 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`);
-
-DROP TABLE IF EXISTS tmux;
-CREATE TABLE tmux (
- id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
- setting VARCHAR(64)
- COLLATE utf8_unicode_ci NOT NULL,
- value VARCHAR(19000)
- COLLATE utf8_unicode_ci DEFAULT NULL,
- updateddate TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
- PRIMARY KEY (id),
- UNIQUE KEY setting (setting)
-)
- ENGINE =INNODB
- DEFAULT CHARSET =utf8
- COLLATE =utf8_unicode_ci;
-
-INSERT INTO tmux (setting, value) VALUES ('defrag_cache', '900'),
-('monitor_delay', '30'),
-('tmux_session', 'newznab'),
-('niceness', '19'),
-('binaries', '0'),
-('maxbinaries', '10000'),
-('backfill', '0'),
-('import', '0'),
-('nzbs', '/path/to/nzbs'),
-('running', '0'),
-('sequential', '0'),
-('nfos', '0'),
-('post', '0'),
-('releases', '0'),
-('fix_names', '0'),
-('seq_timer', '30'),
-('bins_timer', '30'),
-('bins_kill_timer', '0'),
-('back_timer', '30'),
-('import_timer', '30'),
-('rel_timer', '30'),
-('fix_timer', '30'),
-('post_timer', '30'),
-('import_bulk', '0'),
-('backfill_qty', '100000'),
-('postprocess_kill', '0'),
-('crap_timer', '30'),
-('fix_crap', '0'),
-('tv_timer', '43200'),
-('update_tv', '0'),
-('htop', '0'),
-('nmon', '0'),
-('bwmng', '0'),
-('mytop', '0'),
-('console', '0'),
-('vnstat', '0'),
-('vnstat_args', NULL),
-('tcptrack', '0'),
-('tcptrack_args', '-i eth0 port 443'),
-('backfill_groups', '4'),
-('post_kill_timer', '300'),
-('monitor_path', NULL),
-('write_logs', '0'),
-('powerline', '0'),
-('patchdb', '0'),
-('patchdb_timer', '21600'),
-('progressive', '0'),
-('backfill_order', '2'),
-('backfill_days', '1'),
-('post_amazon', '0'),
-('amazonsleep', 1000),
-('post_non', '0'),
-('post_timer_amazon', '30'),
-('post_timer_non', '30'),
-('colors_start', '1'),
-('colors_end', '250'),
-('colors_exc', '4, 8, 9, 11, 15, 16, 17, 18, 19, 46, 47, 48, 49, 50, 51, 52, 53, 59, 60'),
-('monitor_path_a', NULL),
-('monitor_path_b', NULL),
-('showquery', '0'),
-('fix_crap_opt', 'Disabled'),
-('showprocesslist', '0'),
-('processupdate', '2'),
-('maxaddprocessed', 25),
-('maxnfoprocessed', 100),
-('maxrageprocessed', 75),
-('maximdbprocessed', 100),
-('maxanidbprocessed', 100),
-('maxmusicprocessed', 150),
-('maxgamesprocessed', 150),
-('maxbooksprocessed', 300),
-('maxnzbsprocessed', 1000),
-('maxpartrepair', 15000),
-('partrepair', 1),
-('binarythreads', 1),
-('backfillthreads', 1),
-('postthreads', 1),
-('releasethreads', 1),
-('nzbthreads', 1),
-('maxmssgs', 20000),
-('maxsizetopostprocess', 100),
-('postthreadsamazon', '1'),
-('postthreadsnon', '1'),
-('currentppticket', '0'),
-('nextppticket', '0'),
-('segmentstodownload', '2'),
-('passchkattempts', 1),
-('maxpartsprocessed', 3),
-('debuginfo', 0),
-('sphinx', '0'),
-('sphinx_timer', '600'),
-('movie_timer', '43200'),
-('fetch_movie', '0'),
-('unwanted', '0'),
-('others', '0'),
-('spotnab', '0'),
-('spotnab_timer', '600'),
-('predb', '0'),
-('predb_timer', '600'),
-('safebackfilldate', '2012-06-24'),
-('request_hours', '1'),
-('trakttvkey', ''),
-('fanarttvkey', ''),
-('lookuppar2', '0'),
-('addpar2', '0'),
-('fixnamethreads', '1'),
-('fixnamesperrun', '10'),
-('zippath', ''),
-('processjpg', 0),
-('scrape', 0),
-('lastpretime', '0'),
-('nntpretries', '10'),
-('run_sharing', '0'),
- ('sharing_timer', '60'),
- ('imdburl', '0'),
- ('yydecoderpath', ''),
- ('ffmpeg_duration', '5'),
- ('ffmpeg_image_time', '5'),
- ('processvideos', '0'),
- ('sqlpatch', '73');
-
-DROP TABLE IF EXISTS releasesearch;
-CREATE TABLE releasesearch (
- id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
- releaseid INT(11) UNSIGNED NOT NULL,
- guid VARCHAR(50) NOT NULL,
- name VARCHAR(255) NOT NULL DEFAULT '',
- searchname VARCHAR(255) NOT NULL DEFAULT '',
- PRIMARY KEY (id)
-)
- ENGINE =MYISAM
- DEFAULT CHARSET =utf8
- COLLATE =utf8_unicode_ci
- AUTO_INCREMENT =1;
-
-CREATE FULLTEXT INDEX ix_releasesearch_name_searchname_ft ON releasesearch (name, searchname);
-CREATE INDEX ix_releasesearch_releaseid ON releasesearch (releaseid);
-CREATE INDEX ix_releasesearch_guid ON releasesearch (guid);
-
-DROP TABLE IF EXISTS country;
-CREATE TABLE country (
- id INT(11) NOT NULL AUTO_INCREMENT,
- name VARCHAR(255) NOT NULL DEFAULT "",
- code CHAR(2) NOT NULL DEFAULT "",
- PRIMARY KEY (id)
-)
- ENGINE =INNODB
- DEFAULT CHARACTER SET utf8
- COLLATE utf8_unicode_ci
- AUTO_INCREMENT =1;
-
-CREATE INDEX ix_country_name ON country (name);
-
-INSERT INTO country (code, name) VALUES ('AF', 'Afghanistan'),
-('AX', 'Aland Islands'),
-('AL', 'Albania'),
-('DZ', 'Algeria'),
-('AS', 'American Samoa'),
-('AD', 'Andorra'),
-('AO', 'Angola'),
-('AI', 'Anguilla'),
-('AQ', 'Antarctica'),
-('AG', 'Antigua and Barbuda'),
-('AR', 'Argentina'),
-('AM', 'Armenia'),
-('AW', 'Aruba'),
-('AU', 'Australia'),
-('AT', 'Austria'),
-('AZ', 'Azerbaijan'),
-('BS', 'Bahamas'),
-('BH', 'Bahrain'),
-('BD', 'Bangladesh'),
-('BB', 'Barbados'),
-('BY', 'Belarus'),
-('BE', 'Belgium'),
-('BZ', 'Belize'),
-('BJ', 'Benin'),
-('BM', 'Bermuda'),
-('BT', 'Bhutan'),
-('BO', 'Bolivia'),
-('BA', 'Bosnia and Herzegovina'),
-('BW', 'Botswana'),
-('BV', 'Bouvetoya'),
-('BR', 'Brazil'),
-('VG', 'British Virgin Islands'),
-('BN', 'Brunei Darussalam'),
-('BG', 'Bulgaria'),
-('BF', 'Burkina Faso'),
-('BI', 'Burundi'),
-('KH', 'Cambodia'),
-('CM', 'Cameroon'),
-('CA', 'Canada'),
-('CV', 'Cape Verde'),
-('KY', 'Cayman Islands'),
-('CF', 'Central African Republic'),
-('TD', 'Chad'),
-('CL', 'Chile'),
-('CN', 'China'),
-('CX', 'Christmas Island'),
-('CC', 'Cocos (Keeling) Islands'),
-('CO', 'Colombia'),
-('KM', 'Comoros the'),
-('CD', 'Congo'),
-('CG', 'Congo the'),
-('CK', 'Cook Islands'),
-('CR', 'Costa Rica'),
-('CI', 'Cote d\'Ivoire'),
-('HR', 'Croatia'),
-('CU', 'Cuba'),
-('CY', 'Cyprus'),
-('CZ', 'Czech Republic'),
-('DK', 'Denmark'),
-('DJ', 'Djibouti'),
-('DM', 'Dominica'),
-('DO', 'Dominican Republic'),
-('EC', 'Ecuador'),
-('EG', 'Egypt'),
-('SV', 'El Salvador'),
-('GQ', 'Equatorial Guinea'),
-('ER', 'Eritrea'),
-('EE', 'Estonia'),
-('ET', 'Ethiopia'),
-('FO', 'Faroe Islands'),
-('FK', 'Falkland Islands'),
-('FJ', 'Fiji'),
-('FI', 'Finland'),
-('FR', 'France'),
-('GF', 'French Guiana'),
-('PF', 'French Polynesia'),
-('GA', 'Gabon'),
-('GM', 'Gambia'),
-('GE', 'Georgia'),
-('DE', 'Germany'),
-('GH', 'Ghana'),
-('GI', 'Gibraltar'),
-('GR', 'Greece'),
-('GL', 'Greenland'),
-('GD', 'Grenada'),
-('GP', 'Guadeloupe'),
-('GU', 'Guam'),
-('GT', 'Guatemala'),
-('GG', 'Guernsey'),
-('GN', 'Guinea'),
-('GW', 'Guinea-Bissau'),
-('GY', 'Guyana'),
-('HT', 'Haiti'),
-('HN', 'Honduras'),
-('HK', 'Hong Kong'),
-('HU', 'Hungary'),
-('IS', 'Iceland'),
-('IN', 'India'),
-('id', 'Indonesia'),
-('IR', 'Iran'),
-('IQ', 'Iraq'),
-('IE', 'Ireland'),
-('IM', 'Isle of Man'),
-('IL', 'Israel'),
-('IT', 'Italy'),
-('JM', 'Jamaica'),
-('JP', 'Japan'),
-('JE', 'Jersey'),
-('JO', 'Jordan'),
-('KZ', 'Kazakhstan'),
-('KE', 'Kenya'),
-('KI', 'Kiribati'),
-('KP', 'Korea'),
-('KR', 'Korea'),
-('KW', 'Kuwait'),
-('KG', 'Kyrgyz Republic'),
-('LA', 'Lao'),
-('LV', 'Latvia'),
-('LB', 'Lebanon'),
-('LS', 'Lesotho'),
-('LR', 'Liberia'),
-('LY', 'Libyan Arab Jamahiriya'),
-('LI', 'Liechtenstein'),
-('LT', 'Lithuania'),
-('LU', 'Luxembourg'),
-('MO', 'Macao'),
-('MK', 'Macedonia'),
-('MG', 'Madagascar'),
-('MW', 'Malawi'),
-('MY', 'Malaysia'),
-('MV', 'Maldives'),
-('ML', 'Mali'),
-('MT', 'Malta'),
-('MH', 'Marshall Islands'),
-('MQ', 'Martinique'),
-('MR', 'Mauritania'),
-('MU', 'Mauritius'),
-('YT', 'Mayotte'),
-('MX', 'Mexico'),
-('FM', 'Micronesia'),
-('MD', 'Moldova'),
-('MC', 'Monaco'),
-('MN', 'Mongolia'),
-('ME', 'Montenegro'),
-('MS', 'Montserrat'),
-('MA', 'Morocco'),
-('MZ', 'Mozambique'),
-('MM', 'Myanmar'),
-('NA', 'Namibia'),
-('NR', 'Nauru'),
-('NP', 'Nepal'),
-('AN', 'Netherlands Antilles'),
-('NL', 'Netherlands'),
-('NC', 'New Caledonia'),
-('NZ', 'New Zealand'),
-('NI', 'Nicaragua'),
-('NE', 'Niger'),
-('NG', 'Nigeria'),
-('NU', 'Niue'),
-('NF', 'Norfolk Island'),
-('MP', 'Northern Mariana Islands'),
-('NO', 'Norway'),
-('OM', 'Oman'),
-('PK', 'Pakistan'),
-('PW', 'Palau'),
-('PS', 'Palestinian Territory'),
-('PA', 'Panama'),
-('PG', 'Papua New Guinea'),
-('PY', 'Paraguay'),
-('PE', 'Peru'),
-('PH', 'Philippines'),
-('PN', 'Pitcairn Islands'),
-('PL', 'Poland'),
-('PT', 'Portugal'),
-('PR', 'Puerto Rico'),
-('QA', 'Qatar'),
-('RE', 'Reunion'),
-('RO', 'Romania'),
-('RU', 'Russian Federation'),
-('RW', 'Rwanda'),
-('BL', 'Saint Barthelemy'),
-('SH', 'Saint Helena'),
-('KN', 'Saint Kitts'),
-('LC', 'Saint Lucia'),
-('MF', 'Saint Martin'),
-('PM', 'Saint Pierre'),
-('VC', 'Saint Vincent'),
-('WS', 'Samoa'),
-('SM', 'San Marino'),
-('ST', 'Sao Tome'),
-('SA', 'Saudi Arabia'),
-('SN', 'Senegal'),
-('RS', 'Serbia'),
-('SC', 'Seychelles'),
-('SL', 'Sierra Leone'),
-('SG', 'Singapore'),
-('SK', 'Slovakia'),
-('SI', 'Slovenia'),
-('SB', 'Solomon Islands'),
-('SO', 'Somalia'),
-('ZA', 'South Africa'),
-('ES', 'Spain'),
-('LK', 'Sri Lanka'),
-('SD', 'Sudan'),
-('SR', 'Suriname'),
-('SZ', 'Swaziland'),
-('SE', 'Sweden'),
-('CH', 'Switzerland'),
-('SY', 'Syrian Arab Republic'),
-('TW', 'Taiwan'),
-('TJ', 'Tajikistan'),
-('TZ', 'Tanzania'),
-('TH', 'Thailand'),
-('TL', 'Timor-Leste'),
-('TG', 'Togo'),
-('TK', 'Tokelau'),
-('TO', 'Tonga'),
-('TT', 'Trinidad and Tobago'),
-('TN', 'Tunisia'),
-('TR', 'Turkey'),
-('TM', 'Turkmenistan'),
-('TV', 'Tuvalu'),
-('UG', 'Uganda'),
-('UA', 'Ukraine'),
-('AE', 'United Arab Emirates'),
-('GB', 'United Kingdom'),
-('US', 'United States'),
-('VI', 'United States Virgin Islands'),
-('UY', 'Uruguay'),
-('UZ', 'Uzbekistan'),
-('VU', 'Vanuatu'),
- ('VE', 'Venezuela'),
- ('VN', 'Vietnam'),
- ('WF', 'Wallis and Futuna'),
- ('EH', 'Western Sahara'),
- ('YE', 'Yemen'),
- ('ZM', 'Zambia'),
- ('ZW', 'Zimbabwe');
-
-DROP TABLE IF EXISTS gamesinfo;
-CREATE TABLE gamesinfo (
- id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
- title VARCHAR(255) NOT NULL,
- asin VARCHAR(128) DEFAULT NULL,
- url VARCHAR(1000) DEFAULT NULL,
- publisher VARCHAR(255) DEFAULT NULL,
- genre_id INT(10) NULL DEFAULT NULL,
- esrb VARCHAR(255) NULL DEFAULT NULL,
- releasedate DATETIME DEFAULT NULL,
- review VARCHAR(3000) DEFAULT NULL,
- cover TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
- backdrop TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
- trailer VARCHAR(1000) NOT NULL DEFAULT '',
- classused VARCHAR(10) NOT NULL DEFAULT 'steam' ,
- createddate DATETIME NOT NULL,
- updateddate DATETIME NOT NULL,
- PRIMARY KEY (id),
- UNIQUE INDEX ix_gamesinfo_asin (asin)
-)
- ENGINE = InnoDB
- DEFAULT CHARSET = utf8
- COLLATE = utf8_unicode_ci
- AUTO_INCREMENT = 1;
-
-DROP TABLE IF EXISTS xxxinfo;
-CREATE TABLE xxxinfo (
- id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
- title VARCHAR(255) NOT NULL,
- tagline VARCHAR(1024) NOT NULL,
- plot BLOB NULL DEFAULT NULL,
- genre VARCHAR(64) NOT NULL,
- director VARCHAR(64) DEFAULT NULL,
- actors VARCHAR(2000) NOT NULL,
- extras TEXT DEFAULT NULL,
- productinfo TEXT DEFAULT NULL,
- trailers TEXT DEFAULT NULL,
- directurl VARCHAR(2000) NOT NULL,
- classused VARCHAR(3) NOT NULL,
- cover TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
- backdrop TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
- createddate DATETIME NOT NULL,
- updateddate DATETIME NOT NULL,
- PRIMARY KEY (id),
- INDEX ix_xxxinfo_title (title)
-)
- ENGINE = InnoDB
- 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;
-
-INSERT IGNORE INTO `genres` (`id`, `title`, `type`, `disabled`) VALUES
- (150, 'Blues', 3000, 0),
- (151, 'Classic Rock', 3000, 0),
- (152, 'Country', 3000, 0),
- (153, 'Dance', 3000, 0),
- (154, 'Disco', 3000, 0),
- (155, 'Funk', 3000, 0),
- (156, 'Grunge', 3000, 0),
- (157, 'Hip-Hop', 3000, 0),
- (158, 'Jazz', 3000, 0),
- (159, 'Metal', 3000, 0),
- (160, 'New Age', 3000, 0),
- (161, 'Oldies', 3000, 0),
- (162, 'Other', 3000, 0),
- (163, 'Pop', 3000, 0),
- (164, 'R&B', 3000, 0),
- (165, 'Rap', 3000, 0),
- (166, 'Reggae', 3000, 0),
- (167, 'Rock', 3000, 0),
- (168, 'Techno', 3000, 0),
- (169, 'Industrial', 3000, 0),
- (170, 'Alternative', 3000, 0),
- (171, 'Ska', 3000, 0),
- (172, 'Death Metal', 3000, 0),
- (173, 'Pranks', 3000, 0),
- (174, 'Soundtrack', 3000, 0),
- (175, 'Euro-Techno', 3000, 0),
- (176, 'Ambient', 3000, 0),
- (177, 'Trip-Hop', 3000, 0),
- (178, 'Vocal', 3000, 0),
- (179, 'Jazz+Funk', 3000, 0),
- (180, 'Fusion', 3000, 0),
- (181, 'Trance', 3000, 0),
- (182, 'Classical', 3000, 0),
- (183, 'Instrumental', 3000, 0),
- (184, 'Acid', 3000, 0),
- (185, 'House', 3000, 0),
- (186, 'Game', 3000, 0),
- (187, 'Sound Clip', 3000, 0),
- (188, 'Gospel', 3000, 0),
- (189, 'Noise', 3000, 0),
- (190, 'Alternative Rock', 3000, 0),
- (191, 'Bass', 3000, 0),
- (192, 'Soul', 3000, 0),
- (193, 'Punk', 3000, 0),
- (194, 'Space', 3000, 0),
- (195, 'Meditative', 3000, 0),
- (196, 'Instrumental Pop', 3000, 0),
- (197, 'Instrumental Rock', 3000, 0),
- (198, 'Ethnic', 3000, 0),
- (199, 'Gothic', 3000, 0),
- (200, 'Darkwave', 3000, 0),
- (201, 'Techno-Industrial', 3000, 0),
- (202, 'Electronic', 3000, 0),
- (203, 'Pop-Folk', 3000, 0),
- (204, 'Eurodance', 3000, 0),
- (205, 'Dream', 3000, 0),
- (206, 'Southern Rock', 3000, 0),
- (207, 'Comedy', 3000, 0),
- (208, 'Cult', 3000, 0),
- (209, 'Gangsta', 3000, 0),
- (210, 'Top 40', 3000, 0),
- (211, 'Christian Rap', 3000, 0),
- (212, 'Pop/Funk', 3000, 0),
- (213, 'Jungle', 3000, 0),
- (214, 'Native US', 3000, 0),
- (215, 'Cabaret', 3000, 0),
- (216, 'New Wave', 3000, 0),
- (217, 'Psychadelic', 3000, 0),
- (218, 'Rave', 3000, 0),
- (219, 'Showtunes', 3000, 0),
- (220, 'Trailer', 3000, 0),
- (221, 'Lo-Fi', 3000, 0),
- (222, 'Tribal', 3000, 0),
- (223, 'Acid Punk', 3000, 0),
- (224, 'Acid Jazz', 3000, 0),
- (225, 'Polka', 3000, 0),
- (226, 'Retro', 3000, 0),
- (227, 'Musical', 3000, 0),
- (228, 'Rock & Roll', 3000, 0),
- (229, 'Hard Rock', 3000, 0),
- (230, 'Folk', 3000, 0),
- (231, 'Folk-Rock', 3000, 0),
- (232, 'National Folk', 3000, 0),
- (233, 'Swing', 3000, 0),
- (234, 'Fast Fusion', 3000, 0),
- (235, 'Bebob', 3000, 0),
- (236, 'Latin', 3000, 0),
- (237, 'Revival', 3000, 0),
- (238, 'Celtic', 3000, 0),
- (239, 'Bluegrass', 3000, 0),
- (240, 'Avantgarde', 3000, 0),
- (241, 'Gothic Rock', 3000, 0),
- (242, 'Progressive Rock', 3000, 0),
- (243, 'Psychedelic Rock', 3000, 0),
- (244, 'Symphonic Rock', 3000, 0),
- (245, 'Slow Rock', 3000, 0),
- (246, 'Big Band', 3000, 0),
- (247, 'Chorus', 3000, 0),
- (248, 'Easy Listening', 3000, 0),
- (249, 'Acoustic', 3000, 0),
- (250, 'Humour', 3000, 0),
- (251, 'Speech', 3000, 0),
- (252, 'Chanson', 3000, 0),
- (253, 'Opera', 3000, 0),
- (254, 'Chamber Music', 3000, 0),
- (255, 'Sonata', 3000, 0),
- (256, 'Symphony', 3000, 0),
- (257, 'Booty Bass', 3000, 0),
- (258, 'Primus', 3000, 0),
- (259, 'Porn Groove', 3000, 0),
- (260, 'Satire', 3000, 0),
- (261, 'Slow Jam', 3000, 0),
- (262, 'Club', 3000, 0),
- (263, 'Tango', 3000, 0),
- (264, 'Samba', 3000, 0),
- (265, 'Folklore', 3000, 0),
- (266, 'Ballad', 3000, 0),
- (267, 'Power Ballad', 3000, 0),
- (268, 'Rhytmic Soul', 3000, 0),
- (269, 'Freestyle', 3000, 0),
- (270, 'Duet', 3000, 0),
- (271, 'Punk Rock', 3000, 0),
- (272, 'Drum Solo', 3000, 0),
- (273, 'Acapella', 3000, 0),
- (274, 'Euro-House', 3000, 0),
- (275, 'Dance Hall', 3000, 0),
- (276, 'Goa', 3000, 0),
- (277, 'Drum & Bass', 3000, 0),
- (278, 'Club-House', 3000, 0),
- (279, 'Hardcore', 3000, 0),
- (280, 'Terror', 3000, 0),
- (281, 'Indie', 3000, 0),
- (282, 'BritPop', 3000, 0),
- (283, 'Negerpunk', 3000, 0),
- (284, 'Polsk Punk', 3000, 0),
- (285, 'Beat', 3000, 0),
- (286, 'Christian Gangsta', 3000, 0),
- (287, 'Heavy Metal', 3000, 0),
- (288, 'Black Metal', 3000, 0),
- (289, 'Crossover', 3000, 0),
- (290, 'Contemporary C', 3000, 0),
- (291, 'Christian Rock', 3000, 0),
- (292, 'Merengue', 3000, 0),
- (293, 'Salsa', 3000, 0),
- (294, 'Thrash Metal', 3000, 0),
- (295, 'Anime', 3000, 0),
- (296, 'JPop', 3000, 0),
- (297, 'SynthPop', 3000, 0),
- (298, 'Electronica', 3000, 0),
- (299, 'World Music', 3000, 0),
- (300, 'Miscellaneous', 3000, 0),
- (301, 'Rap & Hip-Hop', 3000, 0),
- (302, 'Dance & Electronic', 3000, 0),
- (303, 'Adventure', 1000, 0),
- (304, 'Hard Rock & Metal', 3000, 0),
- (305, 'Broadway & Vocalists', 3000, 0),
- (306, 'Unknown', 1000, 0),
- (307, 'Christian & Gospel', 3000, 0),
- (308, '', 3000, 0),
- (309, 'Action', 1000, 0),
- (310, 'Unknown', 4000, 0),
- (311, 'Action', 4000, 0),
- (312, 'Strategy', 4000, 0),
- (313, 'Puzzle', 4000, 0),
- (314, 'Adventure', 4000, 0),
- (315, 'Sports', 4000, 0),
- (316, 'Simulation', 4000, 0),
- (317, 'Anal', 6000, 0),
- (318, 'Big Butt', 6000, 0),
- (319, 'Gonzo', 6000, 0),
- (320, 'Oiled', 6000, 0),
- (321, 'Widescreen', 6000, 0),
- (322, '18+ Teens', 6000, 0),
- (323, 'Big Cocks', 6000, 0),
- (324, 'Blu-Ray', 6000, 0),
- (325, 'Feature', 6000, 0),
- (326, 'Prison', 6000, 0),
- (327, 'All Sex', 6000, 0),
- (328, 'Couples', 6000, 0),
- (329, 'European', 6000, 0),
- (330, 'Foreign', 6000, 0),
- (331, 'Point Of View', 6000, 0),
- (332, 'Threesomes', 6000, 0),
- (333, 'College', 6000, 0),
- (334, 'Teachers', 6000, 0),
- (335, 'Older Men', 6000, 0),
- (336, 'Rimming', 6000, 0),
- (337, 'Glory Hole', 6000, 0),
- (338, 'Blowjobs', 6000, 0),
- (339, 'Big Budget', 6000, 0),
- (340, 'Gaping', 6000, 0),
- (341, 'Sex Toy Play', 6000, 0),
- (342, 'Cumshots', 6000, 0),
- (343, 'Gangbang', 6000, 0),
- (344, 'Fetish', 6000, 0),
- (345, 'Transsexual', 6000, 0),
- (346, 'Big Boobs', 6000, 0),
- (347, 'Mature', 6000, 0),
- (348, 'MILF', 6000, 0),
- (349, 'All Girl / Lesbian', 6000, 0),
- (350, 'Interracial', 6000, 0),
- (351, 'Orgy', 6000, 0),
- (352, '18+ Teen Transsexuals', 6000, 0),
- (353, 'Babysitter', 6000, 0),
- (354, 'Amateur', 6000, 0),
- (355, 'Public Sex', 6000, 0),
- (356, 'Web-To-DVD', 6000, 0),
- (357, 'Compilation', 6000, 0),
- (358, 'Porn For Couples', 6000, 0),
- (359, 'Romance', 6000, 0),
- (360, 'Young (18+) Ladies', 6000, 0),
- (361, 'Redheads', 6000, 0),
- (362, 'Affairs/Love Triangles', 6000, 0),
- (363, 'Women Directors', 6000, 0),
- (364, 'Made For Women', 6000, 0),
- (365, 'Pantyhose/Stocking', 6000, 0),
- (366, 'Black', 6000, 0),
- (367, 'Domination', 6000, 0),
- (368, 'Face Sitting', 6000, 0),
- (369, 'Female Domination', 6000, 0),
- (370, 'Interactive', 6000, 0),
- (371, 'Bi-Sexual', 6000, 0),
- (372, 'Tit Fucking', 6000, 0),
- (373, 'Anal Sex', 6000, 0),
- (374, 'Big Pussies', 6000, 0),
- (375, 'Cock & Ball Play', 6000, 0),
- (376, 'Facials', 6000, 0),
- (377, 'Finger Fucking', 6000, 0),
- (378, 'Girl-Girl/Lesbian', 6000, 0),
- (379, 'Nipple Play', 6000, 0),
- (380, 'xtreme', 6000, 0),
- (381, 'Canadian', 6000, 0),
- (382, 'Black Hair', 6000, 0),
- (383, 'Blondes', 6000, 0),
- (384, 'Brunettes', 6000, 0),
- (385, 'Cream Pie', 6000, 0),
- (386, 'Latex/Rubber', 6000, 0),
- (387, 'S&M', 6000, 0),
- (388, 'Watersports', 6000, 0),
- (389, 'BBW', 6000, 0),
- (390, 'Prebooks', 6000, 0),
- (391, 'Asian', 6000, 0),
- (392, 'Massage', 6000, 0),
- (393, 'Swallowing', 6000, 0),
- (394, 'Small Tits', 6000, 0),
- (395, 'Naturally Busty', 6000, 0),
- (396, 'Affairs & Love Triangles', 6000, 0),
- (397, 'Wives', 6000, 0),
- (398, 'Swingers', 6000, 0),
- (399, 'Old & Young Females (18+)', 6000, 0),
- (400, 'Maid', 6000, 0),
- (401, 'Pantyhose & Stocking', 6000, 0),
- (402, 'Masturbation', 6000, 0),
- (403, 'Alt Girls', 6000, 0),
- (404, 'Tattoo', 6000, 0),
- (405, 'Exotic Workouts', 6000, 0),
- (406, 'Athletes', 6000, 0),
- (407, 'Deep Throat', 6000, 0),
- (408, 'Wrestling & Fighting', 6000, 0),
- (409, 'Cheerleaders', 6000, 0),
- (410, 'Home Made Movies', 6000, 0),
- (411, 'Squirting', 6000, 0),
- (412, 'Cuckolds', 6000, 0),
- (413, 'Cougars', 6000, 0),
- (414, 'Cosplay', 6000, 0),
- (415, 'Bikini Babes', 6000, 0),
- (416, 'Brazilian', 6000, 0),
- (417, 'Grannies', 6000, 0),
- (418, 'Erotic Vignette', 6000, 0),
- (419, 'Water Play', 6000, 0),
- (420, 'Hairy', 6000, 0),
- (421, 'CFNM', 6000, 0),
- (422, 'Stripping', 6000, 0),
- (423, 'Double Penetration', 6000, 0),
- (424, 'Lingerie', 6000, 0),
- (425, 'Nurses & Doctors', 6000, 0),
- (426, 'British', 6000, 0),
- (427, 'Fetish Wear', 6000, 0),
- (428, 'Strap-Ons', 6000, 0),
- (429, 'Indian', 6000, 0),
- (430, 'Spoofs & Parodies', 6000, 0),
- (431, 'Pregnant', 6000, 0),
- (432, 'Classic', 6000, 0),
- (433, 'Jeans & Denim', 6000, 0),
- (434, 'Boxed Sets', 6000, 0),
- (435, 'Mystery', 6000, 0),
- (436, 'Girl on Guy Strap-Ons', 6000, 0),
- (437, 'Celebrity', 6000, 0),
- (438, 'Handjobs', 6000, 0),
- (439, 'Shaved', 6000, 0),
- (440, 'Vampires', 6000, 0),
- (441, 'Panties & Thongs', 6000, 0),
- (442, 'Instructional (X-Rated)', 6000, 0),
- (443, 'Fantasy', 6000, 0),
- (444, 'Historical / Period Piece', 6000, 0),
- (445, 'Western', 6000, 0),
- (446, 'Midgets', 6000, 0),
- (447, 'Oddities', 6000, 0),
- (448, 'Foot Fetish', 6000, 0),
- (449, 'Virgin', 6000, 0),
- (450, 'Horror', 6000, 0),
- (451, 'Streaming Video', 6000, 0),
- (452, 'Solo Girls', 6000, 0),
- (453, 'Solo Female', 6000, 0),
- (454, 'Kinky', 6000, 0),
- (455, 'By Women', 6000, 0),
- (456, 'All Girl', 6000, 0),
- (457, 'Exhibitionism', 6000, 0),
- (458, 'College Co-Eds', 6000, 0),
- (459, 'Pro-Am', 6000, 0),
- (460, 'Parties / Clubs', 6000, 0),
- (461, 'Sex', 6000, 0),
- (462, 'Europe', 6000, 0),
- (463, 'Germany', 6000, 0),
- (464, 'Tantra / Spirituality', 6000, 0),
- (465, 'Big Tits', 6000, 0),
- (466, 'United Kingdom', 6000, 0),
- (467, 'Female on Female', 6000, 0),
- (468, 'Strapons', 6000, 0),
- (469, 'Lesbian', 6000, 0),
- (470, 'Potpourri', 6000, 0),
- (471, 'Humor', 6000, 0),
- (472, 'Spoofs / Parodies', 6000, 0),
- (473, 'Gagging', 6000, 0),
- (474, 'Family', 6000, 0),
- (475, 'Vignettes', 6000, 0),
- (476, 'Body', 6000, 0),
- (477, 'Home Made', 6000, 0),
- (478, 'POV', 6000, 0),
- (479, 'M on F', 6000, 0),
- (480, 'Gaper', 6000, 0),
- (481, 'Latex & Rubber', 6000, 0),
- (482, 'Foreign Kink', 6000, 0),
- (483, 'Masks', 6000, 0),
- (484, 'Group Sex', 6000, 0),
- (485, 'Older Women', 6000, 0),
- (486, 'Young Women / Teens', 6000, 0),
- (487, 'Contemporary', 6000, 0),
- (488, 'Features', 6000, 0),
- (489, 'Biker Chicks', 6000, 0),
- (490, 'Hetero Couples', 6000, 0),
- (491, 'Caucasian Girls', 6000, 0),
- (492, 'Modern', 6000, 0),
- (493, '2011 AVN Award Nominees', 6000, 0),
- (494, 'All Black', 6000, 0),
- (495, 'Cumshots & Facials', 6000, 0),
- (496, 'Outdoors', 6000, 0),
- (497, 'Classics', 6000, 0),
- (498, 'BDSM', 6000, 0),
- (499, '90''s', 6000, 0),
- (500, 'Oral', 6000, 0),
- (501, 'Mixed Races', 6000, 0),
- (502, 'Ebony Girls', 6000, 0),
- (503, 'Black Women', 6000, 0),
- (504, 'Striptease', 6000, 0),
- (505, 'Dancers / Strippers', 6000, 0),
- (506, '2013 AVN Award Nominees', 6000, 0),
- (507, '2013 Sex Awards Nominees', 6000, 0),
- (508, 'Cunnilingus', 6000, 0),
- (509, 'Asian Girls', 6000, 0),
- (510, 'Erotica', 6000, 0),
- (511, 'Fantasies', 6000, 0),
- (512, 'Black Men', 6000, 0),
- (513, 'Latina', 6000, 0),
- (514, 'Latina Girls', 6000, 0),
- (515, 'Cuckold', 6000, 0),
- (516, 'Natural Look', 6000, 0),
- (517, 'Footjobs', 6000, 0),
- (518, 'Feet', 6000, 0),
- (519, 'Feet & Shoes', 6000, 0),
- (520, 'Legs & Nylons', 6000, 0),
- (521, 'Teen', 6000, 0),
- (522, 'Russia', 6000, 0),
- (523, 'Russian', 6000, 0),
- (524, 'Schoolgirls', 6000, 0),
- (525, 'Massage Parlor', 6000, 0),
- (526, 'Virgins', 6000, 0),
- (527, 'Beach', 6000, 0),
- (528, '2008 AVN Award Nominees', 6000, 0),
- (529, 'Czech', 6000, 0),
- (530, 'Orgies', 6000, 0),
- (531, 'Babysitters', 6000, 0),
- (532, '2009 AVN Award Nominees', 6000, 0),
- (533, 'Big Butts', 6000, 0),
- (534, 'Handjob Female on Male', 6000, 0),
- (535, 'Hidden Cam', 6000, 0),
- (536, '2014 AVN Award Nominees', 6000, 0),
- (537, 'XBIZ Awards', 6000, 0),
- (538, 'Spain', 6000, 0),
- (539, 'Spanish', 6000, 0),
- (540, 'Feminist Porn Awards', 6000, 0),
- (541, 'Sybian', 6000, 0),
- (542, 'Instructional', 6000, 0),
- (543, 'Female Ejaculation', 6000, 0),
- (544, 'Dutch', 6000, 0),
- (545, 'Maids', 6000, 0),
- (546, 'Tattooed / Pierced', 6000, 0),
- (547, 'Shower / Bathroom', 6000, 0),
- (548, 'Cum-Swapping', 6000, 0),
- (549, 'Girls Next Door', 6000, 0),
- (550, 'Petite', 6000, 0),
- (551, 'Gangbang - M on F', 6000, 0),
- (552, 'Office', 6000, 0),
- (553, 'Toys', 6000, 0),
- (554, '2010 AVN Award Nominees', 6000, 0),
- (555, 'International', 6000, 0),
- (556, 'Student', 6000, 0),
- (557, 'Deep Throating', 6000, 0),
- (558, 'Boat', 6000, 0),
- (559, 'Secretaries', 6000, 0),
- (560, 'Reality', 6000, 0),
- (561, 'Brazil', 6000, 0),
- (562, 'Male on Female', 6000, 0),
- (563, 'Nurses', 6000, 0),
- (564, 'Interactive Sex', 6000, 0),
- (565, 'Up & Coming', 6000, 0),
- (566, 'Cum Swapping', 6000, 0),
- (567, 'Multi-Angles', 6000, 0),
- (568, 'Leather', 6000, 0),
- (569, 'Pot Luck', 6000, 0),
- (570, 'Cream Pies', 6000, 0),
- (571, 'Behind The Scenes', 6000, 0),
- (572, 'Auditions', 6000, 0),
- (573, 'Pickup', 6000, 0),
- (574, 'Sex Machines', 6000, 0),
- (575, '2012 AVN Award Nominees', 6000, 0),
- (576, 'Voyeurism', 6000, 0),
- (577, 'Voyeur', 6000, 0),
- (578, 'Bukkake', 6000, 0),
- (579, 'Smoking', 6000, 0),
- (580, 'Gangbang - F on F', 6000, 0),
- (581, 'Italy', 6000, 0),
- (582, 'Italian', 6000, 0),
- (583, 'Portuguese', 6000, 0),
- (584, 'Locale', 6000, 0),
- (585, 'Secretaries/Office', 6000, 0),
- (586, 'Sex at Work', 6000, 0),
- (587, 'School Girls', 6000, 0),
- (588, 'Felching', 6000, 0),
- (589, 'Glasses', 6000, 0),
- (590, 'Euro', 6000, 0),
- (591, 'Pissing', 6000, 0),
- (592, 'Shocking Penetration', 6000, 0),
- (593, 'German Speaking', 6000, 0),
- (594, 'Anilingus', 6000, 0),
- (595, 'High Definition', 6000, 0),
- (596, 'M.I.L.F.', 6000, 0),
- (597, 'Cougar', 6000, 0),
- (598, 'Big Dick', 6000, 0),
- (599, 'Cumshot', 6000, 0),
- (600, 'Pantyhose/Stockings', 6000, 0),
- (601, 'Dancers/Models', 6000, 0),
- (602, 'Submales', 6000, 0),
- (603, 'Threeway', 6000, 0),
- (604, 'Fresh Faces', 6000, 0),
- (605, 'Natural Breasts', 6000, 0),
- (606, 'German', 6000, 0),
- (607, 'Blowjob', 6000, 0),
- (608, 'Gloryhole', 6000, 0),
- (609, 'Black Dicks/White Chicks', 6000, 0),
- (610, 'P.O.V.', 6000, 0),
- (611, 'Glamour', 6000, 0),
- (612, 'Brides & Weddings', 6000, 0),
- (613, 'Exhibitionist', 6000, 0),
- (614, 'Party Girls', 6000, 0),
- (615, 'Reality Based', 6000, 0),
- (616, 'Shemale', 6000, 0),
- (617, 'Cheerleader', 6000, 0),
- (618, 'Award Winning Movies', 6000, 0),
- (619, 'New Release', 6000, 0),
- (620, 'Foot', 6000, 0),
- (621, 'Older / Younger', 6000, 0),
- (622, 'Vintage', 6000, 0),
- (623, 'Incest', 6000, 0),
- (624, 'Femdom', 6000, 0),
- (625, 'Strap-On', 6000, 0),
- (626, 'Double Anal', 6000, 0),
- (627, 'Costumes', 6000, 0),
- (628, 'For Ladies', 6000, 0),
- (629, 'Family Roleplay', 6000, 0),
- (630, 'Girls With Toys', 6000, 0),
- (631, 'Ass-to-mouth', 6000, 0),
- (632, 'Parody', 6000, 0),
- (633, 'Racing', 4000, 0),
- (634, 'Double Penetration (Dp)', 6000, 0);
-
-DROP TABLE IF EXISTS shortgroups;
-CREATE TABLE shortgroups (
- id INT(11) NOT NULL AUTO_INCREMENT,
- name VARCHAR(255) NOT NULL DEFAULT "",
- first_record BIGINT UNSIGNED NOT NULL DEFAULT "0",
- last_record BIGINT UNSIGNED NOT NULL DEFAULT "0",
- updated DATETIME DEFAULT NULL,
- PRIMARY KEY (id)
-)
- ENGINE =InnoDB
- DEFAULT CHARACTER SET utf8
- COLLATE utf8_unicode_ci
- AUTO_INCREMENT =1;
-
-CREATE INDEX ix_shortgroups_id ON shortgroups (id);
-CREATE INDEX ix_shortgroups_name ON shortgroups (name);
-
-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'
-)
- ENGINE =INNODB
- DEFAULT CHARACTER SET utf8
- COLLATE utf8_unicode_ci
- AUTO_INCREMENT =100000;
-
-INSERT INTO category (id, title) VALUES (1000, 'Console');
-INSERT INTO category (id, title) VALUES (2000, 'Movies');
-INSERT INTO category (id, title) VALUES (3000, 'Audio');
-INSERT INTO category (id, title) VALUES (4000, 'PC');
-INSERT INTO category (id, title) VALUES (5000, 'TV');
-INSERT INTO category (id, title) VALUES (6000, 'XXX');
-INSERT INTO category (id, title) VALUES (7000, 'Books');
-INSERT INTO category (id, title) VALUES (8000, 'Other');
-
-INSERT INTO category (id, title, parentid) VALUES (1010, 'NDS', 1000);
-INSERT INTO category (id, title, parentid) VALUES (1020, 'PSP', 1000);
-INSERT INTO category (id, title, parentid) VALUES (1030, 'Wii', 1000);
-INSERT INTO category (id, title, parentid) VALUES (1040, 'Xbox', 1000);
-INSERT INTO category (id, title, parentid) VALUES (1050, 'Xbox 360', 1000);
-INSERT INTO category (id, title, parentid) VALUES (1060, 'WiiWare/VC', 1000);
-INSERT INTO category (id, title, parentid) VALUES (1070, 'XBOX 360 DLC', 1000);
-INSERT INTO category (id, title, parentid) VALUES (1080, 'PS3', 1000);
-INSERT INTO category (id, title, parentid) VALUES (1090, 'Other', 1000);
-INSERT INTO category (id, title, parentid) VALUES (1110, '3DS', 1000);
-INSERT INTO category (id, title, parentid) VALUES (1120, 'PS Vita', 1000);
-INSERT INTO category (id, title, parentid) VALUES (1130, 'WiiU', 1000);
-INSERT INTO category (id, title, parentid) VALUES (1140, 'Xbox One', 1000);
-INSERT INTO category (id, title, parentid) VALUES (1180, 'PS4', 1000);
-
-INSERT INTO category (id, title, parentid) VALUES (2010, 'Foreign', 2000);
-INSERT INTO category (id, title, parentid) VALUES (2020, 'Other', 2000);
-INSERT INTO category (id, title, parentid) VALUES (2030, 'SD', 2000);
-INSERT INTO category (id, title, parentid) VALUES (2040, 'HD', 2000);
-INSERT INTO category (id, title, parentid) VALUES (2050, '3D', 2000);
-INSERT INTO category (id, title, parentid) VALUES (2060, 'BluRay', 2000);
-INSERT INTO category (id, title, parentid) VALUES (2070, 'DVD', 2000);
-
-INSERT INTO category (id, title, parentid) VALUES (3010, 'MP3', 3000);
-INSERT INTO category (id, title, parentid) VALUES (3020, 'Video', 3000);
-INSERT INTO category (id, title, parentid) VALUES (3030, 'Audiobook', 3000);
-INSERT INTO category (id, title, parentid) VALUES (3040, 'Lossless', 3000);
-INSERT INTO category (id, title, parentid) VALUES (3050, 'Other', 3000);
-INSERT INTO category (id, title, parentid) VALUES (3060, 'Foreign', 3000);
-
-INSERT INTO category (id, title, parentid) VALUES (4010, '0day', 4000);
-INSERT INTO category (id, title, parentid) VALUES (4020, 'ISO', 4000);
-INSERT INTO category (id, title, parentid) VALUES (4030, 'Mac', 4000);
-INSERT INTO category (id, title, parentid) VALUES (4040, 'Mobile-Other', 4000);
-INSERT INTO category (id, title, parentid) VALUES (4050, 'Games', 4000);
-INSERT INTO category (id, title, parentid) VALUES (4060, 'Mobile-iOS', 4000);
-INSERT INTO category (id, title, parentid) VALUES (4070, 'Mobile-Android', 4000);
-
-INSERT INTO category (id, title, parentid) VALUES (5010, 'WEB-DL', 5000);
-INSERT INTO category (id, title, parentid) VALUES (5020, 'Foreign', 5000);
-INSERT INTO category (id, title, parentid) VALUES (5030, 'SD', 5000);
-INSERT INTO category (id, title, parentid) VALUES (5040, 'HD', 5000);
-INSERT INTO category (id, title, parentid) VALUES (5050, 'Other', 5000);
-INSERT INTO category (id, title, parentid) VALUES (5060, 'Sport', 5000);
-INSERT INTO category (id, title, parentid) VALUES (5070, 'Anime', 5000);
-INSERT INTO category (id, title, parentid) VALUES (5080, 'Documentary', 5000);
-
-INSERT INTO category (id, title, parentid) VALUES (6010, 'DVD', 6000);
-INSERT INTO category (id, title, parentid) VALUES (6020, 'WMV', 6000);
-INSERT INTO category (id, title, parentid) VALUES (6030, 'XviD', 6000);
-INSERT INTO category (id, title, parentid) VALUES (6040, 'x264', 6000);
-INSERT INTO category (id, title, parentid) VALUES (6050, 'Pack', 6000);
-INSERT INTO category (id, title, parentid) VALUES (6060, 'ImgSet', 6000);
-INSERT INTO category (id, title, parentid) VALUES (6070, 'Other', 6000);
-
-INSERT INTO category (id, title, parentid) VALUES (7010, 'Mags', 7000);
-INSERT INTO category (id, title, parentid) VALUES (7020, 'Ebook', 7000);
-INSERT INTO category (id, title, parentid) VALUES (7030, 'Comics', 7000);
-INSERT INTO category (id, title, parentid) VALUES (7040, 'Technical', 7000);
-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);
-
-DROP TABLE IF EXISTS sharing_sites;
-CREATE TABLE sharing_sites (
- id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
- site_name VARCHAR(255) NOT NULL DEFAULT '',
- site_guid VARCHAR(40) NOT NULL DEFAULT '',
- last_time DATETIME DEFAULT NULL,
- first_time DATETIME DEFAULT NULL,
- enabled TINYINT(1) NOT NULL DEFAULT '0',
- comments MEDIUMINT UNSIGNED NOT NULL DEFAULT '0',
- PRIMARY KEY (id)
-)
- ENGINE =InnoDB
- DEFAULT CHARACTER SET utf8
- COLLATE utf8_unicode_ci
- AUTO_INCREMENT =1;
-
-DROP TABLE IF EXISTS sharing;
-CREATE TABLE sharing (
- site_guid VARCHAR(40) NOT NULL DEFAULT '',
- site_name VARCHAR(255) NOT NULL DEFAULT '',
- enabled TINYINT(1) NOT NULL DEFAULT '0',
- posting TINYINT(1) NOT NULL DEFAULT '0',
- start_position TINYINT(1) NOT NULL DEFAULT '0',
- fetching TINYINT(1) NOT NULL DEFAULT '1',
- auto_enable TINYINT(1) NOT NULL DEFAULT '1',
- hide_users TINYINT(1) NOT NULL DEFAULT '1',
- last_article BIGINT UNSIGNED NOT NULL DEFAULT '0',
- max_push MEDIUMINT UNSIGNED NOT NULL DEFAULT '40',
- max_pull MEDIUMINT UNSIGNED NOT NULL DEFAULT '20000',
- max_download MEDIUMINT UNSIGNED NOT NULL DEFAULT '150',
- PRIMARY KEY (site_guid)
-)
- ENGINE =InnoDB
- DEFAULT CHARACTER SET utf8
- COLLATE utf8_unicode_ci;
-
-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 '';
-ALTER TABLE releasecomment ADD COLUMN text_hash VARCHAR(32) NOT NULL DEFAULT '';
-
-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`);
-
-DROP TABLE IF EXISTS predbhash;
-CREATE TABLE predbhash (
- pre_id INT(11) UNSIGNED NOT NULL DEFAULT 0,
- hashes VARCHAR(512) NOT NULL DEFAULT '',
- PRIMARY KEY (pre_id)
-)
- ENGINE =MYISAM
- ROW_FORMAT = DYNAMIC
- DEFAULT CHARSET =utf8mb4
- COLLATE =utf8mb4_unicode_ci;
-
-INSERT INTO predbhash (pre_id, hashes) (SELECT
- id,
- CONCAT_WS(',', MD5(title), MD5(MD5(title)), SHA1(title))
- FROM prehash);
-
-CREATE FULLTEXT INDEX ix_predbhash_hashes_ft ON predbhash (hashes);
-ALTER IGNORE TABLE predbhash ADD UNIQUE INDEX ix_predbhash_hashes (hashes(32));
-
-INSERT INTO menu (href, title, tooltip, role, ordinal)
-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
- ('categorizeforeign', '1'),
- ('catwebdl', '0'),
- ('giantbombkey', ''),
- ('lookupxxx', 1),
- ('maxxxxprocessed', 100),
- ('rottentomatoquality', 'profile'),
- ('anidbkey', '');
-
-ALTER TABLE animetitles CHANGE createddate unixtime INT(12) UNSIGNED NOT NULL;
-
-DROP TRIGGER IF EXISTS insert_hashes;
-
-DELIMITER $$
-CREATE TRIGGER insert_hashes AFTER INSERT ON prehash FOR EACH ROW BEGIN INSERT INTO predbhash (pre_id, hashes) VALUES (NEW.id, CONCAT_WS(',', MD5(NEW.title), MD5(MD5(NEW.title)), SHA1(NEW.title)));END;
-$$
-DELIMITER ;
-
-DROP TRIGGER IF EXISTS update_hashes;
-
-DELIMITER $$
-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;
-$$
-DELIMITER ;
-
-DROP TRIGGER IF EXISTS delete_hashes;
-
-DELIMITER $$
-CREATE TRIGGER delete_hashes AFTER DELETE ON prehash FOR EACH ROW BEGIN DELETE FROM predbhash WHERE pre_id = OLD.id; END;
-$$
-DELIMITER ;
-
-DROP TRIGGER IF EXISTS check_rfinsert;
-DROP TRIGGER IF EXISTS check_rfupdate;
-
-DELIMITER $$
-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;
-$$
-DELIMITER ;
-
-DROP TRIGGER IF EXISTS check_insert;
-DROP TRIGGER IF EXISTS check_update;
-
-DELIMITER $$
-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; 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;END IF;
-END;
-$$
-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;
-$$
-DELIMITER ;
-
-DROP TRIGGER IF EXISTS insert_MD5;
-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/lib/DB/mysqldump_tables.php b/lib/DB/mysqldump_tables.php
deleted file mode 100644
index b90073d6d..000000000
--- a/lib/DB/mysqldump_tables.php
+++ /dev/null
@@ -1,181 +0,0 @@
- 0) {
- //Percona only has --innodb-optimize-keys
- $exportopts = "--opt --innodb-optimize-keys --complete-insert --skip-quick";
-} else {
- //generic (or unknown) instance of MySQL
- $exportopts = "--opt --complete-insert --skip-quick";
-}
-
-
-function newname($filename)
-{
- rename($filename, dirname($filename)."/".basename($filename,".gz")."_".date("Y_m_d_His", filemtime($filename)).".gz");
-}
-
-function builddefaultsfile()
-{
- //generate file contents
- $filetext = "[mysqldump]"
- ."\n"
- ."user = " . DB_USER
- ."\n"
- ."password = " . DB_PASSWORD
- ."\n[mysql]"
- ."\n"
- ."user = " . DB_USER
- ."\n"
- ."password = " . DB_PASSWORD;
-
- $filehandle = fopen("mysql-defaults.txt", "w+");
- if(!$filehandle) {
- exit("Unable to write mysql defaults file! Exiting");
- } else {
- fwrite($filehandle, $filetext);
- fclose($filehandle);
- chmod("mysql-defaults.txt", 0600);
- }
-}
-
-$dbhost = DB_HOST;
-$dbport = DB_PORT;
-$dbsocket = DB_SOCKET;
-$dbuser = DB_USER;
-$dbpass = DB_PASSWORD;
-$dbname = DB_NAME;
-
-if (DB_SOCKET != '') {
- $use = "-S $dbsocket";
-} else {
- $use = "-P$dbport";
-}
-
-//generate defaults file used to store database login information so it is not in cleartext in ps command for mysqldump
-builddefaultsfile();
-
-if((isset($argv[1]) && $argv[1] == "db") && (isset($argv[2]) && $argv[2] == "dump") && (isset($argv[3]) && file_exists($argv[3]))) {
- $filename = $argv[3]."/".$dbname.".gz";
- echo $pdo->log->header("Dumping $dbname.");
- if (file_exists($filename)) {
- newname($filename);
- }
- $command = "mysqldump --defaults-file=mysql-defaults.txt $exportopts -h$dbhost $use "."$dbname | gzip -9 > $filename";
- system($command);
-} else if((isset($argv[1]) && $argv[1] == "db") && (isset($argv[2]) && $argv[2] == "restore") && (isset($argv[3]) && file_exists($argv[3]))) {
- $filename = $argv[3]."/".$dbname.".gz";
- if (file_exists($filename)) {
- echo $pdo->log->header("Restoring $dbname.");
- $command = "zcat < $filename | mysql --defaults-file=mysql-defaults.txt -h$dbhost $use $dbname";
- $pdo->queryExec("SET FOREIGN_KEY_CHECKS=0");
- system($command);
- $pdo->queryExec("SET FOREIGN_KEY_CHECKS=1");
- }
-} else if((isset($argv[1]) && $argv[1] == "all") && (isset($argv[2]) && $argv[2] == "dump") && (isset($argv[3]) && file_exists($argv[3]))) {
- $sql = "SHOW tables";
- $tables = $pdo->query($sql);
- foreach($tables as $row) {
- $tbl = $row['tables_in_'.DB_NAME];
- $filename = $argv[3]."/".$tbl.".gz";
- echo $pdo->log->header("Dumping $tbl.");
- if (file_exists($filename)) {
- newname($filename);
- }
- $command = "mysqldump --defaults-file=mysql-defaults.txt $exportopts -h$dbhost $use "."$dbname $tbl | gzip -9 > $filename";
- system($command);
- }
-} else if((isset($argv[1]) && $argv[1] == "all") && (isset($argv[2]) && $argv[2] == "restore") && (isset($argv[3]) && file_exists($argv[3]))) {
- $sql = "SHOW tables";
- $tables = $pdo->query($sql);
- $pdo->queryExec("SET FOREIGN_KEY_CHECKS=0");
- foreach($tables as $row) {
- $tbl = $row['tables_in_'.DB_NAME];
- $filename = $argv[3]."/".$tbl.".gz";
- if (file_exists($filename)) {
- echo $pdo->log->header("Restoring $tbl.");
- $command = "zcat < $filename | mysql --defaults-file=mysql-defaults.txt -h$dbhost $use $dbname";
- system($command);
- }
- }
- $pdo->queryExec("SET FOREIGN_KEY_CHECKS=1");
-} else if((isset($argv[1]) && $argv[1] == "test") && (isset($argv[2]) && $argv[2] == "dump") && (isset($argv[3]) && file_exists($argv[3]))) {
- $arr = array("parts", "binaries", "partrepair", "groups");
- foreach ($arr as &$tbl) {
- $filename = $argv[3]."/".$tbl.".gz";
- echo $pdo->log->header("Dumping $tbl..");
- if (file_exists($filename)) {
- newname($filename);
- }
- $command = "mysqldump --defaults-file=mysql-defaults.txt $exportopts -h$dbhost $use "."$dbname $tbl | gzip -9 > $filename";
- system($command);
- }
-} else if((isset($argv[1]) && $argv[1] == "test") && (isset($argv[2]) && $argv[2] == "restore") && (isset($argv[3]) && file_exists($argv[3]))) {
- $arr = array("parts", "binaries", "partrepair", "groups");
- $pdo->queryExec("SET FOREIGN_KEY_CHECKS=0");
- foreach ($arr as &$tbl) {
- $filename = $argv[3]."/".$tbl.".gz";
- if (file_exists($filename)) {
- echo $pdo->log->header("Restoring $tbl.");
- $command = "zcat < $filename | mysql --defaults-file=mysql-defaults.txt -h$dbhost $use $dbname";
- system($command);
- }
- }
- $pdo->queryExec("SET FOREIGN_KEY_CHECKS=1");
-} else if((isset($argv[1]) && $argv[1] == "all") && (isset($argv[2]) && $argv[2] == "outfile") && (isset($argv[3]) && file_exists($argv[3]))) {
- $sql = "SHOW tables";
- $tables = $pdo->query($sql);
- foreach($tables as $row) {
- $tbl = $row['tables_in_'.DB_NAME];
- $filename = $argv[3].$tbl.".csv";
- echo $pdo->log->header("Dumping $tbl.");
- if (file_exists($filename)) {
- newname($filename);
- }
- $pdo->queryDirect(sprintf("SELECT * INTO OUTFILE %s FROM %s", $pdo->escapeString($filename), $tbl));
- }
-} else if((isset($argv[1]) && $argv[1] == "all") && (isset($argv[2]) && $argv[2] == "infile") && (isset($argv[3]) && is_dir($argv[3]))) {
- $sql = "SHOW tables";
- $tables = $pdo->query($sql);
- $pdo->queryExec("SET FOREIGN_KEY_CHECKS=0");
- foreach($tables as $row) {
- $tbl = $row['tables_in_'.DB_NAME];
- $filename = $argv[3].$tbl.".csv";
- if (file_exists($filename)) {
- echo $pdo->log->header("Restoring $tbl.");
- $pdo->queryExec(sprintf("LOAD DATA INFILE %s INTO TABLE %s", $pdo->escapeString($filename), $tbl));
- }
- }
- $pdo->queryExec("SET FOREIGN_KEY_CHECKS=1");
-} else {
- passthru("clear");
- echo $pdo->log->error("\nThis script can dump/restore all tables, compressed or OUTFILE/INFILE, or just collections/binaries/parts.\n\n"
- . "**Single File\n"
- . "php $argv[0] db dump /path/to/save/to ...: To dump the database.\n"
- . "php $argv[0] db restore /path/to/restore/from ...: To restore the database.\n\n"
- . "**Individual Table Files\n"
- . "php $argv[0] all dump /path/to/save/to ...: To dump all tables.\n"
- . "php $argv[0] all restore /path/to/restore/from ...: To restore all tables.\n\n"
- . "**Two Tables (binaries, parts)\n"
- . "php $argv[0] test dump /path/to/save/to ...: To dump binaries, parts tables.\n"
- . "php $argv[0] test restore /path/to/restore/from ...: To restore binaries, parts tables.\n\n"
- . "**Individal Files - OUTFILE/INFILE - No schema\n"
- . "**MySQL MUST have write permissions to this path\n"
- . "php $argv[0] all outfile /path/to/save/to ...: To dump all tables, using OUTFILE.\n"
- . "php $argv[0] all infile /path/to/restore/from ...: To restore all tables, using INFILE.\n\n");
-}
-
-if(file_exists("mysql-defaults.txt")) {
- @unlink("mysql-defaults.txt");
-}
\ No newline at end of file
diff --git a/lib/DB/patchDB.php b/lib/DB/patchDB.php
deleted file mode 100644
index aa625e9b7..000000000
--- a/lib/DB/patchDB.php
+++ /dev/null
@@ -1,200 +0,0 @@
-prepare($query);
- $qry->execute();
- echo $c->alternateOver('SUCCESS: ') . $c->primary($query);
- } catch (PDOException $e) {
- if ($e->errorInfo[1] == 1091 || $e->errorInfo[1] == 1060 || $e->errorInfo[1] == 1054 || $e->errorInfo[1] == 1061 || $e->errorInfo[1] == 1062 || $e->errorInfo[1] == 1071 || $e->errorInfo[1] == 1072 || $e->errorInfo[1] == 1146 || $e->errorInfo[0] == 23505 || $e->errorInfo[0] == 42701 || $e->errorInfo[0] == 42703 || $e->errorInfo[0] == '42P07' || $e->errorInfo[0] == '42P16') {
- if ($e->errorInfo[1] == 1060) {
- echo $c->error($query . " The column already exists - Not Fatal {" . $e->errorInfo[1] . "}.\n");
- } else {
- echo $c->error($query . " Skipped - Not Fatal {" . $e->errorInfo[1] . "}.\n");
- }
- } else {
- if (preg_match('/ALTER IGNORE/i', $query)) {
- $db->queryExec("SET SESSION old_alter_table = 1");
- try {
- $qry = $db->prepare($query);
- $qry->execute();
- echo $c->alternateOver('SUCCESS: ') . $c->primary($query);
- } catch (PDOException $e) {
- exit($c->error($query . " Failed {" . $e->errorInfo[1] . "}\n\t" . $e->errorInfo[2]));
- }
- } else {
- exit($c->error($query . " Failed {" . $e->errorInfo[1] . "}\n\t" . $e->errorInfo[2]));
- }
- }
- }
-
- while (ob_get_level() > 0) {
- ob_end_flush();
- }
- flush();
- }
-
- if (is_string($query) === true) {
- $query = array();
- }
- }
- return fclose($file);
- } else {
- return false;
- }
- } else {
- return false;
- }
-}
-
-function BackupDatabase()
-{
- $db = new DB();
- $c = new ColorCLI();
- $DIR = dirname (__FILE__);
-
- if (Utility::hasCommand("php5")) {
- $PHP = "php5";
- } else {
- $PHP = "php";
- }
-
- //Backup based on database system
- if ($db->dbSystem() == "mysql") {
- system("$PHP ${DIR}mysqldump_tables.php db dump ../../");
- } else if ($db->dbSystem() == "pgsql") {
- exit($c->error("Currently not supported on this platform."));
- }
-}
-
-$os = (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') ? "windows" : "unix";
-
-if (isset($argv[1]) && $argv[1] == "safe") {
- $safeupgrade = true;
-} else {
- $safeupgrade = false;
-}
-
-if (isset($os) && $os == "unix") {
- $t = new Tmux();
- $tmux = $t->get();
- $currentversion = $tmux->sqlpatch;
- $patched = 0;
- $patches = array();
- $db = new DB();
- $backedup = false;
- $c = new ColorCLI();
- $DIR = dirname (__FILE__);
- $path = $DIR.'/patches/';
-
-
- // Open the patch folder.
- if ($handle = @opendir($path)) {
- while (false !== ($patch = readdir($handle))) {
- $patches[] = $patch;
- }
- closedir($handle);
- } else {
- exit($c->error("\nHave you changed the path to the patches folder, or do you have the right permissions?\n"));
- }
-
- /* if ($db->dbSystem() == "mysql")
- $patchpath = preg_replace('/\/misc\/testing\/DB/i', '/db/patches/mysql/',
- NN_ROOT);
- else if ($db->dbSystem() == "pgsql")
- $patchpath = preg_replace('/\/misc\/testing\/DB/i', '/db/patches/pgsql/', nZEDb_ROOT);
- */ sort($patches);
-
- foreach ($patches as $patch) {
- if (preg_match('/\.sql$/i', $patch)) {
- $filepath = $path . $patch;
- $file = fopen($filepath, "r");
- $patch = fread($file, filesize($filepath));
- if (preg_match('/UPDATE `?tmux`? SET `?value`? = \'?(\d{1,})\'? WHERE `?setting`? = \'sqlpatch\'/i', $patch, $patchnumber)) {
- if ($patchnumber['1'] > $currentversion) {
- if ($safeupgrade == true && $backedup == false) {
- BackupDatabase();
- $backedup = true;
- }
- SplitSQL($filepath);
- $patched++;
- }
- }
- }
- }
-} else if (isset($os) && $os == "windows") {
- $t = new Tmux();
- $tmux = $t->get();
- $currentversion = $tmux->sqlpatch;
- $patched = 0;
- $patches = array();
-
- // Open the patch folder.
- if (!isset($argv[1])) {
- exit($c->error("\nYou must supply the directory to the patches.\n"));
- }
- if ($handle = @opendir($argv[1])) {
- while (false !== ($patch = readdir($handle))) {
- $patches[] = $patch;
- }
- closedir($handle);
- } else {
- exit($c->error("\nHave you changed the path to the patches folder, or do you have the right permissions?\n"));
- }
-
- sort($patches);
- foreach ($patches as $patch) {
- if (preg_match('/\.sql$/i', $patch)) {
- $filepath = $argv[1] . $patch;
- $file = fopen($filepath, "r");
- $patch = fread($file, filesize($filepath));
- if (preg_match('/UPDATE `?tmux`? SET `?value`? = \'?(\d{1,})\'? WHERE `?setting`? = \'sqlpatch\'/i', $patch, $patchnumber)) {
- if ($patchnumber['1'] > $currentversion) {
- if ($safeupgrade == true && $backedup == false) {
- BackupDatabase();
- $backedup = true;
- }
- SplitSQL($filepath);
- $patched++;
- }
- }
- }
- }
-} else {
- exit($c->error("\nUnable to determine OS.\n"));
-}
-
-if ($patched == 0) {
- exit($c->info("Nothing to patch, you are already on patch version " . $currentversion));
-}
-if ($patched > 0) {
- echo $c->header($patched . " patch(es) applied.");
-}
\ No newline at end of file
diff --git a/lib/DB/patches/0001_tmux.sql b/lib/DB/patches/0001_tmux.sql
deleted file mode 100644
index 8de0a3a0f..000000000
--- a/lib/DB/patches/0001_tmux.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-DELETE FROM `tmux` WHERE `setting` = 'releases_threaded';
-
-UPDATE `tmux` set `value` = '1' where `setting` = 'sqlpatch';
\ No newline at end of file
diff --git a/lib/DB/patches/0002_tmux.sql b/lib/DB/patches/0002_tmux.sql
deleted file mode 100644
index 4a02cf8c8..000000000
--- a/lib/DB/patches/0002_tmux.sql
+++ /dev/null
@@ -1,11 +0,0 @@
-DELETE FROM `tmux` WHERE `setting` = 'collections_kill';
-DELETE FROM `tmux` WHERE `setting` = 'sorter';
-DELETE FROM `tmux` WHERE `setting` = 'sorter_timer';
-DELETE FROM `tmux` WHERE `setting` = 'optimize';
-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
diff --git a/lib/DB/patches/0004_tmux.sql b/lib/DB/patches/0004_tmux.sql
deleted file mode 100644
index 42b29a7e1..000000000
--- a/lib/DB/patches/0004_tmux.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-INSERT IGNORE INTO `tmux` (`setting`, `value`) VALUES ('partrepair', 1);
-
-UPDATE `tmux` set `value` = '4' where `setting` = 'sqlpatch';
\ No newline at end of file
diff --git a/lib/DB/patches/0005_releases.sql b/lib/DB/patches/0005_releases.sql
deleted file mode 100644
index 39a2cb88c..000000000
--- a/lib/DB/patches/0005_releases.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-ALTER TABLE `releases` DROP COLUMN `nzbstatus`;
-
-UPDATE `tmux` set `value` = '5' where `setting` = 'sqlpatch';
\ No newline at end of file
diff --git a/lib/DB/patches/0006_tmux.sql b/lib/DB/patches/0006_tmux.sql
deleted file mode 100644
index 5e6d12b05..000000000
--- a/lib/DB/patches/0006_tmux.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-INSERT IGNORE INTO `tmux` (`setting`, `value`) VALUES ('zippath', '');
-
-UPDATE `tmux` set `value` = '6' where `setting` = 'sqlpatch';
\ No newline at end of file
diff --git a/lib/DB/patches/0007_releases_tmux.sql b/lib/DB/patches/0007_releases_tmux.sql
deleted file mode 100644
index 9866eb087..000000000
--- a/lib/DB/patches/0007_releases_tmux.sql
+++ /dev/null
@@ -1,4 +0,0 @@
-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
diff --git a/lib/DB/patches/0008_releases.sql b/lib/DB/patches/0008_releases.sql
deleted file mode 100644
index df3af6e57..000000000
--- a/lib/DB/patches/0008_releases.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-ALTER TABLE `releases` ADD `prehashid` INT(12) NULL DEFAULT NULL;
-
-UPDATE `tmux` set `value` = '8' where `setting` = 'sqlpatch';
\ No newline at end of file
diff --git a/lib/DB/patches/0009_releases.sql b/lib/DB/patches/0009_releases.sql
deleted file mode 100644
index 912b67608..000000000
--- a/lib/DB/patches/0009_releases.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-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
diff --git a/lib/DB/patches/0010_releases.sql b/lib/DB/patches/0010_releases.sql
deleted file mode 100644
index a342cca19..000000000
--- a/lib/DB/patches/0010_releases.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-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
diff --git a/lib/DB/patches/0011_prehash.sql b/lib/DB/patches/0011_prehash.sql
deleted file mode 100644
index d3b69d8e1..000000000
--- a/lib/DB/patches/0011_prehash.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-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
diff --git a/lib/DB/patches/0012_prehash.sql b/lib/DB/patches/0012_prehash.sql
deleted file mode 100644
index 777c03ccb..000000000
--- a/lib/DB/patches/0012_prehash.sql
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Is this pre nuked? 0 no 1 yes 2 un nuked 3 mod nuked */
-ALTER TABLE prehash ADD COLUMN nuked TINYINT(1) NOT NULL DEFAULT '0';
-
-/* If this pre is nuked, what is the reason? */
-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
diff --git a/lib/DB/patches/0013_tmux.sql b/lib/DB/patches/0013_tmux.sql
deleted file mode 100644
index 3a88e5f8f..000000000
--- a/lib/DB/patches/0013_tmux.sql
+++ /dev/null
@@ -1,4 +0,0 @@
-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/lib/DB/patches/0014_prehash.sql b/lib/DB/patches/0014_prehash.sql
deleted file mode 100644
index 1ab9336ba..000000000
--- a/lib/DB/patches/0014_prehash.sql
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Drop the adddate index */
-ALTER TABLE prehash DROP INDEX ix_prehash_adddate;
-
-/* Drop the adddate column */
-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
diff --git a/lib/DB/patches/0015_sharing.sql b/lib/DB/patches/0015_sharing.sql
deleted file mode 100644
index beffbb203..000000000
--- a/lib/DB/patches/0015_sharing.sql
+++ /dev/null
@@ -1,34 +0,0 @@
-DROP TABLE IF EXISTS sharing_sites;
-CREATE TABLE sharing_sites (
- id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
- site_name VARCHAR(255) NOT NULL DEFAULT '',
- site_guid VARCHAR(40) NOT NULL DEFAULT '',
- last_time DATETIME DEFAULT NULL,
- first_time DATETIME DEFAULT NULL,
- enabled TINYINT(1) NOT NULL DEFAULT '0',
- comments MEDIUMINT UNSIGNED NOT NULL DEFAULT '0',
- PRIMARY KEY (id)
-) ENGINE=InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci AUTO_INCREMENT=1 ;
-
-DROP TABLE IF EXISTS sharing;
-CREATE TABLE sharing (
- site_guid VARCHAR(40) NOT NULL DEFAULT '',
- site_name VARCHAR(255) NOT NULL DEFAULT '',
- enabled TINYINT(1) NOT NULL DEFAULT '0',
- posting TINYINT(1) NOT NULL DEFAULT '0',
- start_position TINYINT(1) NOT NULL DEFAULT '0',
- fetching TINYINT(1) NOT NULL DEFAULT '1',
- auto_enable TINYINT(1) NOT NULL DEFAULT '1',
- hide_users TINYINT(1) NOT NULL DEFAULT '1',
- last_article BIGINT UNSIGNED NOT NULL DEFAULT '0',
- max_push MEDIUMINT UNSIGNED NOT NULL DEFAULT '40',
- max_pull INT UNSIGNED NOT NULL DEFAULT '200',
- PRIMARY KEY (site_guid)
-) ENGINE=InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ;
-
-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/lib/DB/patches/0016_tmux.sql b/lib/DB/patches/0016_tmux.sql
deleted file mode 100644
index 309827d83..000000000
--- a/lib/DB/patches/0016_tmux.sql
+++ /dev/null
@@ -1,4 +0,0 @@
-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/lib/DB/patches/0017_tmux.sql b/lib/DB/patches/0017_tmux.sql
deleted file mode 100644
index d8a05e83a..000000000
--- a/lib/DB/patches/0017_tmux.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-INSERT IGNORE INTO tmux (setting, value) VALUE ('sharing_timer', '60');
-
-UPDATE tmux SET value = '17' WHERE setting = 'sqlpatch';
diff --git a/lib/DB/patches/0018_sharing.sql b/lib/DB/patches/0018_sharing.sql
deleted file mode 100644
index 4987d9178..000000000
--- a/lib/DB/patches/0018_sharing.sql
+++ /dev/null
@@ -1,5 +0,0 @@
-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/lib/DB/patches/0019_sharing.sql b/lib/DB/patches/0019_sharing.sql
deleted file mode 100644
index 31bbd6f19..000000000
--- a/lib/DB/patches/0019_sharing.sql
+++ /dev/null
@@ -1,5 +0,0 @@
-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/lib/DB/patches/0020_tmux.sql b/lib/DB/patches/0020_tmux.sql
deleted file mode 100644
index d5ef2b670..000000000
--- a/lib/DB/patches/0020_tmux.sql
+++ /dev/null
@@ -1,6 +0,0 @@
-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
diff --git a/lib/DB/patches/0021_tmux.sql b/lib/DB/patches/0021_tmux.sql
deleted file mode 100644
index e85265b97..000000000
--- a/lib/DB/patches/0021_tmux.sql
+++ /dev/null
@@ -1,5 +0,0 @@
-DELETE FROM `tmux` WHERE `setting` = 'alternate_nntp';
-
-
-
-UPDATE `tmux` set `value` = '21' where `setting` = 'sqlpatch';
\ No newline at end of file
diff --git a/lib/DB/patches/0022_releases.sql b/lib/DB/patches/0022_releases.sql
deleted file mode 100644
index 83a028d39..000000000
--- a/lib/DB/patches/0022_releases.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-ALTER TABLE `releases` ADD INDEX `ix_releases_releasenfoID` (`releasenfoid`);
-
-UPDATE `tmux` set `value` = '22' where `setting` = 'sqlpatch';
\ No newline at end of file
diff --git a/lib/DB/patches/0023_tmux.sql b/lib/DB/patches/0023_tmux.sql
deleted file mode 100644
index 9e1d36d31..000000000
--- a/lib/DB/patches/0023_tmux.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-INSERT IGNORE INTO tmux (setting, value) VALUE ('fanarttvkey', '');
-
-UPDATE tmux SET value = '23' WHERE setting = 'sqlpatch';
diff --git a/lib/DB/patches/0024_tmux.sql b/lib/DB/patches/0024_tmux.sql
deleted file mode 100644
index f93fc6039..000000000
--- a/lib/DB/patches/0024_tmux.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-INSERT IGNORE INTO tmux (setting, value) VALUE ('imdburl', '0');
-
-UPDATE tmux SET value = '24' WHERE setting = 'sqlpatch';
diff --git a/lib/DB/patches/0025_tmux.sql b/lib/DB/patches/0025_tmux.sql
deleted file mode 100644
index 175d3c8ca..000000000
--- a/lib/DB/patches/0025_tmux.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-INSERT IGNORE INTO tmux (setting, value) VALUE ('yydecoderpath', '');
-
-UPDATE tmux SET value = '25' WHERE setting = 'sqlpatch';
diff --git a/lib/DB/patches/0026_tmux.sql b/lib/DB/patches/0026_tmux.sql
deleted file mode 100644
index aa39cae34..000000000
--- a/lib/DB/patches/0026_tmux.sql
+++ /dev/null
@@ -1,9 +0,0 @@
-INSERT IGNORE INTO tmux (setting, value) VALUE ('ffmpeg_duration', '5');
-INSERT IGNORE INTO tmux (setting, VALUE) VALUE ('ffmpeg_image_time', '5');
-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/lib/DB/patches/0027_prehash.sql b/lib/DB/patches/0027_prehash.sql
deleted file mode 100644
index 6e0a1ab49..000000000
--- a/lib/DB/patches/0027_prehash.sql
+++ /dev/null
@@ -1,9 +0,0 @@
-DELETE FROM prehash
-WHERE MD5(title) != MD5;
-ALTER TABLE prehash ADD COLUMN sha1 VARCHAR(40) NOT NULL DEFAULT '';
-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/lib/DB/patches/0028_tmux.sql b/lib/DB/patches/0028_tmux.sql
deleted file mode 100644
index acc51a8ee..000000000
--- a/lib/DB/patches/0028_tmux.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-INSERT IGNORE INTO tmux (setting, value) VALUE ('bins_kill_timer', '0');
-
-UPDATE tmux SET value = '28' WHERE setting = 'sqlpatch';
diff --git a/lib/DB/patches/0029_releases.sql b/lib/DB/patches/0029_releases.sql
deleted file mode 100644
index b7cb1a3fe..000000000
--- a/lib/DB/patches/0029_releases.sql
+++ /dev/null
@@ -1,11 +0,0 @@
-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`);
-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
diff --git a/lib/DB/patches/0030_tmux.sql b/lib/DB/patches/0030_tmux.sql
deleted file mode 100644
index 5dd7ee9b3..000000000
--- a/lib/DB/patches/0030_tmux.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-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
diff --git a/lib/DB/patches/0031_releases.sql b/lib/DB/patches/0031_releases.sql
deleted file mode 100644
index e6480beca..000000000
--- a/lib/DB/patches/0031_releases.sql
+++ /dev/null
@@ -1,4 +0,0 @@
-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
diff --git a/lib/DB/patches/0032_releases.sql b/lib/DB/patches/0032_releases.sql
deleted file mode 100644
index 366a02603..000000000
--- a/lib/DB/patches/0032_releases.sql
+++ /dev/null
@@ -1,9 +0,0 @@
-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
diff --git a/lib/DB/patches/0033_releases.sql b/lib/DB/patches/0033_releases.sql
deleted file mode 100644
index e984cbf24..000000000
--- a/lib/DB/patches/0033_releases.sql
+++ /dev/null
@@ -1,11 +0,0 @@
-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 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
diff --git a/lib/DB/patches/0034_tmux.sql b/lib/DB/patches/0034_tmux.sql
deleted file mode 100644
index 5f95fbfa8..000000000
--- a/lib/DB/patches/0034_tmux.sql
+++ /dev/null
@@ -1,5 +0,0 @@
-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/lib/DB/patches/0035_prehash.sql b/lib/DB/patches/0035_prehash.sql
deleted file mode 100644
index 42595436b..000000000
--- a/lib/DB/patches/0035_prehash.sql
+++ /dev/null
@@ -1,16 +0,0 @@
-ALTER TABLE `prehash` ADD COLUMN `filename` varchar(255) NOT NULL DEFAULT '';
-ALTER TABLE `prehash` ADD INDEX `ix_prehash_filename` (`filename`);
-ALTER TABLE `releasefiles` ADD COLUMN `ishashed` tinyint(1) NOT NULL DEFAULT '0' AFTER `size`;
-ALTER TABLE `releasefiles` ADD INDEX `ix_releasefiles_ishashed` (`ishashed`);
-
-DROP TRIGGER IF EXISTS check_rfinsert;
-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
diff --git a/lib/DB/patches/0036_tmux.sql b/lib/DB/patches/0036_tmux.sql
deleted file mode 100644
index ccfc891fe..000000000
--- a/lib/DB/patches/0036_tmux.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-DELETE FROM `tmux` WHERE `setting` = 'colors';
-
-UPDATE `tmux` SET value = '36' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
diff --git a/lib/DB/patches/0037_tmux.sql b/lib/DB/patches/0037_tmux.sql
deleted file mode 100644
index b0d053408..000000000
--- a/lib/DB/patches/0037_tmux.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-INSERT IGNORE INTO tmux (setting, value) VALUE ('run_sharing', '0');
-
-UPDATE `tmux` SET value = '37' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
diff --git a/lib/DB/patches/0038_releasesearch.sql b/lib/DB/patches/0038_releasesearch.sql
deleted file mode 100644
index 945470adf..000000000
--- a/lib/DB/patches/0038_releasesearch.sql
+++ /dev/null
@@ -1,25 +0,0 @@
-DROP TABLE IF EXISTS releasesearch;
-CREATE TABLE releasesearch (
- id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
- releaseid INT(11) UNSIGNED NOT NULL,
- guid VARCHAR(50) NOT NULL,
- name VARCHAR(255) NOT NULL DEFAULT '',
- searchname VARCHAR(255) NOT NULL DEFAULT '',
- PRIMARY KEY (id)
-) ENGINE =MyISAM DEFAULT CHARSET =utf8 COLLATE =utf8_unicode_ci AUTO_INCREMENT =1;
-
-CREATE FULLTEXT INDEX ix_releasesearch_name_searchname_ft ON releasesearch (name, searchname);
-CREATE INDEX ix_releasesearch_releaseid ON releasesearch (releaseid);
-CREATE INDEX ix_releasesearch_guid ON releasesearch (guid);
-
-ALTER TABLE `releases`
-ADD `proc_filenames` BIT NOT NULL DEFAULT 0;
-
-
-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;
-
-
-UPDATE `tmux` SET value = '38' WHERE `setting` = 'sqlpatch';
-
diff --git a/lib/DB/patches/0039_prehash.sql b/lib/DB/patches/0039_prehash.sql
deleted file mode 100644
index 99a472b83..000000000
--- a/lib/DB/patches/0039_prehash.sql
+++ /dev/null
@@ -1,5 +0,0 @@
-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
diff --git a/lib/DB/patches/0040_tmux.sql b/lib/DB/patches/0040_tmux.sql
deleted file mode 100644
index 612bcc906..000000000
--- a/lib/DB/patches/0040_tmux.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-INSERT IGNORE INTO tmux (setting, value) VALUE ('lastpretime', '0');
-
-UPDATE `tmux` SET value = '40' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
diff --git a/lib/DB/patches/0041_predbhash.sql b/lib/DB/patches/0041_predbhash.sql
deleted file mode 100644
index 12bb9c006..000000000
--- a/lib/DB/patches/0041_predbhash.sql
+++ /dev/null
@@ -1,45 +0,0 @@
-DROP TABLE IF EXISTS predbhash;
-CREATE TABLE predbhash (
- pre_id INT(11) UNSIGNED NOT NULL DEFAULT 0,
- hashes VARCHAR(512) NOT NULL DEFAULT '',
- PRIMARY KEY (pre_id)
-)
- ENGINE =MYISAM
- ROW_FORMAT = DYNAMIC
- DEFAULT CHARSET =utf8mb4
- COLLATE =utf8mb4_unicode_ci;
-
-INSERT INTO predbhash (pre_id, hashes) (SELECT
- id,
- CONCAT_WS(',', MD5(title), MD5(MD5(title)), SHA1(title))
- FROM prehash);
-
-CREATE FULLTEXT INDEX ix_predbhash_hashes_ft ON predbhash (hashes);
-ALTER IGNORE TABLE predbhash ADD UNIQUE INDEX ix_predbhash_hashes (hashes(32));
-
-DROP TRIGGER IF EXISTS insert_hashes;
-
-
-CREATE TRIGGER insert_hashes AFTER INSERT ON prehash FOR EACH ROW BEGIN INSERT INTO predbhash (pre_id, hashes)
-VALUES (NEW.id, CONCAT_WS(',', MD5(NEW.title), MD5(MD5(NEW.title)), SHA1(NEW.title)));
-END;
-
-
-
-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
diff --git a/lib/DB/patches/0042_predbhash.sql b/lib/DB/patches/0042_predbhash.sql
deleted file mode 100644
index 08aab0dc7..000000000
--- a/lib/DB/patches/0042_predbhash.sql
+++ /dev/null
@@ -1,4 +0,0 @@
-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
diff --git a/lib/DB/patches/0043_prehash.sql b/lib/DB/patches/0043_prehash.sql
deleted file mode 100644
index 98c0d8486..000000000
--- a/lib/DB/patches/0043_prehash.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-ALTER TABLE prehash DROP md5;
-ALTER TABLE prehash DROP sha1;
-UPDATE `tmux` SET value = '43' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
diff --git a/lib/DB/patches/0044_releasecomment.sql b/lib/DB/patches/0044_releasecomment.sql
deleted file mode 100644
index aa4733108..000000000
--- a/lib/DB/patches/0044_releasecomment.sql
+++ /dev/null
@@ -1,5 +0,0 @@
-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/lib/DB/patches/0045_prehash.sql b/lib/DB/patches/0045_prehash.sql
deleted file mode 100644
index 4137cfa0b..000000000
--- a/lib/DB/patches/0045_prehash.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-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
diff --git a/lib/DB/patches/0046_releasecomment.sql b/lib/DB/patches/0046_releasecomment.sql
deleted file mode 100644
index 881821860..000000000
--- a/lib/DB/patches/0046_releasecomment.sql
+++ /dev/null
@@ -1,7 +0,0 @@
-ALTER TABLE releasecomment ADD COLUMN text_hash VARCHAR(32) NOT NULL DEFAULT '';
-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
diff --git a/lib/DB/patches/0047_users.sql b/lib/DB/patches/0047_users.sql
deleted file mode 100644
index 6a45ae026..000000000
--- a/lib/DB/patches/0047_users.sql
+++ /dev/null
@@ -1,5 +0,0 @@
-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
diff --git a/lib/DB/patches/0049_site.sql b/lib/DB/patches/0049_site.sql
deleted file mode 100644
index e728599ae..000000000
--- a/lib/DB/patches/0049_site.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-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
diff --git a/lib/DB/patches/0050_category.sql b/lib/DB/patches/0050_category.sql
deleted file mode 100644
index 4575ba3ad..000000000
--- a/lib/DB/patches/0050_category.sql
+++ /dev/null
@@ -1,93 +0,0 @@
-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'
-)
- ENGINE =INNODB
- DEFAULT CHARACTER SET utf8
- COLLATE utf8_unicode_ci
- AUTO_INCREMENT =100000;
-
-INSERT INTO category (id, title) VALUES (1000, 'Console');
-INSERT INTO category (id, title) VALUES (2000, 'Movies');
-INSERT INTO category (id, title) VALUES (3000, 'Audio');
-INSERT INTO category (id, title) VALUES (4000, 'PC');
-INSERT INTO category (id, title) VALUES (5000, 'TV');
-INSERT INTO category (id, title) VALUES (6000, 'XXX');
-INSERT INTO category (id, title) VALUES (7000, 'Books');
-INSERT INTO category (id, title) VALUES (8000, 'Other');
-
-INSERT INTO category (id, title, parentid) VALUES (1010, 'NDS', 1000);
-INSERT INTO category (id, title, parentid) VALUES (1020, 'PSP', 1000);
-INSERT INTO category (id, title, parentid) VALUES (1030, 'Wii', 1000);
-INSERT INTO category (id, title, parentid) VALUES (1040, 'Xbox', 1000);
-INSERT INTO category (id, title, parentid) VALUES (1050, 'Xbox 360', 1000);
-INSERT INTO category (id, title, parentid) VALUES (1060, 'WiiWare/VC', 1000);
-INSERT INTO category (id, title, parentid) VALUES (1070, 'XBOX 360 DLC', 1000);
-INSERT INTO category (id, title, parentid) VALUES (1080, 'PS3', 1000);
-INSERT INTO category (id, title, parentid) VALUES (1090, 'Other', 1000);
-INSERT INTO category (id, title, parentid) VALUES (1110, '3DS', 1000);
-INSERT INTO category (id, title, parentid) VALUES (1120, 'PS Vita', 1000);
-INSERT INTO category (id, title, parentid) VALUES (1130, 'WiiU', 1000);
-INSERT INTO category (id, title, parentid) VALUES (1140, 'Xbox One', 1000);
-INSERT INTO category (id, title, parentid) VALUES (1180, 'PS4', 1000);
-
-INSERT INTO category (id, title, parentid) VALUES (2010, 'Foreign', 2000);
-INSERT INTO category (id, title, parentid) VALUES (2020, 'Other', 2000);
-INSERT INTO category (id, title, parentid) VALUES (2030, 'SD', 2000);
-INSERT INTO category (id, title, parentid) VALUES (2040, 'HD', 2000);
-INSERT INTO category (id, title, parentid) VALUES (2050, '3D', 2000);
-INSERT INTO category (id, title, parentid) VALUES (2060, 'BluRay', 2000);
-INSERT INTO category (id, title, parentid) VALUES (2070, 'DVD', 2000);
-INSERT INTO category (id, title, parentid) VALUES (2080, 'WEB-DL', 2000);
-
-INSERT INTO category (id, title, parentid) VALUES (3010, 'MP3', 3000);
-INSERT INTO category (id, title, parentid) VALUES (3020, 'Video', 3000);
-INSERT INTO category (id, title, parentid) VALUES (3030, 'Audiobook', 3000);
-INSERT INTO category (id, title, parentid) VALUES (3040, 'Lossless', 3000);
-INSERT INTO category (id, title, parentid) VALUES (3050, 'Other', 3000);
-INSERT INTO category (id, title, parentid) VALUES (3060, 'Foreign', 3000);
-
-INSERT INTO category (id, title, parentid) VALUES (4010, '0day', 4000);
-INSERT INTO category (id, title, parentid) VALUES (4020, 'ISO', 4000);
-INSERT INTO category (id, title, parentid) VALUES (4030, 'Mac', 4000);
-INSERT INTO category (id, title, parentid) VALUES (4040, 'Mobile-Other', 4000);
-INSERT INTO category (id, title, parentid) VALUES (4050, 'Games', 4000);
-INSERT INTO category (id, title, parentid) VALUES (4060, 'Mobile-iOS', 4000);
-INSERT INTO category (id, title, parentid) VALUES (4070, 'Mobile-Android', 4000);
-
-INSERT INTO category (id, title, parentid) VALUES (5010, 'WEB-DL', 5000);
-INSERT INTO category (id, title, parentid) VALUES (5020, 'Foreign', 5000);
-INSERT INTO category (id, title, parentid) VALUES (5030, 'SD', 5000);
-INSERT INTO category (id, title, parentid) VALUES (5040, 'HD', 5000);
-INSERT INTO category (id, title, parentid) VALUES (5050, 'Other', 5000);
-INSERT INTO category (id, title, parentid) VALUES (5060, 'Sport', 5000);
-INSERT INTO category (id, title, parentid) VALUES (5070, 'Anime', 5000);
-INSERT INTO category (id, title, parentid) VALUES (5080, 'Documentary', 5000);
-
-INSERT INTO category (id, title, parentid) VALUES (6010, 'DVD', 6000);
-INSERT INTO category (id, title, parentid) VALUES (6020, 'WMV', 6000);
-INSERT INTO category (id, title, parentid) VALUES (6030, 'XviD', 6000);
-INSERT INTO category (id, title, parentid) VALUES (6040, 'x264', 6000);
-INSERT INTO category (id, title, parentid) VALUES (6050, 'Pack', 6000);
-INSERT INTO category (id, title, parentid) VALUES (6060, 'ImgSet', 6000);
-INSERT INTO category (id, title, parentid) VALUES (6070, 'Other', 6000);
-
-INSERT INTO category (id, title, parentid) VALUES (7010, 'Mags', 7000);
-INSERT INTO category (id, title, parentid) VALUES (7020, 'Ebook', 7000);
-INSERT INTO category (id, title, parentid) VALUES (7030, 'Comics', 7000);
-INSERT INTO category (id, title, parentid) VALUES (7040, 'Technical', 7000);
-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
diff --git a/lib/DB/patches/0051_tmux.sql b/lib/DB/patches/0051_tmux.sql
deleted file mode 100644
index 286977e73..000000000
--- a/lib/DB/patches/0051_tmux.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-INSERT IGNORE INTO tmux (setting, value) VALUE ('minsizetopostprocess', '1');
-UPDATE `tmux` SET `value` = '51' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
diff --git a/lib/DB/patches/0052~gamesinfo.sql b/lib/DB/patches/0052~gamesinfo.sql
deleted file mode 100644
index 78da0f2df..000000000
--- a/lib/DB/patches/0052~gamesinfo.sql
+++ /dev/null
@@ -1,24 +0,0 @@
-DROP TABLE IF EXISTS gamesinfo;
-CREATE TABLE gamesinfo (
- id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
- title VARCHAR(255) NOT NULL,
- asin VARCHAR(128) DEFAULT NULL,
- url VARCHAR(1000) DEFAULT NULL,
- platform VARCHAR(255) DEFAULT NULL,
- publisher VARCHAR(255) DEFAULT NULL,
- genre_id INT(10) NULL DEFAULT NULL,
- esrb VARCHAR(255) NULL DEFAULT NULL,
- releasedate DATETIME DEFAULT NULL,
- review VARCHAR(3000) DEFAULT NULL,
- cover TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
- createddate DATETIME NOT NULL,
- updateddate DATETIME NOT NULL,
- PRIMARY KEY (id),
- UNIQUE INDEX ix_gamesinfo_asin (asin)
-)
- 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
diff --git a/lib/DB/patches/0053~site.sql b/lib/DB/patches/0053~site.sql
deleted file mode 100644
index cbd08d8a3..000000000
--- a/lib/DB/patches/0053~site.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-INSERT INTO `site` (`setting`, `value`) VALUES ('giantbombkey', '');
-UPDATE `tmux` SET `value` = '53' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
diff --git a/lib/DB/patches/0054~releases.sql b/lib/DB/patches/0054~releases.sql
deleted file mode 100644
index 948ea1e66..000000000
--- a/lib/DB/patches/0054~releases.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-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
diff --git a/lib/DB/patches/0055~users.sql b/lib/DB/patches/0055~users.sql
deleted file mode 100644
index 3856ff3b1..000000000
--- a/lib/DB/patches/0055~users.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-ALTER TABLE users ADD COLUMN gameview INT AFTER consoleview;
-UPDATE `tmux` SET `value` = '55' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
diff --git a/lib/DB/patches/0056~menu.sql b/lib/DB/patches/0056~menu.sql
deleted file mode 100644
index 267d4f9ed..000000000
--- a/lib/DB/patches/0056~menu.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-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
diff --git a/lib/DB/patches/0057~releases.sql b/lib/DB/patches/0057~releases.sql
deleted file mode 100644
index 32db0690f..000000000
--- a/lib/DB/patches/0057~releases.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-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
diff --git a/lib/DB/patches/0058~tmux.sql b/lib/DB/patches/0058~tmux.sql
deleted file mode 100644
index 3643d61ea..000000000
--- a/lib/DB/patches/0058~tmux.sql
+++ /dev/null
@@ -1,6 +0,0 @@
-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
diff --git a/lib/DB/patches/0059~users.sql b/lib/DB/patches/0059~users.sql
deleted file mode 100644
index b305d7cec..000000000
--- a/lib/DB/patches/0059~users.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-ALTER TABLE users ADD COLUMN xxxview INT AFTER gameview;
-UPDATE `tmux` set `value` = '59' where `setting` = 'sqlpatch';
\ No newline at end of file
diff --git a/lib/DB/patches/0060~xxxinfo.sql b/lib/DB/patches/0060~xxxinfo.sql
deleted file mode 100644
index d5e26e114..000000000
--- a/lib/DB/patches/0060~xxxinfo.sql
+++ /dev/null
@@ -1,27 +0,0 @@
-DROP TABLE IF EXISTS xxxinfo;
-CREATE TABLE xxxinfo (
- id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
- title VARCHAR(255) NOT NULL,
- tagline VARCHAR(1024) NOT NULL,
- plot BLOB NULL DEFAULT NULL,
- genre VARCHAR(64) NOT NULL,
- director VARCHAR(64) DEFAULT NULL,
- actors VARCHAR(2000) NOT NULL,
- extras TEXT DEFAULT NULL,
- productinfo TEXT DEFAULT NULL,
- trailers TEXT DEFAULT NULL,
- directurl VARCHAR(2000) NOT NULL,
- classused VARCHAR(3) NOT NULL,
- cover TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
- backdrop TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
- createddate DATETIME NOT NULL,
- updateddate DATETIME NOT NULL,
- PRIMARY KEY (id),
- INDEX ix_xxxinfo_title (title)
-)
- 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
diff --git a/lib/DB/patches/0061~releases.sql b/lib/DB/patches/0061~releases.sql
deleted file mode 100644
index 264095ede..000000000
--- a/lib/DB/patches/0061~releases.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-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
diff --git a/lib/DB/patches/0062~releases.sql b/lib/DB/patches/0062~releases.sql
deleted file mode 100644
index e56e93e72..000000000
--- a/lib/DB/patches/0062~releases.sql
+++ /dev/null
@@ -1,5 +0,0 @@
-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
diff --git a/lib/DB/patches/0063~site.sql b/lib/DB/patches/0063~site.sql
deleted file mode 100644
index af3fe2313..000000000
--- a/lib/DB/patches/0063~site.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-INSERT INTO `site` (`setting`, `value`) VALUES ('lookupxxx', 1);
-UPDATE `tmux` SET `value` = '63' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
diff --git a/lib/DB/patches/0064~site.sql b/lib/DB/patches/0064~site.sql
deleted file mode 100644
index abdc614f4..000000000
--- a/lib/DB/patches/0064~site.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-INSERT INTO `site` (`setting`, `value`) VALUES ('maxxxxprocessed', 100);
-UPDATE `tmux` SET `value` = '64' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
diff --git a/lib/DB/patches/0065~users.sql b/lib/DB/patches/0065~users.sql
deleted file mode 100644
index d7f9cb618..000000000
--- a/lib/DB/patches/0065~users.sql
+++ /dev/null
@@ -1,4 +0,0 @@
-
-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/lib/DB/patches/0066~genres.sql b/lib/DB/patches/0066~genres.sql
deleted file mode 100644
index ad313c0a4..000000000
--- a/lib/DB/patches/0066~genres.sql
+++ /dev/null
@@ -1,497 +0,0 @@
-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;
-
-INSERT IGNORE INTO `genres` (`id`, `title`, `type`, `disabled`) VALUES
-(150, 'Blues', 3000, 0),
-(151, 'Classic Rock', 3000, 0),
-(152, 'Country', 3000, 0),
-(153, 'Dance', 3000, 0),
-(154, 'Disco', 3000, 0),
-(155, 'Funk', 3000, 0),
-(156, 'Grunge', 3000, 0),
-(157, 'Hip-Hop', 3000, 0),
-(158, 'Jazz', 3000, 0),
-(159, 'Metal', 3000, 0),
-(160, 'New Age', 3000, 0),
-(161, 'Oldies', 3000, 0),
-(162, 'Other', 3000, 0),
-(163, 'Pop', 3000, 0),
-(164, 'R&B', 3000, 0),
-(165, 'Rap', 3000, 0),
-(166, 'Reggae', 3000, 0),
-(167, 'Rock', 3000, 0),
-(168, 'Techno', 3000, 0),
-(169, 'Industrial', 3000, 0),
-(170, 'Alternative', 3000, 0),
-(171, 'Ska', 3000, 0),
-(172, 'Death Metal', 3000, 0),
-(173, 'Pranks', 3000, 0),
-(174, 'Soundtrack', 3000, 0),
-(175, 'Euro-Techno', 3000, 0),
-(176, 'Ambient', 3000, 0),
-(177, 'Trip-Hop', 3000, 0),
-(178, 'Vocal', 3000, 0),
-(179, 'Jazz+Funk', 3000, 0),
-(180, 'Fusion', 3000, 0),
-(181, 'Trance', 3000, 0),
-(182, 'Classical', 3000, 0),
-(183, 'Instrumental', 3000, 0),
-(184, 'Acid', 3000, 0),
-(185, 'House', 3000, 0),
-(186, 'Game', 3000, 0),
-(187, 'Sound Clip', 3000, 0),
-(188, 'Gospel', 3000, 0),
-(189, 'Noise', 3000, 0),
-(190, 'Alternative Rock', 3000, 0),
-(191, 'Bass', 3000, 0),
-(192, 'Soul', 3000, 0),
-(193, 'Punk', 3000, 0),
-(194, 'Space', 3000, 0),
-(195, 'Meditative', 3000, 0),
-(196, 'Instrumental Pop', 3000, 0),
-(197, 'Instrumental Rock', 3000, 0),
-(198, 'Ethnic', 3000, 0),
-(199, 'Gothic', 3000, 0),
-(200, 'Darkwave', 3000, 0),
-(201, 'Techno-Industrial', 3000, 0),
-(202, 'Electronic', 3000, 0),
-(203, 'Pop-Folk', 3000, 0),
-(204, 'Eurodance', 3000, 0),
-(205, 'Dream', 3000, 0),
-(206, 'Southern Rock', 3000, 0),
-(207, 'Comedy', 3000, 0),
-(208, 'Cult', 3000, 0),
-(209, 'Gangsta', 3000, 0),
-(210, 'Top 40', 3000, 0),
-(211, 'Christian Rap', 3000, 0),
-(212, 'Pop/Funk', 3000, 0),
-(213, 'Jungle', 3000, 0),
-(214, 'Native US', 3000, 0),
-(215, 'Cabaret', 3000, 0),
-(216, 'New Wave', 3000, 0),
-(217, 'Psychadelic', 3000, 0),
-(218, 'Rave', 3000, 0),
-(219, 'Showtunes', 3000, 0),
-(220, 'Trailer', 3000, 0),
-(221, 'Lo-Fi', 3000, 0),
-(222, 'Tribal', 3000, 0),
-(223, 'Acid Punk', 3000, 0),
-(224, 'Acid Jazz', 3000, 0),
-(225, 'Polka', 3000, 0),
-(226, 'Retro', 3000, 0),
-(227, 'Musical', 3000, 0),
-(228, 'Rock & Roll', 3000, 0),
-(229, 'Hard Rock', 3000, 0),
-(230, 'Folk', 3000, 0),
-(231, 'Folk-Rock', 3000, 0),
-(232, 'National Folk', 3000, 0),
-(233, 'Swing', 3000, 0),
-(234, 'Fast Fusion', 3000, 0),
-(235, 'Bebob', 3000, 0),
-(236, 'Latin', 3000, 0),
-(237, 'Revival', 3000, 0),
-(238, 'Celtic', 3000, 0),
-(239, 'Bluegrass', 3000, 0),
-(240, 'Avantgarde', 3000, 0),
-(241, 'Gothic Rock', 3000, 0),
-(242, 'Progressive Rock', 3000, 0),
-(243, 'Psychedelic Rock', 3000, 0),
-(244, 'Symphonic Rock', 3000, 0),
-(245, 'Slow Rock', 3000, 0),
-(246, 'Big Band', 3000, 0),
-(247, 'Chorus', 3000, 0),
-(248, 'Easy Listening', 3000, 0),
-(249, 'Acoustic', 3000, 0),
-(250, 'Humour', 3000, 0),
-(251, 'Speech', 3000, 0),
-(252, 'Chanson', 3000, 0),
-(253, 'Opera', 3000, 0),
-(254, 'Chamber Music', 3000, 0),
-(255, 'Sonata', 3000, 0),
-(256, 'Symphony', 3000, 0),
-(257, 'Booty Bass', 3000, 0),
-(258, 'Primus', 3000, 0),
-(259, 'Porn Groove', 3000, 0),
-(260, 'Satire', 3000, 0),
-(261, 'Slow Jam', 3000, 0),
-(262, 'Club', 3000, 0),
-(263, 'Tango', 3000, 0),
-(264, 'Samba', 3000, 0),
-(265, 'Folklore', 3000, 0),
-(266, 'Ballad', 3000, 0),
-(267, 'Power Ballad', 3000, 0),
-(268, 'Rhytmic Soul', 3000, 0),
-(269, 'Freestyle', 3000, 0),
-(270, 'Duet', 3000, 0),
-(271, 'Punk Rock', 3000, 0),
-(272, 'Drum Solo', 3000, 0),
-(273, 'Acapella', 3000, 0),
-(274, 'Euro-House', 3000, 0),
-(275, 'Dance Hall', 3000, 0),
-(276, 'Goa', 3000, 0),
-(277, 'Drum & Bass', 3000, 0),
-(278, 'Club-House', 3000, 0),
-(279, 'Hardcore', 3000, 0),
-(280, 'Terror', 3000, 0),
-(281, 'Indie', 3000, 0),
-(282, 'BritPop', 3000, 0),
-(283, 'Negerpunk', 3000, 0),
-(284, 'Polsk Punk', 3000, 0),
-(285, 'Beat', 3000, 0),
-(286, 'Christian Gangsta', 3000, 0),
-(287, 'Heavy Metal', 3000, 0),
-(288, 'Black Metal', 3000, 0),
-(289, 'Crossover', 3000, 0),
-(290, 'Contemporary C', 3000, 0),
-(291, 'Christian Rock', 3000, 0),
-(292, 'Merengue', 3000, 0),
-(293, 'Salsa', 3000, 0),
-(294, 'Thrash Metal', 3000, 0),
-(295, 'Anime', 3000, 0),
-(296, 'JPop', 3000, 0),
-(297, 'SynthPop', 3000, 0),
-(298, 'Electronica', 3000, 0),
-(299, 'World Music', 3000, 0),
-(300, 'Miscellaneous', 3000, 0),
-(301, 'Rap & Hip-Hop', 3000, 0),
-(302, 'Dance & Electronic', 3000, 0),
-(303, 'Adventure', 1000, 0),
-(304, 'Hard Rock & Metal', 3000, 0),
-(305, 'Broadway & Vocalists', 3000, 0),
-(306, 'Unknown', 1000, 0),
-(307, 'Christian & Gospel', 3000, 0),
-(308, '', 3000, 0),
-(309, 'Action', 1000, 0),
-(310, 'Unknown', 4000, 0),
-(311, 'Action', 4000, 0),
-(312, 'Strategy', 4000, 0),
-(313, 'Puzzle', 4000, 0),
-(314, 'Adventure', 4000, 0),
-(315, 'Sports', 4000, 0),
-(316, 'Simulation', 4000, 0),
-(317, 'Anal', 6000, 0),
-(318, 'Big Butt', 6000, 0),
-(319, 'Gonzo', 6000, 0),
-(320, 'Oiled', 6000, 0),
-(321, 'Widescreen', 6000, 0),
-(322, '18+ Teens', 6000, 0),
-(323, 'Big Cocks', 6000, 0),
-(324, 'Blu-Ray', 6000, 0),
-(325, 'Feature', 6000, 0),
-(326, 'Prison', 6000, 0),
-(327, 'All Sex', 6000, 0),
-(328, 'Couples', 6000, 0),
-(329, 'European', 6000, 0),
-(330, 'Foreign', 6000, 0),
-(331, 'Point Of View', 6000, 0),
-(332, 'Threesomes', 6000, 0),
-(333, 'College', 6000, 0),
-(334, 'Teachers', 6000, 0),
-(335, 'Older Men', 6000, 0),
-(336, 'Rimming', 6000, 0),
-(337, 'Glory Hole', 6000, 0),
-(338, 'Blowjobs', 6000, 0),
-(339, 'Big Budget', 6000, 0),
-(340, 'Gaping', 6000, 0),
-(341, 'Sex Toy Play', 6000, 0),
-(342, 'Cumshots', 6000, 0),
-(343, 'Gangbang', 6000, 0),
-(344, 'Fetish', 6000, 0),
-(345, 'Transsexual', 6000, 0),
-(346, 'Big Boobs', 6000, 0),
-(347, 'Mature', 6000, 0),
-(348, 'MILF', 6000, 0),
-(349, 'All Girl / Lesbian', 6000, 0),
-(350, 'Interracial', 6000, 0),
-(351, 'Orgy', 6000, 0),
-(352, '18+ Teen Transsexuals', 6000, 0),
-(353, 'Babysitter', 6000, 0),
-(354, 'Amateur', 6000, 0),
-(355, 'Public Sex', 6000, 0),
-(356, 'Web-To-DVD', 6000, 0),
-(357, 'Compilation', 6000, 0),
-(358, 'Porn For Couples', 6000, 0),
-(359, 'Romance', 6000, 0),
-(360, 'Young (18+) Ladies', 6000, 0),
-(361, 'Redheads', 6000, 0),
-(362, 'Affairs/Love Triangles', 6000, 0),
-(363, 'Women Directors', 6000, 0),
-(364, 'Made For Women', 6000, 0),
-(365, 'Pantyhose/Stocking', 6000, 0),
-(366, 'Black', 6000, 0),
-(367, 'Domination', 6000, 0),
-(368, 'Face Sitting', 6000, 0),
-(369, 'Female Domination', 6000, 0),
-(370, 'Interactive', 6000, 0),
-(371, 'Bi-Sexual', 6000, 0),
-(372, 'Tit Fucking', 6000, 0),
-(373, 'Anal Sex', 6000, 0),
-(374, 'Big Pussies', 6000, 0),
-(375, 'Cock & Ball Play', 6000, 0),
-(376, 'Facials', 6000, 0),
-(377, 'Finger Fucking', 6000, 0),
-(378, 'Girl-Girl/Lesbian', 6000, 0),
-(379, 'Nipple Play', 6000, 0),
-(380, 'xtreme', 6000, 0),
-(381, 'Canadian', 6000, 0),
-(382, 'Black Hair', 6000, 0),
-(383, 'Blondes', 6000, 0),
-(384, 'Brunettes', 6000, 0),
-(385, 'Cream Pie', 6000, 0),
-(386, 'Latex/Rubber', 6000, 0),
-(387, 'S&M', 6000, 0),
-(388, 'Watersports', 6000, 0),
-(389, 'BBW', 6000, 0),
-(390, 'Prebooks', 6000, 0),
-(391, 'Asian', 6000, 0),
-(392, 'Massage', 6000, 0),
-(393, 'Swallowing', 6000, 0),
-(394, 'Small Tits', 6000, 0),
-(395, 'Naturally Busty', 6000, 0),
-(396, 'Affairs & Love Triangles', 6000, 0),
-(397, 'Wives', 6000, 0),
-(398, 'Swingers', 6000, 0),
-(399, 'Old & Young Females (18+)', 6000, 0),
-(400, 'Maid', 6000, 0),
-(401, 'Pantyhose & Stocking', 6000, 0),
-(402, 'Masturbation', 6000, 0),
-(403, 'Alt Girls', 6000, 0),
-(404, 'Tattoo', 6000, 0),
-(405, 'Exotic Workouts', 6000, 0),
-(406, 'Athletes', 6000, 0),
-(407, 'Deep Throat', 6000, 0),
-(408, 'Wrestling & Fighting', 6000, 0),
-(409, 'Cheerleaders', 6000, 0),
-(410, 'Home Made Movies', 6000, 0),
-(411, 'Squirting', 6000, 0),
-(412, 'Cuckolds', 6000, 0),
-(413, 'Cougars', 6000, 0),
-(414, 'Cosplay', 6000, 0),
-(415, 'Bikini Babes', 6000, 0),
-(416, 'Brazilian', 6000, 0),
-(417, 'Grannies', 6000, 0),
-(418, 'Erotic Vignette', 6000, 0),
-(419, 'Water Play', 6000, 0),
-(420, 'Hairy', 6000, 0),
-(421, 'CFNM', 6000, 0),
-(422, 'Stripping', 6000, 0),
-(423, 'Double Penetration', 6000, 0),
-(424, 'Lingerie', 6000, 0),
-(425, 'Nurses & Doctors', 6000, 0),
-(426, 'British', 6000, 0),
-(427, 'Fetish Wear', 6000, 0),
-(428, 'Strap-Ons', 6000, 0),
-(429, 'Indian', 6000, 0),
-(430, 'Spoofs & Parodies', 6000, 0),
-(431, 'Pregnant', 6000, 0),
-(432, 'Classic', 6000, 0),
-(433, 'Jeans & Denim', 6000, 0),
-(434, 'Boxed Sets', 6000, 0),
-(435, 'Mystery', 6000, 0),
-(436, 'Girl on Guy Strap-Ons', 6000, 0),
-(437, 'Celebrity', 6000, 0),
-(438, 'Handjobs', 6000, 0),
-(439, 'Shaved', 6000, 0),
-(440, 'Vampires', 6000, 0),
-(441, 'Panties & Thongs', 6000, 0),
-(442, 'Instructional (X-Rated)', 6000, 0),
-(443, 'Fantasy', 6000, 0),
-(444, 'Historical / Period Piece', 6000, 0),
-(445, 'Western', 6000, 0),
-(446, 'Midgets', 6000, 0),
-(447, 'Oddities', 6000, 0),
-(448, 'Foot Fetish', 6000, 0),
-(449, 'Virgin', 6000, 0),
-(450, 'Horror', 6000, 0),
-(451, 'Streaming Video', 6000, 0),
-(452, 'Solo Girls', 6000, 0),
-(453, 'Solo Female', 6000, 0),
-(454, 'Kinky', 6000, 0),
-(455, 'By Women', 6000, 0),
-(456, 'All Girl', 6000, 0),
-(457, 'Exhibitionism', 6000, 0),
-(458, 'College Co-Eds', 6000, 0),
-(459, 'Pro-Am', 6000, 0),
-(460, 'Parties / Clubs', 6000, 0),
-(461, 'Sex', 6000, 0),
-(462, 'Europe', 6000, 0),
-(463, 'Germany', 6000, 0),
-(464, 'Tantra / Spirituality', 6000, 0),
-(465, 'Big Tits', 6000, 0),
-(466, 'United Kingdom', 6000, 0),
-(467, 'Female on Female', 6000, 0),
-(468, 'Strapons', 6000, 0),
-(469, 'Lesbian', 6000, 0),
-(470, 'Potpourri', 6000, 0),
-(471, 'Humor', 6000, 0),
-(472, 'Spoofs / Parodies', 6000, 0),
-(473, 'Gagging', 6000, 0),
-(474, 'Family', 6000, 0),
-(475, 'Vignettes', 6000, 0),
-(476, 'Body', 6000, 0),
-(477, 'Home Made', 6000, 0),
-(478, 'POV', 6000, 0),
-(479, 'M on F', 6000, 0),
-(480, 'Gaper', 6000, 0),
-(481, 'Latex & Rubber', 6000, 0),
-(482, 'Foreign Kink', 6000, 0),
-(483, 'Masks', 6000, 0),
-(484, 'Group Sex', 6000, 0),
-(485, 'Older Women', 6000, 0),
-(486, 'Young Women / Teens', 6000, 0),
-(487, 'Contemporary', 6000, 0),
-(488, 'Features', 6000, 0),
-(489, 'Biker Chicks', 6000, 0),
-(490, 'Hetero Couples', 6000, 0),
-(491, 'Caucasian Girls', 6000, 0),
-(492, 'Modern', 6000, 0),
-(493, '2011 AVN Award Nominees', 6000, 0),
-(494, 'All Black', 6000, 0),
-(495, 'Cumshots & Facials', 6000, 0),
-(496, 'Outdoors', 6000, 0),
-(497, 'Classics', 6000, 0),
-(498, 'BDSM', 6000, 0),
-(499, '90''s', 6000, 0),
-(500, 'Oral', 6000, 0),
-(501, 'Mixed Races', 6000, 0),
-(502, 'Ebony Girls', 6000, 0),
-(503, 'Black Women', 6000, 0),
-(504, 'Striptease', 6000, 0),
-(505, 'Dancers / Strippers', 6000, 0),
-(506, '2013 AVN Award Nominees', 6000, 0),
-(507, '2013 Sex Awards Nominees', 6000, 0),
-(508, 'Cunnilingus', 6000, 0),
-(509, 'Asian Girls', 6000, 0),
-(510, 'Erotica', 6000, 0),
-(511, 'Fantasies', 6000, 0),
-(512, 'Black Men', 6000, 0),
-(513, 'Latina', 6000, 0),
-(514, 'Latina Girls', 6000, 0),
-(515, 'Cuckold', 6000, 0),
-(516, 'Natural Look', 6000, 0),
-(517, 'Footjobs', 6000, 0),
-(518, 'Feet', 6000, 0),
-(519, 'Feet & Shoes', 6000, 0),
-(520, 'Legs & Nylons', 6000, 0),
-(521, 'Teen', 6000, 0),
-(522, 'Russia', 6000, 0),
-(523, 'Russian', 6000, 0),
-(524, 'Schoolgirls', 6000, 0),
-(525, 'Massage Parlor', 6000, 0),
-(526, 'Virgins', 6000, 0),
-(527, 'Beach', 6000, 0),
-(528, '2008 AVN Award Nominees', 6000, 0),
-(529, 'Czech', 6000, 0),
-(530, 'Orgies', 6000, 0),
-(531, 'Babysitters', 6000, 0),
-(532, '2009 AVN Award Nominees', 6000, 0),
-(533, 'Big Butts', 6000, 0),
-(534, 'Handjob Female on Male', 6000, 0),
-(535, 'Hidden Cam', 6000, 0),
-(536, '2014 AVN Award Nominees', 6000, 0),
-(537, 'XBIZ Awards', 6000, 0),
-(538, 'Spain', 6000, 0),
-(539, 'Spanish', 6000, 0),
-(540, 'Feminist Porn Awards', 6000, 0),
-(541, 'Sybian', 6000, 0),
-(542, 'Instructional', 6000, 0),
-(543, 'Female Ejaculation', 6000, 0),
-(544, 'Dutch', 6000, 0),
-(545, 'Maids', 6000, 0),
-(546, 'Tattooed / Pierced', 6000, 0),
-(547, 'Shower / Bathroom', 6000, 0),
-(548, 'Cum-Swapping', 6000, 0),
-(549, 'Girls Next Door', 6000, 0),
-(550, 'Petite', 6000, 0),
-(551, 'Gangbang - M on F', 6000, 0),
-(552, 'Office', 6000, 0),
-(553, 'Toys', 6000, 0),
-(554, '2010 AVN Award Nominees', 6000, 0),
-(555, 'International', 6000, 0),
-(556, 'Student', 6000, 0),
-(557, 'Deep Throating', 6000, 0),
-(558, 'Boat', 6000, 0),
-(559, 'Secretaries', 6000, 0),
-(560, 'Reality', 6000, 0),
-(561, 'Brazil', 6000, 0),
-(562, 'Male on Female', 6000, 0),
-(563, 'Nurses', 6000, 0),
-(564, 'Interactive Sex', 6000, 0),
-(565, 'Up & Coming', 6000, 0),
-(566, 'Cum Swapping', 6000, 0),
-(567, 'Multi-Angles', 6000, 0),
-(568, 'Leather', 6000, 0),
-(569, 'Pot Luck', 6000, 0),
-(570, 'Cream Pies', 6000, 0),
-(571, 'Behind The Scenes', 6000, 0),
-(572, 'Auditions', 6000, 0),
-(573, 'Pickup', 6000, 0),
-(574, 'Sex Machines', 6000, 0),
-(575, '2012 AVN Award Nominees', 6000, 0),
-(576, 'Voyeurism', 6000, 0),
-(577, 'Voyeur', 6000, 0),
-(578, 'Bukkake', 6000, 0),
-(579, 'Smoking', 6000, 0),
-(580, 'Gangbang - F on F', 6000, 0),
-(581, 'Italy', 6000, 0),
-(582, 'Italian', 6000, 0),
-(583, 'Portuguese', 6000, 0),
-(584, 'Locale', 6000, 0),
-(585, 'Secretaries/Office', 6000, 0),
-(586, 'Sex at Work', 6000, 0),
-(587, 'School Girls', 6000, 0),
-(588, 'Felching', 6000, 0),
-(589, 'Glasses', 6000, 0),
-(590, 'Euro', 6000, 0),
-(591, 'Pissing', 6000, 0),
-(592, 'Shocking Penetration', 6000, 0),
-(593, 'German Speaking', 6000, 0),
-(594, 'Anilingus', 6000, 0),
-(595, 'High Definition', 6000, 0),
-(596, 'M.I.L.F.', 6000, 0),
-(597, 'Cougar', 6000, 0),
-(598, 'Big Dick', 6000, 0),
-(599, 'Cumshot', 6000, 0),
-(600, 'Pantyhose/Stockings', 6000, 0),
-(601, 'Dancers/Models', 6000, 0),
-(602, 'Submales', 6000, 0),
-(603, 'Threeway', 6000, 0),
-(604, 'Fresh Faces', 6000, 0),
-(605, 'Natural Breasts', 6000, 0),
-(606, 'German', 6000, 0),
-(607, 'Blowjob', 6000, 0),
-(608, 'Gloryhole', 6000, 0),
-(609, 'Black Dicks/White Chicks', 6000, 0),
-(610, 'P.O.V.', 6000, 0),
-(611, 'Glamour', 6000, 0),
-(612, 'Brides & Weddings', 6000, 0),
-(613, 'Exhibitionist', 6000, 0),
-(614, 'Party Girls', 6000, 0),
-(615, 'Reality Based', 6000, 0),
-(616, 'Shemale', 6000, 0),
-(617, 'Cheerleader', 6000, 0),
-(618, 'Award Winning Movies', 6000, 0),
-(619, 'New Release', 6000, 0),
-(620, 'Foot', 6000, 0),
-(621, 'Older / Younger', 6000, 0),
-(622, 'Vintage', 6000, 0),
-(623, 'Incest', 6000, 0),
-(624, 'Femdom', 6000, 0),
-(625, 'Strap-On', 6000, 0),
-(626, 'Double Anal', 6000, 0),
-(627, 'Costumes', 6000, 0),
-(628, 'For Ladies', 6000, 0),
-(629, 'Family Roleplay', 6000, 0),
-(630, 'Girls With Toys', 6000, 0),
-(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
diff --git a/lib/DB/patches/0067~gamesinfo.sql b/lib/DB/patches/0067~gamesinfo.sql
deleted file mode 100644
index b92ea7bfd..000000000
--- a/lib/DB/patches/0067~gamesinfo.sql
+++ /dev/null
@@ -1,5 +0,0 @@
-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
diff --git a/lib/DB/patches/0068~xxxinfo.sql b/lib/DB/patches/0068~xxxinfo.sql
deleted file mode 100644
index 129bdf346..000000000
--- a/lib/DB/patches/0068~xxxinfo.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-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
diff --git a/lib/DB/patches/0069~site.sql b/lib/DB/patches/0069~site.sql
deleted file mode 100644
index 7535bb2be..000000000
--- a/lib/DB/patches/0069~site.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-INSERT INTO `site` (`setting`, `value`) VALUES ('anidbkey', '');
-UPDATE `tmux` SET `value` = '69' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
diff --git a/lib/DB/patches/0070~animetitles.sql b/lib/DB/patches/0070~animetitles.sql
deleted file mode 100644
index f33f54c93..000000000
--- a/lib/DB/patches/0070~animetitles.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-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
diff --git a/lib/DB/patches/0071~site.sql b/lib/DB/patches/0071~site.sql
deleted file mode 100644
index f73998a23..000000000
--- a/lib/DB/patches/0071~site.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-INSERT INTO site (setting, value) VALUES ('rottentomatoquality', 'profile');
-UPDATE `tmux` SET `value` = '71' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
diff --git a/lib/DB/patches/0072~site.sql b/lib/DB/patches/0072~site.sql
deleted file mode 100644
index 9044d821a..000000000
--- a/lib/DB/patches/0072~site.sql
+++ /dev/null
@@ -1,24 +0,0 @@
-DROP TRIGGER IF EXISTS insert_hashes;
-DROP TRIGGER IF EXISTS update_hashes;
-DROP TRIGGER IF EXISTS delete_hashes;
-DROP TRIGGER IF EXISTS check_rfinsert;
-DROP TRIGGER IF EXISTS check_rfupdate;
-DROP TRIGGER IF EXISTS check_insert;
-DROP TRIGGER IF EXISTS check_update;
-DROP TRIGGER IF EXISTS insert_MD5;
-
-
-CREATE TRIGGER insert_hashes AFTER INSERT ON prehash FOR EACH ROW BEGIN INSERT INTO predbhash (pre_id, hashes) VALUES (NEW.id, CONCAT_WS(',', MD5(NEW.title), MD5(MD5(NEW.title)), SHA1(NEW.title)));END;
-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;
-CREATE TRIGGER delete_hashes AFTER DELETE ON prehash FOR EACH ROW BEGIN DELETE FROM predbhash WHERE pre_id = OLD.id; END;
-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;
-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; 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;END IF;END;
-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
diff --git a/lib/DB/patches/0073~releases.sql b/lib/DB/patches/0073~releases.sql
deleted file mode 100644
index b9ede6073..000000000
--- a/lib/DB/patches/0073~releases.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-CREATE INDEX `ix_releases_xxxinfo_id` ON `releases` (`xxxinfo_id`);
-UPDATE `tmux` SET `value` = '73' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
diff --git a/lib/DB/patches/0074~releases.sql b/lib/DB/patches/0074~releases.sql
deleted file mode 100644
index 9133e61d6..000000000
--- a/lib/DB/patches/0074~releases.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-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
diff --git a/lib/DB/patches/0075~site.sql b/lib/DB/patches/0075~site.sql
deleted file mode 100644
index 739c7dd73..000000000
--- a/lib/DB/patches/0075~site.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-INSERT IGNORE INTO `site` (`setting`, `value`) VALUE ('alternate_nntp', '0');
-UPDATE `tmux` SET `value` = '75' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
diff --git a/lib/DB/patches/0078~site.sql b/lib/DB/patches/0078~site.sql
deleted file mode 100644
index 2399a7c47..000000000
--- a/lib/DB/patches/0078~site.sql
+++ /dev/null
@@ -1,51 +0,0 @@
-INSERT INTO `site` (`setting`, `value`) VALUES
-('amazonsleep', '1000'),
-('maxaddprocessed', '25'),
-('maxnfoprocessed', '100'),
-('maxrageprocessed', '75'),
-('maximdbprocessed', '100'),
-('maxanidbprocessed', '100'),
-('maxmusicprocessed', '150'),
-('maxgamesprocessed', '150'),
-('maxbooksprocessed', '300'),
-('maxnzbsprocessed', '1000'),
-('maxpartrepair', '15000'),
-('partrepair', '1'),
-('binarythreads', '1'),
- ('backfillthreads', '1'),
- ('safebackfilldate', '2012-06-24'),
-('postthreads', '1'),
-('releasethreads', '1'),
-('nzbthreads', '1'),
-('maxsizetopostprocess', '100'),
-('minsizetopostprocess', '1'),
-('postthreadsamazon', '1'),
-('postthreadsnon', '1'),
-('segmentstodownload', '2'),
-('passchkattempts', '1'),
-('maxpartsprocessed', '3'),
-('trakttvkey', ''),
-('fanarttvkey', ''),
-('lookuppar2', '1'),
-('addpar2', '1'),
-('fixnamethreads', '1'),
-('fixnamesperrun', '1'),
-('zippath', ''),
-('processjpg', '1'),
-('scrape', '1'),
-('nntpretries', '10'),
-('imdburl', '0'),
-('yydecoderpath', ''),
-('ffmpeg_duration', '5'),
-('ffmpeg_image_time', '5'),
-('processvideos', '0'),
-('maxsizetoprocessnfo', '100'),
-('minsizetoprocessnfo', '1'),
-('nfothreads', '1'),
-('extractusingrarinfo', '0'),
-('maxnestedlevels', '3'),
-('innerfileblacklist', ''),
- ('miscotherretentionhours', '0'),
- ('mischashedretentionhours', '0');
-
-UPDATE `tmux` SET `value` = '78' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
diff --git a/lib/DB/patches/0079~site.sql b/lib/DB/patches/0079~site.sql
deleted file mode 100644
index 83ae30623..000000000
--- a/lib/DB/patches/0079~site.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-INSERT IGNORE INTO `site` (`setting`, `value`) VALUE ('maxnforetries', '5');
-UPDATE `tmux` SET `value` = '79' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
diff --git a/lib/DB/patches/0080~site.sql b/lib/DB/patches/0080~site.sql
deleted file mode 100644
index 2cf8072ce..000000000
--- a/lib/DB/patches/0080~site.sql
+++ /dev/null
@@ -1,4 +0,0 @@
-INSERT IGNORE INTO `site` (`setting`, `value`) VALUES
- ('timeoutpath', ''),
- ('timeoutseconds', '0');
-UPDATE `tmux` SET `value` = '80' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
diff --git a/lib/DB/patches/0081~movieinfo.sql b/lib/DB/patches/0081~movieinfo.sql
deleted file mode 100644
index f7d68a24d..000000000
--- a/lib/DB/patches/0081~movieinfo.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-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
diff --git a/lib/DB/patches/0082~tvrageepisodes.sql b/lib/DB/patches/0082~tvrageepisodes.sql
deleted file mode 100644
index 105bac6bd..000000000
--- a/lib/DB/patches/0082~tvrageepisodes.sql
+++ /dev/null
@@ -1,17 +0,0 @@
-DROP TABLE IF EXISTS tvrageepisodes;
-CREATE TABLE tvrageepisodes (
- id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
- rageid INT(11) UNSIGNED NOT NULL,
- showtitle VARCHAR(255) DEFAULT NULL,
- airdate DATETIME NOT NULL,
- link VARCHAR(255) DEFAULT NULL,
- fullep VARCHAR(20) NOT NULL,
- eptitle VARCHAR(255) DEFAULT NULL,
- PRIMARY KEY (id),
- UNIQUE INDEX ix_tvrageepisodes_rageid (rageid, fullep)
-)
- 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
diff --git a/lib/DB/patches/0083~site.sql b/lib/DB/patches/0083~site.sql
deleted file mode 100644
index c93de7984..000000000
--- a/lib/DB/patches/0083~site.sql
+++ /dev/null
@@ -1,6 +0,0 @@
-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
diff --git a/lib/DB/patches/0084~groups.sql b/lib/DB/patches/0084~groups.sql
deleted file mode 100644
index 2d14de519..000000000
--- a/lib/DB/patches/0084~groups.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-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
diff --git a/lib/DB/patches/0085~site.sql b/lib/DB/patches/0085~site.sql
deleted file mode 100644
index 72968c22c..000000000
--- a/lib/DB/patches/0085~site.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-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
diff --git a/lib/DB/patches/0086~category.sql b/lib/DB/patches/0086~category.sql
deleted file mode 100644
index cf4b5f42b..000000000
--- a/lib/DB/patches/0086~category.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-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
diff --git a/lib/DB/patches/0087~site.sql b/lib/DB/patches/0087~site.sql
deleted file mode 100644
index a146c1938..000000000
--- a/lib/DB/patches/0087~site.sql
+++ /dev/null
@@ -1,6 +0,0 @@
-INSERT IGNORE INTO `site` (`setting`, `value`) VALUES
- ('safepartrepair','0'),
- ('maxpartrepair', '15000'),
- ('partrepairmaxtries', '3'),
- ('tablepergroup', '0');
-UPDATE `tmux` SET `value` = '87' WHERE `setting` = 'sqlpatch';
diff --git a/lib/DB/patches/0088~site.sql b/lib/DB/patches/0088~site.sql
deleted file mode 100644
index 1374b6131..000000000
--- a/lib/DB/patches/0088~site.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-INSERT IGNORE INTO `site` (`setting`, `value`) VALUE
- ('nntpproxy','0');
-UPDATE `tmux` SET `value` = '88' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
diff --git a/lib/DB/patches/0089~site.sql b/lib/DB/patches/0089~site.sql
deleted file mode 100644
index d86ca3404..000000000
--- a/lib/DB/patches/0089~site.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-INSERT IGNORE INTO `site` (`setting`, `value`) VALUE ('book_reqids','7010');
-UPDATE `tmux` SET `value` = '89' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
diff --git a/lib/DB/patches/0090~bookinfo.sql b/lib/DB/patches/0090~bookinfo.sql
deleted file mode 100644
index eefd31066..000000000
--- a/lib/DB/patches/0090~bookinfo.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-ALTER TABLE `bookinfo` ADD `salesrank` INT(10) UNSIGNED DEFAULT NULL;
-UPDATE `tmux` SET `value` = '90' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
diff --git a/lib/DB/patches/0091~releasesearch.sql b/lib/DB/patches/0091~releasesearch.sql
deleted file mode 100644
index cd4b0ac74..000000000
--- a/lib/DB/patches/0091~releasesearch.sql
+++ /dev/null
@@ -1,15 +0,0 @@
-ALTER TABLE releasesearch ADD COLUMN fromname VARCHAR(255) COLLATE utf8_unicode_ci DEFAULT NULL;
-UPDATE releasesearch rs INNER JOIN releases r ON rs.releaseid = r.id SET rs.fromname = r.fromname;
-
-ALTER TABLE releasesearch DROP INDEX ix_releasesearch_name_searchname_ft;
-ALTER TABLE releasesearch ADD FULLTEXT INDEX ix_releasesearch_name_ft (name);
-ALTER TABLE releasesearch ADD FULLTEXT INDEX ix_releasesearch_searchname_ft (searchname);
-ALTER TABLE releasesearch ADD FULLTEXT INDEX ix_releasesearch_fromname_ft (fromname);
-
-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
diff --git a/lib/DB/patches/0092~bookinfo.sql b/lib/DB/patches/0092~bookinfo.sql
deleted file mode 100644
index 754386b96..000000000
--- a/lib/DB/patches/0092~bookinfo.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-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
diff --git a/lib/DB/patches/0093~anidb.sql b/lib/DB/patches/0093~anidb.sql
deleted file mode 100644
index 1b69be901..000000000
--- a/lib/DB/patches/0093~anidb.sql
+++ /dev/null
@@ -1,70 +0,0 @@
-DROP TABLE IF EXISTS anidb_episodes;
-CREATE TABLE anidb_episodes (
- anidbid INT(10) UNSIGNED NOT NULL
- COMMENT 'id of title from AniDB',
- episodeid INT(10) UNSIGNED NOT NULL DEFAULT '0'
- COMMENT 'anidb id for this episode',
- episode_no SMALLINT(5) UNSIGNED NOT NULL
- COMMENT 'Numeric version of episode (leave 0 for combined episodes).',
- episode_title VARCHAR(255)
- COLLATE utf8_unicode_ci NOT NULL
- COMMENT 'Title of the episode (en, x-jat)',
- airdate DATE NOT NULL,
- PRIMARY KEY (anidbid, episodeid)
-)
- ENGINE = InnoDB
- DEFAULT CHARSET =utf8
- COLLATE =utf8_unicode_ci;
-
-
-DROP TABLE IF EXISTS anidb_info;
-CREATE TABLE anidb_info (
- anidbid INT(10) UNSIGNED NOT NULL
- COMMENT 'id of title from AniDB',
- type VARCHAR(32)
- COLLATE utf8_unicode_ci DEFAULT NULL,
- startdate DATE DEFAULT NULL,
- enddate DATE DEFAULT NULL,
- updated TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
- related VARCHAR(1024)
- COLLATE utf8_unicode_ci DEFAULT NULL,
- similar VARCHAR(1024)
- COLLATE utf8_unicode_ci DEFAULT NULL,
- creators VARCHAR(1024)
- COLLATE utf8_unicode_ci DEFAULT NULL,
- description TEXT
- COLLATE utf8_unicode_ci DEFAULT NULL,
- rating VARCHAR(5)
- COLLATE utf8_unicode_ci DEFAULT NULL,
- picture VARCHAR(255)
- COLLATE utf8_unicode_ci DEFAULT NULL,
- categories VARCHAR(1024)
- COLLATE utf8_unicode_ci DEFAULT NULL,
- characters VARCHAR(1024)
- COLLATE utf8_unicode_ci DEFAULT NULL,
- PRIMARY KEY (anidbid),
- KEY ix_anidb_info_datetime (startdate, enddate, updated)
-)
- ENGINE = InnoDB
- DEFAULT CHARSET =utf8
- COLLATE =utf8_unicode_ci;
-
-
-DROP TABLE IF EXISTS anidb_titles;
-CREATE TABLE anidb_titles (
- anidbid INT(10) UNSIGNED NOT NULL
- COMMENT 'id of title from AniDB',
- type VARCHAR(25)
- COLLATE utf8_unicode_ci NOT NULL
- COMMENT 'type of title.',
- lang VARCHAR(25)
- COLLATE utf8_unicode_ci NOT NULL,
- title VARCHAR(255)
- COLLATE utf8_unicode_ci NOT NULL,
- PRIMARY KEY (anidbid, type, lang, title)
-)
- ENGINE = InnoDB
- DEFAULT CHARSET = utf8
- COLLATE = utf8_unicode_ci;
-
-UPDATE `tmux` SET `value` = '93' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
diff --git a/lib/DB/patches/0094~site.sql b/lib/DB/patches/0094~site.sql
deleted file mode 100644
index 89e215cf8..000000000
--- a/lib/DB/patches/0094~site.sql
+++ /dev/null
@@ -1,5 +0,0 @@
-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
diff --git a/lib/DB/patches/0095~releases.sql b/lib/DB/patches/0095~releases.sql
deleted file mode 100644
index 816755638..000000000
--- a/lib/DB/patches/0095~releases.sql
+++ /dev/null
@@ -1,16 +0,0 @@
-ALTER TABLE releases CHANGE COLUMN nzbstatus nzbstatus TINYINT(1) NOT NULL DEFAULT 0;
-ALTER TABLE releases CHANGE COLUMN iscategorized iscategorized TINYINT(1) NOT NULL DEFAULT 0;
-ALTER TABLE releases CHANGE COLUMN isrenamed isrenamed TINYINT(1) NOT NULL DEFAULT 0;
-ALTER TABLE releases CHANGE COLUMN ishashed ishashed TINYINT(1) NOT NULL DEFAULT 0;
-ALTER TABLE releases CHANGE COLUMN isrequestid isrequestid TINYINT(1) NOT NULL DEFAULT 0;
-ALTER TABLE releases CHANGE COLUMN jpgstatus jpgstatus TINYINT(1) NOT NULL DEFAULT 0;
-ALTER TABLE releases CHANGE COLUMN videostatus videostatus TINYINT(1) NOT NULL DEFAULT 0;
-ALTER TABLE releases CHANGE COLUMN audiostatus audiostatus TINYINT(1) NOT NULL DEFAULT 0;
-ALTER TABLE releases CHANGE COLUMN proc_pp proc_pp TINYINT(1) NOT NULL DEFAULT 0;
-ALTER TABLE releases CHANGE COLUMN proc_sorter proc_sorter TINYINT(1) NOT NULL DEFAULT 0;
-ALTER TABLE releases CHANGE COLUMN proc_par2 proc_par2 TINYINT(1) NOT NULL DEFAULT 0;
-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
diff --git a/lib/DB/patches/0096~site.sql b/lib/DB/patches/0096~site.sql
deleted file mode 100644
index f68adb36e..000000000
--- a/lib/DB/patches/0096~site.sql
+++ /dev/null
@@ -1,9 +0,0 @@
-INSERT IGNORE INTO `site` (`setting`, `value`) VALUES
- ('grabstatus', 1),
- ('crossposttime', 2),
- ('deletepossiblerelease', 0),
- ('grabstatus', 0),
- ('nzbsplitlevel', 1),
- ('maxsizetoformrelease', 0);
-
-UPDATE `tmux` set `value` = '96' where `setting` = 'sqlpatch';
diff --git a/lib/DB/patches/0097~releases.sql b/lib/DB/patches/0097~releases.sql
deleted file mode 100644
index ffebbecac..000000000
--- a/lib/DB/patches/0097~releases.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-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
diff --git a/lib/DB/patches/0098~tmux.sql b/lib/DB/patches/0098~tmux.sql
deleted file mode 100644
index 4db4ea6ea..000000000
--- a/lib/DB/patches/0098~tmux.sql
+++ /dev/null
@@ -1,4 +0,0 @@
-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
diff --git a/lib/DB/patches/0099~releases.sql b/lib/DB/patches/0099~releases.sql
deleted file mode 100644
index 5531fdd92..000000000
--- a/lib/DB/patches/0099~releases.sql
+++ /dev/null
@@ -1,60 +0,0 @@
-DROP INDEX ix_releases_name_searchname_ft ON releases;
-DROP INDEX ix_releases_guid ON releases;
-DROP INDEX ix_releases_adddate ON releases;
-DROP INDEX ix_releases_categoryid ON releases;
-DROP INDEX ix_releases_rageid ON releases;
-DROP INDEX ix_releases_imdbid ON releases;
-DROP INDEX ix_releases_name ON releases;
-DROP INDEX ix_releases_searchname ON releases;
-DROP INDEX ix_releases_groupid ON releases;
-DROP INDEX ix_releases_dehashstatus ON releases;
-DROP INDEX ix_releases_prehashid ON releases;
-DROP INDEX ix_releases_passwordstatus ON releases;
-DROP INDEX ix_releases_reqidstatus ON releases;
-DROP INDEX ix_releases_nfostatus ON releases;
-DROP INDEX ix_releases_musicinfoid ON releases;
-DROP INDEX ix_releases_consoleinfoid ON releases;
-DROP INDEX ix_releases_bookinfoid ON releases;
-DROP INDEX ix_releases_haspreview ON releases;
-DROP INDEX ix_releases_status ON releases;
-DROP INDEX ix_releases_postdate_searchname ON releases;
-DROP INDEX ix_releases_postdate_name ON releases;
-DROP INDEX ix_releases_nzb_guid ON releases;
-DROP INDEX ix_releases_prehashid_searchname ON releases;
-DROP INDEX idx_releases_multi_name_fromname_size ON releases;
-
-ALTER TABLE releases MODIFY id INT(11) UNSIGNED NOT NULL;
-ALTER TABLE releases DROP PRIMARY KEY;
-ALTER TABLE releases ADD PRIMARY KEY (id, categoryid);
-ALTER TABLE releases MODIFY id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT;
-
-ALTER TABLE releases PARTITION BY RANGE (categoryid) (
-PARTITION unused VALUES LESS THAN (1000),
-PARTITION console VALUES LESS THAN (2000),
-PARTITION movies VALUES LESS THAN (3000),
-PARTITION audio VALUES LESS THAN (4000),
-PARTITION pc VALUES LESS THAN (5000),
-PARTITION tv VALUES LESS THAN (6000),
-PARTITION xxx VALUES LESS THAN (7000),
-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);
-ALTER TABLE releases ADD INDEX ix_releases_groupid (groupid);
-ALTER TABLE releases ADD INDEX ix_releases_dehashstatus (dehashstatus);
-ALTER TABLE releases ADD INDEX ix_releases_reqidstatus (reqidstatus);
-ALTER TABLE releases ADD INDEX ix_releases_nfostatus (nfostatus);
-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_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/lib/DB/patches/0100~binaries.sql b/lib/DB/patches/0100~binaries.sql
deleted file mode 100644
index 7e3ed464a..000000000
--- a/lib/DB/patches/0100~binaries.sql
+++ /dev/null
@@ -1,5 +0,0 @@
-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
diff --git a/lib/DB/patches/0101~tmux.sql b/lib/DB/patches/0101~tmux.sql
deleted file mode 100644
index 18b5d9789..000000000
--- a/lib/DB/patches/0101~tmux.sql
+++ /dev/null
@@ -1,4 +0,0 @@
-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
diff --git a/lib/DB/patches/0102~predb.sql b/lib/DB/patches/0102~predb.sql
deleted file mode 100644
index 9f009997b..000000000
--- a/lib/DB/patches/0102~predb.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-ALTER TABLE `predb` drop `MD5`;
-UPDATE tmux set value = '102' where setting = 'sqlpatch';
\ No newline at end of file
diff --git a/lib/DB/patches/0103~site.sql b/lib/DB/patches/0103~site.sql
deleted file mode 100644
index 6347448b3..000000000
--- a/lib/DB/patches/0103~site.sql
+++ /dev/null
@@ -1,7 +0,0 @@
-INSERT IGNORE INTO `site` (`setting`, `value`) VALUES
- ('intanidbupdate', 7),
- ('lastanidbupdate', 0),
- ('timeoutpath', ''),
- ('timeoutseconds', 0);
-
-UPDATE `tmux` set `value` = '103' where `setting` = 'sqlpatch';
diff --git a/lib/DB/patches/0104~releasecomment.sql b/lib/DB/patches/0104~releasecomment.sql
deleted file mode 100644
index 1b54065b9..000000000
--- a/lib/DB/patches/0104~releasecomment.sql
+++ /dev/null
@@ -1,4 +0,0 @@
-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
diff --git a/lib/DB/patches/0105~site.sql b/lib/DB/patches/0105~site.sql
deleted file mode 100644
index 50f984b50..000000000
--- a/lib/DB/patches/0105~site.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-INSERT IGNORE INTO `site` (`setting`, `value`) VALUES
- ('magic_file_path', '');
-UPDATE `tmux` set `value` = '105' where `setting` = 'sqlpatch';
\ No newline at end of file
diff --git a/lib/DB/patches/0106~category.sql b/lib/DB/patches/0106~category.sql
deleted file mode 100644
index 593c4e8d0..000000000
--- a/lib/DB/patches/0106~category.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-INSERT INTO category (id, title, parentid) VALUES (6080, 'SD', 6000);
-UPDATE `tmux` SET `value` = '106' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
diff --git a/lib/DB/patches/0107~prehash.sql b/lib/DB/patches/0107~prehash.sql
deleted file mode 100644
index 937a83ad0..000000000
--- a/lib/DB/patches/0107~prehash.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-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
diff --git a/lib/DB/patches/0108~category.sql b/lib/DB/patches/0108~category.sql
deleted file mode 100644
index a366bc6b7..000000000
--- a/lib/DB/patches/0108~category.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-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` = '108' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
diff --git a/lib/DB/patches/0109~category.sql b/lib/DB/patches/0109~category.sql
deleted file mode 100644
index a02e80520..000000000
--- a/lib/DB/patches/0109~category.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-INSERT INTO category (id, title, parentid) VALUES (6090, 'WEB-DL', 6000);
-UPDATE `tmux` SET `value` = '109' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
diff --git a/lib/DB/patches/0110~releases.sql b/lib/DB/patches/0110~releases.sql
deleted file mode 100644
index c9702fe2f..000000000
--- a/lib/DB/patches/0110~releases.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-ALTER TABLE releases ADD INDEX ix_releases_preid_searchname (preid, searchname);
-UPDATE `tmux` SET `value` = '110' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
diff --git a/lib/DB/patches/0111~tmux.sql b/lib/DB/patches/0111~tmux.sql
deleted file mode 100644
index 0142588da..000000000
--- a/lib/DB/patches/0111~tmux.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-INSERT IGNORE INTO `tmux` (`setting`, `value`) VALUES ('import_count','50000');
-UPDATE `tmux` SET `value` = '111' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
diff --git a/lib/DB/patches/0112~tmux.sql b/lib/DB/patches/0112~tmux.sql
deleted file mode 100644
index a39a00c99..000000000
--- a/lib/DB/patches/0112~tmux.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-DELETE FROM `tmux` WHERE `setting` = 'max_load';
-DELETE FROM `tmux` WHERE `setting` = 'max_load_releases';
-UPDATE `tmux` set `value` = '112' where `setting` = 'sqlpatch';
\ No newline at end of file
diff --git a/lib/DB/patches/0113~general.sql b/lib/DB/patches/0113~general.sql
deleted file mode 100644
index c71de0668..000000000
--- a/lib/DB/patches/0113~general.sql
+++ /dev/null
@@ -1,12 +0,0 @@
-DROP PROCEDURE IF EXISTS alter_tables;
-/* Create the stored procedure to alter tables -- change to myisam if version < 5.6 */
-CREATE PROCEDURE alter_tables() BEGIN SELECT version() regexp '^[0-5]\.[0-5]' into @version; IF @version = 1 THEN ALTER TABLE bookinfo engine=myisam; ALTER TABLE consoleinfo engine=myisam; ALTER TABLE musicinfo engine=myisam; END IF; END;
-/* Execute the stored procedures */
-CALL alter_tables();
-/* Don't forget to drop the stored procedure when you're done! */
-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` = '113' where `setting` = 'sqlpatch';
diff --git a/lib/DB/patches/0114~movieinfo.sql b/lib/DB/patches/0114~movieinfo.sql
deleted file mode 100644
index ddc1b16e0..000000000
--- a/lib/DB/patches/0114~movieinfo.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-ALTER TABLE movieinfo ADD COLUMN banner TINYINT(1) UNSIGNED NOT NULL DEFAULT '0';
-UPDATE `tmux` set `value` = '114' where `setting` = 'sqlpatch';
\ No newline at end of file
diff --git a/lib/DB/patches/0115~dnzb_downloads.sql b/lib/DB/patches/0115~dnzb_downloads.sql
deleted file mode 100644
index 8a553dd44..000000000
--- a/lib/DB/patches/0115~dnzb_downloads.sql
+++ /dev/null
@@ -1,13 +0,0 @@
-DROP TABLE IF EXISTS dnzb_failures;
-CREATE TABLE dnzb_failures (
- id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
- userid INT(11) UNSIGNED NOT NULL,
- guid VARCHAR(50) NOT NULL,
- PRIMARY KEY (id)
-)
- ENGINE =MYISAM
- 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` = '115' where `setting` = 'sqlpatch';
\ No newline at end of file
diff --git a/lib/DB/patches/0116~site.sql b/lib/DB/patches/0116~site.sql
deleted file mode 100644
index df4f824f3..000000000
--- a/lib/DB/patches/0116~site.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-INSERT IGNORE INTO `site` (`setting`, `value`) VALUES
-('request_url', 'http://reqid.newznab-tmux.pw/');
-UPDATE `tmux` SET `value` = '127' WHERE `setting` = 'sqlpatch';
\ No newline at end of file
diff --git a/lib/Enzebe.php b/lib/Enzebe.php
deleted file mode 100644
index 294464afc..000000000
--- a/lib/Enzebe.php
+++ /dev/null
@@ -1,393 +0,0 @@
-pdo = ($pdo instanceof \DB ? $pdo : new \DB());
- $s = new Sites();
- $this->site = $s->get();
-
- $this->tablePerGroup = ($this->site->tablepergroup == 0 ? false : true);
- $nzbSplitLevel = $this->site->nzbsplitlevel;
- $this->nzbSplitLevel = (empty($nzbSplitLevel) ? 1 : $nzbSplitLevel);
- $this->siteNzbPath = (string)$this->site->nzbpath;
- if (substr($this->siteNzbPath, -1) !== DS) {
- $this->siteNzbPath .= DS;
- }
- }
-
- /**
- * Initiate class vars when writing NZB's.
- *
- * @param int $groupID
- *
- * @access public
- */
- public function initiateForWrite($groupID)
- {
- $this->groupID = $groupID;
- $site = new Sites();
- // Set table names
- if ($this->tablePerGroup === true) {
- if ($this->groupID == '') {
- exit("$this->groupID is missing\n");
- }
- $bName = 'binaries_' . $this->groupID;
- $pName = 'parts_' . $this->groupID;
- } else {
- $bName = 'binaries';
- $pName = 'parts';
- }
-
- $this->_binariesQuery = sprintf(
- 'SELECT %s.*, UNIX_TIMESTAMP(%s.date) AS udate, groups.name AS groupname
- FROM %s
- INNER JOIN groups ON %s.groupid = groups.id
- WHERE %s.releaseid = ',
- $bName,
- $bName,
- $bName,
- $bName,
- $bName
- );
- $this->_partsQuery = (
- 'SELECT DISTINCT(messageid), size, partnumber FROM ' . $pName . ' WHERE binaryid = %d ORDER BY partnumber'
- );
-
- $this->_nzbHeadString = (
- "\n\n\n\n\n %s\n %s\n\n\n"
- );
- }
-
- /**
- * Write an NZB to the hard drive for a single release.
- *
- * @param int $relID The id of the release in the DB.
- * @param string $relGuid The guid of the release.
- * @param string $name The name of the release.
- * @param string $cTitle The name of the category this release is in.
- *
- * @return bool Have we successfully written the NZB to the hard drive?
- *
- * @access public
- */
- public function writeNZBforReleaseId($relID, $relGuid, $name, $cTitle)
- {
- $path = ($this->buildNZBPath($relGuid, $this->nzbSplitLevel, true) . $relGuid . '.nzb.gz');
- $fp = gzopen($path, 'wb7');
- if ($fp) {
- $nzb_guid = '';
- gzwrite(
- $fp,
- sprintf(
- $this->_nzbHeadString,
- htmlspecialchars($cTitle, ENT_QUOTES, 'utf-8'),
- htmlspecialchars($name, ENT_QUOTES, 'utf-8')
- )
- );
-
- $binaries = $this->pdo->queryDirect($this->_binariesQuery. $relID . ' ORDER BY name');
-
- if ($binaries instanceof \Traversable) {
-
- foreach ($binaries as $binary) {
- $poster = htmlspecialchars($binary['fromname'], ENT_QUOTES, 'utf-8');
-
- if ($binary instanceof \Traversable) {
-
- foreach ($binary as $bin) {
-
- // Buffer segment writes, increases performance.
- $string = '';
-
- $parts = $this->pdo->queryDirect(sprintf($this->_partsQuery, $bin['id']));
-
- if ($parts instanceof \Traversable) {
-
- foreach ($parts as $part) {
- if ($nzb_guid === '') {
- $nzb_guid = $part['messageid'];
- }
-
- $string .= (
- ' '
- . htmlspecialchars($part['messageid'], ENT_QUOTES, 'utf-8')
- . "\n"
- );
- }
- }
-
- gzwrite($fp,
- '\n \n " . $bin['groupname'] .
- "\n \n \n" . $string . " \n\n"
- );
- }
- }
- }
- }
-
- gzwrite($fp, '');
- gzclose($fp);
-
- if (is_file($path)) {
- $this->pdo->queryExec(
- sprintf('
- UPDATE releases SET nzbstatus = %d %s WHERE id = %d',
- \Enzebe::NZB_ADDED,
- ($nzb_guid === '' ? '' : ', nzb_guid = ' . $this->pdo->escapestring(md5($nzb_guid))),
- $relID
- )
- );
-
- // Chmod to fix issues some users have with file permissions.
- chmod($path, 0777);
- return true;
- } else {
- echo "ERROR: $path does not exist.\n";
- }
- }
- return false;
- }
-
- /**
- * Build a folder path on the hard drive where the NZB file will be stored.
- *
- * @param string $releaseGuid The guid of the release.
- * @param int $levelsToSplit How many sub-paths the folder will be in.
- * @param bool $createIfNotExist Create the folder if it doesn't exist.
- *
- * @return string $nzbpath The path to store the NZB file.
- *
- * @access public
- */
- private function buildNZBPath($releaseGuid, $levelsToSplit, $createIfNotExist)
- {
- $nzbPath = '';
-
- for ($i = 0; $i < $levelsToSplit && $i < 32; $i++) {
- $nzbPath .= substr($releaseGuid, $i, 1) . DS;
- }
-
- $nzbPath = $this->siteNzbPath . $nzbPath;
-
- if ($createIfNotExist === true && !is_dir($nzbPath)) {
- mkdir($nzbPath, 0777, true);
- }
-
- return $nzbPath;
- }
-
- /**
- * Retrieve path + filename of the NZB to be stored.
- *
- * @param string $releaseGuid The guid of the release.
- * @param int $levelsToSplit How many sub-paths the folder will be in. (optional)
- * @param bool $createIfNotExist Create the folder if it doesn't exist. (optional)
- *
- * @return string Path+filename.
- *
- * @access public
- */
- public function getNZBPath($releaseGuid, $levelsToSplit = 0, $createIfNotExist = false)
- {
- if ($levelsToSplit === 0) {
- $levelsToSplit = $this->nzbSplitLevel;
- }
-
- return ($this->buildNZBPath($releaseGuid, $levelsToSplit, $createIfNotExist) . $releaseGuid . '.nzb.gz');
- }
-
- /**
- * Determine is an NZB exists, returning the path+filename, if not return false.
- *
- * @param string $releaseGuid The guid of the release.
- *
- * @return bool|string On success: (string) Path+file name of the nzb.
- * On failure: (bool) False.
- *
- * @access public
- */
- public function NZBPath($releaseGuid)
- {
- $nzbFile = $this->getNZBPath($releaseGuid);
- return (is_file($nzbFile) ? $nzbFile : false);
- }
-
- /**
- * Retrieve various information on a NZB file (the subject, # of pars,
- * file extensions, file sizes, file completion, group names, # of parts).
- *
- * @param string $nzb The NZB contents in a string.
- *
- * @return array $result Empty if not an NZB or the contents of the NZB.
- *
- * @access public
- */
- public function nzbFileList($nzb)
- {
- $num_pars = $i = 0;
- $result = array();
-
- if (!$nzb) {
- return $result;
- }
-
- $xml = @simplexml_load_string(str_replace("\x0F", '', $nzb));
- if (!$xml || strtolower($xml->getName()) !== 'nzb') {
- return $result;
- }
-
- foreach ($xml->file as $file) {
- // Subject.
- $title = (string)$file->attributes()->subject;
-
- // Amount of pars.
- if (stripos($title, '.par2')) {
- $num_pars++;
- }
-
- $result[$i]['title'] = $title;
-
- // Extensions.
- if (preg_match(
- '/\.(\d{2,3}|7z|ace|ai7|srr|srt|sub|aiff|asc|avi|audio|bin|bz2|'
- . 'c|cfc|cfm|chm|class|conf|cpp|cs|css|csv|cue|deb|divx|doc|dot|'
- . 'eml|enc|exe|file|gif|gz|hlp|htm|html|image|iso|jar|java|jpeg|'
- . 'jpg|js|lua|m|m3u|mkv|mm|mov|mp3|mp4|mpg|nfo|nzb|odc|odf|odg|odi|odp|'
- . 'ods|odt|ogg|par2|parity|pdf|pgp|php|pl|png|ppt|ps|py|r\d{2,3}|'
- . 'ram|rar|rb|rm|rpm|rtf|sfv|sig|sql|srs|swf|sxc|sxd|sxi|sxw|tar|'
- . 'tex|tgz|txt|vcf|video|vsd|wav|wma|wmv|xls|xml|xpi|xvid|zip7|zip)'
- . '[" ](?!(\)|\-))/i',
- $title, $ext
- )
- ) {
-
- if (preg_match('/\.r\d{2,3}/i', $ext[0])) {
- $ext[1] = 'rar';
- }
- $result[$i]['ext'] = strtolower($ext[1]);
- } else {
- $result[$i]['ext'] = '';
- }
-
- $fileSize = $numSegments = 0;
-
- // Parts.
- if (!isset($result[$i]['segments'])) {
- $result[$i]['segments'] = array();
- }
-
- // File size.
- foreach ($file->segments->segment as $segment) {
- array_push($result[$i]['segments'], (string) $segment);
- $fileSize += $segment->attributes()->bytes;
- $numSegments++;
- }
- $result[$i]['size'] = $fileSize;
-
- // File completion.
- if (preg_match('/(\d+)\)$/', $title, $parts)) {
- $result[$i]['partstotal'] = $parts[1];
- }
- $result[$i]['partsactual'] = $numSegments;
-
- // Groups.
- if (!isset($result[$i]['groups'])) {
- $result[$i]['groups'] = array();
- }
- foreach ($file->groups->group as $g) {
- array_push($result[$i]['groups'], (string) $g);
- }
-
- unset($result[$i]['segments']['@attributes']);
- $i++;
- }
- return $result;
- }
-
-}
\ No newline at end of file
diff --git a/lib/Film.php b/lib/Film.php
deleted file mode 100644
index ee8778545..000000000
--- a/lib/Film.php
+++ /dev/null
@@ -1,1477 +0,0 @@
- false,
- 'Logger' => null,
- 'ReleaseImage' => null,
- 'Settings' => null,
- 'TMDb' => null,
- ];
- $options += $defaults;
-
- $this->pdo = ($options['Settings'] instanceof DB ? $options['Settings'] : new DB());
- $s = new Sites();
- $this->site = $s->get();
- $this->releaseImage = ($options['ReleaseImage'] instanceof \ReleaseImage ? $options['ReleaseImage'] : new \ReleaseImage($this->pdo));
-
- $this->lookuplanguage = ($this->site->lookuplanguage != '') ? (string)$this->site->lookuplanguage : 'en';
-
- $this->tmdb = ($options['TMDb'] instanceof \TMDb ? $options['TMDb'] : new \TMDb($this->site->tmdbkey, $this->lookuplanguage));
-
- $this->fanartapikey = $this->site->fanarttvkey;
- $this->imdburl = ($this->site->imdburl == 0 ? false : true);
- $this->movieqty = ($this->site->maximdbprocessed != '') ? $this->site->maximdbprocessed : 100;
- $this->searchEngines = true;
- $this->showPasswords = ($this->site->showpasswordedrelease != '') ? $this->site->showpasswordedrelease : 0;
-
- $this->debug = NN_DEBUG;
- $this->echooutput = ($options['Echo'] && NN_ECHOCLI && $this->pdo->cli);
- $this->imgSavePath = NN_COVERS . 'movies' . DS;
- $this->service = '';
- $this->utility = new Utility();
-
- if (NN_DEBUG || NN_LOGGING) {
- $this->debug = true;
- try {
- $this->debugging = new \Logger();
- } catch (\LoggerException $error) {
- $this->_debug = false;
- }
- }
- }
-
- /**
- * Get info for a IMDB id.
- *
- * @param int $imdbId
- *
- * @return array|bool
- */
- public function getMovieInfo($imdbId)
- {
- return $this->pdo->queryOneRow(sprintf("SELECT * FROM movieinfo WHERE imdbid = %d", $imdbId));
- }
-
- /**
- * Get info for multiple IMDB id's.
- *
- * @param array $imdbIDs
- *
- * @return array
- */
- public function getMovieInfoMultiImdb($imdbIDs)
- {
- return $this->pdo->query(
- sprintf("
- SELECT DISTINCT movieinfo.*, releases.imdbid AS relimdb
- FROM movieinfo
- LEFT OUTER JOIN releases ON releases.imdbid = movieinfo.imdbid
- WHERE movieinfo.imdbid IN (%s)",
- str_replace(
- ',,',
- ',',
- str_replace(
- array('(,', ' ,', ', )', ',)'),
- '',
- implode(',', $imdbIDs)
- )
- )
- )
- );
- }
-
- /**
- * Get movies for movie-list admin page.
- *
- * @param int $start
- * @param int $num
- *
- * @return array
- */
- public function getRange($start, $num)
- {
- return $this->pdo->query(
- sprintf('
- SELECT *
- FROM movieinfo
- ORDER BY createddate DESC %s',
- ($start === false ? '' : ' LIMIT ' . $num . ' OFFSET ' . $start)
- )
- );
- }
-
- /**
- * Get count of movies for movie-list admin page.
- *
- * @return int
- */
- public function getCount()
- {
- $res = $this->pdo->queryOneRow('SELECT COUNT(id) AS num FROM movieinfo');
- return ($res === false ? 0 : $res['num']);
- }
-
- /**
- * Get count of movies for movies browse page.
- *
- * @param $cat
- * @param $maxAge
- * @param array $excludedCats
- *
- * @return int
- */
- public function getMovieCount($cat, $maxAge = -1, $excludedCats = [])
- {
- $catsrch = '';
- if (count($cat) > 0 && $cat[0] != -1) {
- $catsrch = (new \Category(['Settings' => $this->pdo]))->getCategorySearch($cat);
- }
-
- $res = $this->pdo->queryOneRow(
- sprintf("
- SELECT COUNT(DISTINCT r.imdbid) AS num
- FROM releases r
- INNER JOIN movieinfo m ON m.imdbid = r.imdbid
- WHERE r.nzbstatus = 1
- AND r.imdbid != '0000000'
- AND m.cover = 1
- AND m.title != ''
- AND r.passwordstatus <= %d
- AND %s %s %s %s ",
- $this->showPasswords,
- $this->getBrowseBy(),
- $catsrch,
- ($maxAge > 0 ? 'AND r.postdate > NOW() - INTERVAL ' . $maxAge . ' DAY' : ''),
- (count($excludedCats) > 0 ? ' AND r.categoryid NOT IN (' . implode(',', $excludedCats) . ')' : '')
- )
- );
-
- return ($res === false ? 0 : $res['num']);
- }
-
- /**
- * Get movie releases with covers for movie browse page.
- *
- * @param $cat
- * @param $start
- * @param $num
- * @param $orderBy
- * @param $maxAge
- * @param array $excludedCats
- *
- * @return bool|PDOStatement
- */
- public function getMovieRange($cat, $start, $num, $orderBy, $maxAge = -1, $excludedCats = [])
- {
- $catsrch = '';
- if (count($cat) > 0 && $cat[0] != -1) {
- $catsrch = (new \Category(['Settings' => $this->pdo]))->getCategorySearch($cat);
- }
-
- $order = $this->getMovieOrder($orderBy);
- $sql = sprintf("
- SELECT
- GROUP_CONCAT(r.id ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_id,
- GROUP_CONCAT(r.rarinnerfilecount ORDER BY r.postdate DESC SEPARATOR ',') as grp_rarinnerfilecount,
- GROUP_CONCAT(r.haspreview ORDER BY r.postdate DESC SEPARATOR ',') AS grp_haspreview,
- GROUP_CONCAT(r.passwordstatus ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_password,
- GROUP_CONCAT(r.guid ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_guid,
- GROUP_CONCAT(rn.id ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_nfoid,
- GROUP_CONCAT(groups.name ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_grpname,
- GROUP_CONCAT(r.searchname ORDER BY r.postdate DESC SEPARATOR '#') AS grp_release_name,
- GROUP_CONCAT(r.postdate ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_postdate,
- GROUP_CONCAT(r.size ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_size,
- GROUP_CONCAT(r.totalpart ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_totalparts,
- GROUP_CONCAT(r.comments ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_comments,
- GROUP_CONCAT(r.grabs ORDER BY r.postdate DESC SEPARATOR ',') AS grp_release_grabs,
- m.*, groups.name AS group_name, rn.id as nfoid FROM releases r
- LEFT OUTER JOIN groups ON groups.id = r.groupid
- LEFT OUTER JOIN releasenfo rn ON rn.releaseid = r.id
- INNER JOIN movieinfo m ON m.imdbid = r.imdbid
- WHERE r.nzbstatus = 1 AND r.imdbid != '0000000'
- AND m.title != ''
- AND r.passwordstatus <= %d AND %s %s %s %s
- GROUP BY m.imdbid ORDER BY %s %s %s",
- $this->showPasswords,
- $this->getBrowseBy(),
- $catsrch,
- ($maxAge > 0
- ? 'AND r.postdate > NOW() - INTERVAL ' . $maxAge . 'DAY '
- : ''
- ),
- (count($excludedCats) > 0 ? ' AND r.categoryid NOT IN (' . implode(',', $excludedCats) . ')' : ''),
- $order[0],
- $order[1],
- ($start === false ? '' : ' LIMIT ' . $num . ' OFFSET ' . $start)
- );
- return $this->pdo->queryDirect($sql);
- }
-
- /**
- * Get the order type the user requested on the movies page.
- *
- * @param $orderBy
- *
- * @return array
- */
- protected function getMovieOrder($orderBy)
- {
- $orderArr = explode('_', (($orderBy == '') ? 'MAX(r.postdate)' : $orderBy));
- switch ($orderArr[0]) {
- case 'title':
- $orderField = 'm.title';
- break;
- case 'year':
- $orderField = 'm.year';
- break;
- case 'rating':
- $orderField = 'm.rating';
- break;
- case 'posted':
- default:
- $orderField = 'MAX(r.postdate)';
- break;
- }
-
- return array($orderField, ((isset($orderArr[1]) && preg_match('/^asc|desc$/i', $orderArr[1])) ? $orderArr[1] : 'desc'));
- }
-
- /**
- * Order types for movies page.
- *
- * @return array
- */
- public function getMovieOrdering()
- {
- return array('title_asc', 'title_desc', 'year_asc', 'year_desc', 'rating_asc', 'rating_desc');
- }
-
- /**
- * @return string
- */
- protected function getBrowseBy()
- {
- $browseBy = ' ';
- $browseByArr = array('title', 'director', 'actors', 'genre', 'rating', 'year', 'imdb');
- foreach ($browseByArr as $bb) {
- if (isset($_REQUEST[$bb]) && !empty($_REQUEST[$bb])) {
- $bbv = stripslashes($_REQUEST[$bb]);
- if ($bb === 'rating') {
- $bbv .= '.';
- }
- if ($bb === 'imdb') {
- $browseBy .= 'm.' . $bb . 'id = ' . $bbv . ' AND ';
- } else {
- $browseBy .= 'm.' . $bb . ' ' . $this->pdo->likeString($bbv, true, true) . ' AND ';
- }
- }
- }
- return $browseBy;
- }
-
- /**
- * Create click-able links to IMDB actors/genres/directors/etc..
- *
- * @param $data
- * @param $field
- *
- * @return string
- */
- public function makeFieldLinks($data, $field)
- {
- if (!isset($data[$field]) || $data[$field] == '') {
- return '';
- }
-
- $tmpArr = explode(', ', $data[$field]);
- $newArr = [];
- $i = 0;
- foreach ($tmpArr as $ta) {
- if ($i > 5) {
- break;
- } //only use first 6
- $newArr[] = '' . $ta . '';
- $i++;
- }
- return implode(', ', $newArr);
- }
-
- /**
- * Update movie on movie-edit page.
- *
- * @param $id
- * @param $title
- * @param $tagLine
- * @param $plot
- * @param $year
- * @param $rating
- * @param $genre
- * @param $director
- * @param $actors
- * @param $language
- * @param $cover
- * @param $backdrop
- */
- public function update(
- $id = '', $title = '', $tagLine = '', $plot = '', $year = '', $rating = '', $genre = '', $director = '',
- $actors = '', $language = '', $cover = '', $backdrop = ''
- )
- {
- if (!empty($id)) {
-
- $this->pdo->queryExec(
- sprintf("
- UPDATE movieinfo
- SET %s, %s, %s, %s, %s, %s, %s, %s, %s, %d, %d, updateddate = NOW()
- WHERE imdbid = %d",
- (empty($title) ? '' : 'title = ' . $this->pdo->escapeString($title)),
- (empty($tagLine) ? '' : 'tagline = ' . $this->pdo->escapeString($tagLine)),
- (empty($plot) ? '' : 'plot = ' . $this->pdo->escapeString($plot)),
- (empty($year) ? '' : 'year = ' . $this->pdo->escapeString($year)),
- (empty($rating) ? '' : 'rating = ' . $this->pdo->escapeString($rating)),
- (empty($genre) ? '' : 'genre = ' . $this->pdo->escapeString($genre)),
- (empty($director) ? '' : 'director = ' . $this->pdo->escapeString($director)),
- (empty($actors) ? '' : 'actors = ' . $this->pdo->escapeString($actors)),
- (empty($language) ? '' : 'language = ' . $this->pdo->escapeString($language)),
- (empty($cover) ? '' : 'cover = ' . $cover),
- (empty($backdrop) ? '' : 'backdrop = ' . $backdrop),
- $id
- )
- );
- }
- }
-
- /**
- * Check if a variable is set and not a empty string.
- *
- * @param $variable
- *
- * @return string
- */
- protected function checkVariable(&$variable)
- {
- if (isset($variable) && $variable != '') {
- return true;
- }
- return false;
- }
-
- /**
- * Returns a tmdb or imdb variable, the one that is set. Empty string if both not set.
- *
- * @param string $variable1
- * @param string $variable2
- *
- * @return string
- */
- protected function setTmdbImdbVar(&$variable1, &$variable2)
- {
- if ($this->checkVariable($variable1)) {
- return $variable1;
- } elseif ($this->checkVariable($variable2)) {
- return $variable2;
- }
- return '';
- }
-
- /**
- * Fetch IMDB/TMDB info for the movie.
- *
- * @param $imdbId
- *
- * @return bool
- */
- public function updateMovieInfo($imdbId)
- {
- if ($this->echooutput && $this->service !== '') {
- $this->pdo->log->doEcho($this->pdo->log->primary("Fetching IMDB info from TMDB using IMDB id: " . $imdbId));
- }
-
- // Check TMDB for IMDB info.
- $tmdb = $this->fetchTMDBProperties($imdbId);
-
- // Check IMDB for movie info.
- $imdb = $this->fetchIMDBProperties($imdbId);
- if (!$imdb && !$tmdb) {
- return false;
- }
-
- // Check FanArt.tv for background images.
- $fanart = $this->fetchFanartTVProperties($imdbId);
-
- $mov = [];
-
- $mov['cover'] = $mov['backdrop'] = $mov['banner'] = $movieID = 0;
- $mov['type'] = $mov['director'] = $mov['actors'] = $mov['language'] = '';
-
- $mov['imdbid'] = $imdbId;
- $mov['tmdbid'] = (!isset($tmdb['tmdbid']) || $tmdb['tmdbid'] == '') ? 'NULL' : $tmdb['tmdbid'];
-
- // Prefer FanArt.tv cover over TMDB. And TMDB over IMDB.
- if ($this->checkVariable($fanart['cover'])) {
- $mov['cover'] = $this->releaseImage->saveImage($imdbId . '-cover', $fanart['cover'], $this->imgSavePath);
- } else if ($this->checkVariable($tmdb['cover'])) {
- $mov['cover'] = $this->releaseImage->saveImage($imdbId . '-cover', $tmdb['cover'], $this->imgSavePath);
- } else if ($this->checkVariable($imdb['cover'])) {
- $mov['cover'] = $this->releaseImage->saveImage($imdbId . '-cover', $imdb['cover'], $this->imgSavePath);
- }
-
- // Backdrops.
- if ($this->checkVariable($fanart['backdrop'])) {
- $mov['backdrop'] = $this->releaseImage->saveImage($imdbId . '-backdrop', $fanart['backdrop'], $this->imgSavePath, 1920, 1024);
- } else if ($this->checkVariable($tmdb['backdrop'])) {
- $mov['backdrop'] = $this->releaseImage->saveImage($imdbId . '-backdrop', $tmdb['backdrop'], $this->imgSavePath, 1920, 1024);
- }
-
- // Banner
- if ($this->checkVariable($fanart['banner'])) {
- $mov['banner'] = $this->releaseImage->saveImage($imdbId . '-banner', $fanart['banner'], $this->imgSavePath);
- }
-
- $mov['title'] = $this->setTmdbImdbVar($imdb['title'] , $tmdb['title']);
- $mov['rating'] = $this->setTmdbImdbVar($imdb['rating'] , $tmdb['rating']);
- $mov['plot'] = $this->setTmdbImdbVar($imdb['plot'] , $tmdb['plot']);
- $mov['tagline'] = $this->setTmdbImdbVar($imdb['tagline'], $tmdb['tagline']);
- $mov['year'] = $this->setTmdbImdbVar($imdb['year'] , $tmdb['year']);
- $mov['genre'] = $this->setTmdbImdbVar($imdb['genre'] , $tmdb['genre']);
-
- if ($this->checkVariable($imdb['type'])) {
- $mov['type'] = $imdb['type'];
- }
-
- if ($this->checkVariable($imdb['director'])) {
- $mov['director'] = (is_array($imdb['director'])) ? implode(', ', array_unique($imdb['director'])) : $imdb['director'];
- }
-
- if ($this->checkVariable($imdb['actors'])) {
- $mov['actors'] = (is_array($imdb['actors'])) ? implode(', ', array_unique($imdb['actors'])) : $imdb['actors'];
- }
-
- if ($this->checkVariable($imdb['language'])) {
- $mov['language'] = (is_array($imdb['language'])) ? implode(', ', array_unique($imdb['language'])) : $imdb['language'];
- }
-
- if (is_array($mov['genre'])) {
- $mov['genre'] = implode(', ', array_unique($mov['genre']));
- }
-
- if (is_array($mov['type'])) {
- $mov['type'] = implode(', ', array_unique($mov['type']));
- }
-
- $mov['title'] = html_entity_decode($mov['title'] , ENT_QUOTES, 'UTF-8');
- $mov['plot'] = html_entity_decode(preg_replace('/\s+See full summary »/', ' ', $mov['plot']), ENT_QUOTES, 'UTF-8');
- $mov['tagline'] = html_entity_decode($mov['tagline'] , ENT_QUOTES, 'UTF-8');
- $mov['genre'] = html_entity_decode($mov['genre'] , ENT_QUOTES, 'UTF-8');
- $mov['director'] = html_entity_decode($mov['director'], ENT_QUOTES, 'UTF-8');
- $mov['actors'] = html_entity_decode($mov['actors'] , ENT_QUOTES, 'UTF-8');
- $mov['language'] = html_entity_decode($mov['language'], ENT_QUOTES, 'UTF-8');
-
- $mov['type'] = html_entity_decode(ucwords(preg_replace('/[\.\_]/', ' ', $mov['type'])), ENT_QUOTES, 'UTF-8');
-
- $mov['title'] = str_replace(array('/', '\\'), '', $mov['title']);
- $movieID = $this->pdo->queryInsert(
- sprintf("
- INSERT INTO movieinfo
- (imdbid, tmdbID, title, rating, tagline, plot, year, genre, type,
- director, actors, language, cover, backdrop, banner, createddate, updateddate)
- VALUES
- (%d, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %d, %d, %d, NOW(), NOW())
- ON DUPLICATE KEY UPDATE
- imdbid = %d, tmdbID = %s, title = %s, rating = %s, tagline = %s, plot = %s, year = %s, genre = %s,
- type = %s, director = %s, actors = %s, language = %s, cover = %d, backdrop = %d, banner = %d, updateddate = NOW()",
- $mov['imdbid'],
- $mov['tmdbid'],
- $this->pdo->escapeString($mov['title']),
- $this->pdo->escapeString($mov['rating']),
- $this->pdo->escapeString($mov['tagline']),
- $this->pdo->escapeString($mov['plot']),
- $this->pdo->escapeString($mov['year']),
- $this->pdo->escapeString(substr($mov['genre'], 0, 64)),
- $this->pdo->escapeString($mov['type']),
- $this->pdo->escapeString($mov['director']),
- $this->pdo->escapeString($mov['actors']),
- $this->pdo->escapeString(substr($mov['language'], 0, 64)),
- $mov['cover'],
- $mov['backdrop'],
- $mov['banner'],
- $mov['imdbid'],
- $mov['tmdbid'],
- $this->pdo->escapeString($mov['title']),
- $this->pdo->escapeString($mov['rating']),
- $this->pdo->escapeString($mov['tagline']),
- $this->pdo->escapeString($mov['plot']),
- $this->pdo->escapeString($mov['year']),
- $this->pdo->escapeString(substr($mov['genre'], 0, 64)),
- $this->pdo->escapeString($mov['type']),
- $this->pdo->escapeString($mov['director']),
- $this->pdo->escapeString($mov['actors']),
- $this->pdo->escapeString(substr($mov['language'], 0, 64)),
- $mov['cover'],
- $mov['backdrop'],
- $mov['banner']
- )
- );
-
- if ($this->echooutput && $this->service !== '') {
- $this->pdo->log->doEcho(
- $this->pdo->log->headerOver(($movieID !== 0 ? 'Added/updated movie: ' : 'Nothing to update for movie: ')) .
- $this->pdo->log->primary($mov['title'] .
- ' (' .
- $mov['year'] .
- ') - ' .
- $mov['imdbid']
- )
- );
- }
-
- return ($movieID === 0 ? false : true);
- }
-
- /**
- * Fetch FanArt.tv backdrop / cover / title.
- *
- * @param $imdbId
- *
- * @return bool|array
- */
- protected function fetchFanartTVProperties($imdbId)
- {
- if ($this->fanartapikey != '')
- {
- $buffer = Utility::getUrl(['url' => 'https://webservice.fanart.tv/v3/movies/' . 'tt' . $imdbId . '?api_key=' . $this->fanartapikey , 'verifycert' => false]);
- if ($buffer !== false) {
- $art = json_decode($buffer, true);
- if (isset($art['status']) && $art['status'] === 'error') {
- return false;
- }
- $ret = [];
- if (isset($art['moviebackground'][0]['url'])) {
- $ret['backdrop'] = $art['moviebackground'][0]['url'];
- } else if (isset($art['moviethumb'][0]['url'])) {
- $ret['backdrop'] = $art['moviethumb'][0]['url'];
- }
- if (isset($art['movieposter'][0]['url'])) {
- $ret['cover'] = $art['movieposter'][0]['url'];
- }
- if (isset($art['moviebanner'][0]['url'])) {
- $ret['banner'] = $art['moviebanner'][0]['url'];
- }
-
- if (isset($ret['backdrop']) && isset($ret['cover'])) {
- $ret['title'] = $imdbId;
- if (isset($art['name'])) {
- $ret['title'] = $art['name'];
- }
- if ($this->echooutput) {
- $this->pdo->log->doEcho($this->pdo->log->alternateOver("Fanart Found ") . $this->pdo->log->headerOver($ret['title']));
- }
- return $ret;
- }
- }
- }
- return false;
- }
-
- /**
- * Fetch info for IMDB id from TMDB.
- *
- * @param $imdbId
- * @param bool $text
- *
- * @return array|bool
- */
- public function fetchTMDBProperties($imdbId, $text = false)
- {
- $lookupId = ($text === false ? 'tt' . $imdbId : $imdbId);
-
- try {
- $tmdbLookup = $this->tmdb->getMovie($lookupId);
- } catch (exception $e) {
- return false;
- }
-
- if (!$tmdbLookup || (isset($tmdbLookup['status_code']) && $tmdbLookup['status_code'] !== 1)) {
- return false;
- }
-
- $ret = [];
- $ret['title'] = $tmdbLookup['title'];
-
- if ($this->currentTitle !== '') {
- // Check the similarity.
- similar_text($this->currentTitle, $ret['title'], $percent);
- if ($percent < 40) {
- if ($this->debug) {
- $this->debugging->log(
- 'Film',
- 'fetchTmdbProperties',
- 'Found (' .
- $ret['title'] .
- ') from TMDB, but it\'s only ' .
- $percent .
- '% similar to (' .
- $this->currentTitle . ')',
- \Logger::LOG_INFO
- );
- }
- return false;
- }
- }
-
- $ret['tmdbid'] = $tmdbLookup['id'];
- $ImdbID = str_replace('tt', '', $tmdbLookup['imdb_id']);
- $ret['imdb_id'] = $ImdbID;
- if (isset($tmdbLookup['vote_average'])) {
- $ret['rating'] = ($tmdbLookup['vote_average'] == 0) ? '' : $tmdbLookup['vote_average'];
- }
- if (isset($tmdbLookup['overview'])) {
- $ret['plot'] = $tmdbLookup['overview'];
- }
- if (isset($tmdbLookup['tagline'])) {
- $ret['tagline'] = $tmdbLookup['tagline'];
- }
- if (isset($tmdbLookup['release_date'])) {
- $ret['year'] = date("Y", strtotime($tmdbLookup['release_date']));
- }
- if (isset($tmdbLookup['genres']) && sizeof($tmdbLookup['genres']) > 0) {
- $genres = [];
- foreach ($tmdbLookup['genres'] as $genre) {
- $genres[] = $genre['name'];
- }
- $ret['genre'] = $genres;
- }
- if (isset($tmdbLookup['poster_path']) && sizeof($tmdbLookup['poster_path']) > 0) {
- $ret['cover'] = "http://image.tmdb.org/t/p/w185" . $tmdbLookup['poster_path'];
- }
- if (isset($tmdbLookup['backdrop_path']) && sizeof($tmdbLookup['backdrop_path']) > 0) {
- $ret['backdrop'] = "http://image.tmdb.org/t/p/original" . $tmdbLookup['backdrop_path'];
- }
- if ($this->echooutput) {
- $this->pdo->log->doEcho($this->pdo->log->primaryOver("TMDb Found ") . $this->pdo->log->headerOver($ret['title']), true);
- }
- return $ret;
- }
-
- /**
- * @param $imdbId
- *
- * @return array|bool
- */
- protected function fetchIMDBProperties($imdbId)
- {
- $imdb_regex = array(
- 'title' => '/
(.*?)\s?\(.*?<\/title>/i',
- 'tagline' => '/taglines:<\/h4>\s([^<]+)/i',
- 'plot' => '/\s*?(.*?)\s*?<\/p>/i',
- 'rating' => '/"ratingValue">([\d.]+)<\/span>/i',
- 'year' => '/
.*?\(.*?(\d{4}).*?<\/title>/i',
- 'cover' => '//'
- );
-
- $imdb_regex_multi = array(
- 'genre' => '/href="\/genre\/(.*?)\?/i',
- 'language' => '//i'
- );
-
- $buffer =
- Utility::getUrl([
- 'url' => 'http://' . ($this->imdburl === false ? 'www' : 'akas') . '.imdb.com/title/tt' . $imdbId . '/',
- 'language' => (($this->site->lookuplanguage != '') ? $this->site->lookuplanguage : 'en'),
- 'useragent' => 'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) ' .
- 'Version/4.0.4 Mobile/7B334b Safari/531.21.102011-10-16 20:23:10', 'foo=bar'
- ]
- );
-
- if ($buffer !== false) {
- $ret = [];
- foreach ($imdb_regex as $field => $regex) {
- if (preg_match($regex, $buffer, $matches)) {
- $match = $matches[1];
- $match1 = strip_tags(trim(rtrim($match)));
- $ret[$field] = $match1;
- }
- }
-
- $matches = [];
- foreach ($imdb_regex_multi as $field => $regex) {
- if (preg_match_all($regex, $buffer, $matches)) {
- $match2 = $matches[1];
- $match3 = array_map("trim", $match2);
- $ret[$field] = $match3;
- }
- }
-
- if ($this->currentTitle !== '' && isset($ret['title'])) {
- // Check the similarity.
- similar_text($this->currentTitle, $ret['title'], $percent);
- if ($percent < 40) {
- if ($this->debug) {
- $this->debugging->log(
- 'Film',
- 'fetchImdbProperties',
- 'Found (' .
- $ret['title'] .
- ') from IMDB, but it\'s only ' .
- $percent .
- '% similar to (' .
- $this->currentTitle . ')',
- \Logger::LOG_INFO
- );
- }
- return false;
- }
- }
-
- // Actors.
- if (preg_match('/(.+?)<\/table>/s', $buffer, $hit)) {
- if (preg_match_all('/\s*(.+?)\s*<\/span>/i', $hit[0], $results, PREG_PATTERN_ORDER)) {
- $ret['actors'] = $results[1];
- }
- }
-
- // Directors.
- if (preg_match('/itemprop="directors?".+?<\/div>/s', $buffer, $hit)) {
- if (preg_match_all('/"name">(.*?)<\/span>/is', $hit[0], $results, PREG_PATTERN_ORDER)) {
- $ret['director'] = $results[1];
- }
- }
- if ($this->echooutput && isset($ret['title'])) {
- $this->pdo->log->doEcho($this->pdo->log->headerOver("IMDb Found ") . $this->pdo->log->primaryOver($ret['title']), true);
- }
- return $ret;
- }
- return false;
- }
-
- /**
- * Update a release with a IMDB id.
- *
- * @param string $buffer Data to parse a IMDB id from.
- * @param string $service Method that called this method.
- * @param int $id id of the release.
- * @param int $processImdb To get IMDB info on this IMDB id or not.
- *
- * @return string
- */
- public function doMovieUpdate($buffer, $service, $id, $processImdb = 1)
- {
- $imdbID = false;
- if (preg_match('/(?:imdb.*?)?(?:tt|Title\?)(?P\d{5,7})/i', $buffer, $matches)) {
- $imdbID = $matches['imdbid'];
- }
-
- if ($imdbID !== false) {
- $this->service = $service;
- if ($this->echooutput && $this->service !== '') {
- $this->pdo->log->doEcho($this->pdo->log->headerOver($service . ' found IMDBid: ') . $this->pdo->log->primary('tt' . $imdbID));
- }
-
- $this->pdo->queryExec(sprintf('UPDATE releases SET imdbid = %s WHERE id = %d', $this->pdo->escapeString($imdbID), $id));
-
- // If set, scan for imdb info.
- if ($processImdb == 1) {
- $movCheck = $this->getMovieInfo($imdbID);
- if ($movCheck === false || (isset($movCheck['updateddate']) && (time() - strtotime($movCheck['updateddate'])) > 2592000)) {
- if ($this->updateMovieInfo($imdbID) === false) {
- $this->pdo->queryExec(sprintf('UPDATE releases SET imdbid = %s WHERE id = %d', 0000000, $id));
- }
- }
- }
- }
- return $imdbID;
- }
-
- /**
- * Process releases with no IMDB id's.
- *
- * @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.
- * @param int $lookupIMDB (Optional) 0 Don't lookup IMDB, 1 lookup IMDB, 2 lookup IMDB on releases that were renamed.
- */
- public function processMovieReleases($groupID = '', $guidChar = '', $lookupIMDB = 1)
- {
- if ($lookupIMDB == 0) {
- return;
- }
- $trakTv = new \TraktTv(['Settings' => $this->pdo]);
-
- // Get all releases without an IMDB id.
- $res = $this->pdo->query(
- sprintf("
- SELECT r.searchname, r.id
- FROM releases r
- WHERE r.imdbid IS NULL
- AND r.nzbstatus = 1
- AND r.categoryid BETWEEN 2000 AND 2999
- %s %s %s
- LIMIT %d",
- ($groupID === '' ? '' : ('AND r.groupid = ' . $groupID)),
- ($guidChar === '' ? '' : ('AND r.guid ' . $this->pdo->likeString($guidChar, false, true))),
- ($lookupIMDB == 2 ? 'AND r.isrenamed = 1' : ''),
- $this->movieqty
- )
- );
- $movieCount = count($res);
-
- if ($movieCount > 0) {
- if ($this->echooutput && $movieCount > 1) {
- $this->pdo->log->doEcho($this->pdo->log->header("Processing " . $movieCount . " movie releases."));
- }
-
- // Loop over releases.
- foreach ($res as $arr) {
- // Try to get a name/year.
- if ($this->parseMovieSearchName($arr['searchname']) === false) {
- //We didn't find a name, so set to all 0's so we don't parse again.
- $this->pdo->queryExec(sprintf("UPDATE releases SET imdbid = 0000000 WHERE id = %d", $arr["id"]));
- continue;
-
- } else {
- $this->currentRelID = $arr['id'];
-
- $movieName = $this->currentTitle;
- if ($this->currentYear !== false) {
- $movieName .= ' (' . $this->currentYear . ')';
- }
-
- if ($this->echooutput) {
- $this->pdo->log->doEcho($this->pdo->log->primaryOver("Looking up: ") . $this->pdo->log->headerOver($movieName), true);
- }
-
- // Check local DB.
- $getIMDBid = $this->localIMDBsearch();
-
- if ($getIMDBid !== false) {
- $imdbID = $this->doMovieUpdate('tt' . $getIMDBid, 'Local DB', $arr['id']);
- if ($imdbID !== false) {
- continue;
- }
- }
-
- // Check OMDB api.
- $buffer =
- Utility::getUrl([
- 'url' => 'http://www.omdbapi.com/?t=' .
- urlencode($this->currentTitle) .
- ($this->currentYear !== false ? ('&y=' . $this->currentYear) : '') .
- '&r=json'
- ]
- );
-
- if ($buffer !== false) {
- $getIMDBid = json_decode($buffer);
-
- if (isset($getIMDBid->imdbid)) {
- $imdbID = $this->doMovieUpdate($getIMDBid->imdbid, 'OMDbAPI', $arr['id']);
- if ($imdbID !== false) {
- continue;
- }
- }
- }
-
- // Check on trakt.
- $getIMDBid = $trakTv->traktMoviesummary($movieName);
- if ($getIMDBid !== false) {
- $imdbID = $this->doMovieUpdate($getIMDBid, 'Trakt', $arr['id']);
- if ($imdbID !== false) {
- continue;
- }
- }
-
- // Try on search engines.
- if ($this->searchEngines && $this->currentYear !== false) {
- if ($this->imdbIDFromEngines() === true) {
- continue;
- }
- }
-
- // We failed to get an IMDB id from all sources.
- $this->pdo->queryExec(sprintf("UPDATE releases SET imdbid = 0000000 WHERE id = %d", $arr["id"]));
- }
- }
- }
- }
-
- /**
- * Try to fetch an IMDB id locally.
- *
- * @return int|bool Int, the imdbid when true, Bool when false.
- */
- protected function localIMDBsearch()
- {
- $query = 'SELECT imdbid FROM movieinfo';
- $andYearIn = '';
-
- //If we found a year, try looking in a 4 year range.
- if ($this->currentYear !== false) {
- $start = (int) $this->currentYear - 2;
- $end = (int) $this->currentYear + 2;
- $andYearIn = 'AND year IN (';
- while ($start < $end) {
- $andYearIn .= $start . ',';
- $start++;
- }
- $andYearIn .= $end . ')';
- }
- $IMDBCheck = $this->pdo->queryOneRow(
- sprintf('%s WHERE title %s %s', $query, $this->pdo->likeString($this->currentTitle), $andYearIn));
-
- // Look by %word%word%word% etc..
- if ($IMDBCheck === false) {
- $pieces = explode(' ', $this->currentTitle);
- $tempTitle = '%';
- foreach ($pieces as $piece) {
- $tempTitle .= str_replace(array("'", "!", '"'), '', $piece) . '%';
- }
- $IMDBCheck = $this->pdo->queryOneRow(
- sprintf("%s WHERE replace(replace(title, \"'\", ''), '!', '') %s %s",
- $query, $this->pdo->likeString($tempTitle), $andYearIn
- )
- );
- }
-
- // Try replacing er with re ?
- if ($IMDBCheck === false) {
- $tempTitle = str_replace('er', 're', $this->currentTitle);
- if ($tempTitle !== $this->currentTitle) {
- $IMDBCheck = $this->pdo->queryOneRow(
- sprintf('%s WHERE title %s %s',
- $query, $this->pdo->likeString($tempTitle), $andYearIn
- )
- );
-
- // Final check if everything else failed.
- if ($IMDBCheck === false) {
- $pieces = explode(' ', $tempTitle);
- $tempTitle = '%';
- foreach ($pieces as $piece) {
- $tempTitle .= str_replace(array("'", "!", '"'), "", $piece) . '%';
- }
- $IMDBCheck = $this->pdo->queryOneRow(
- sprintf("%s WHERE replace(replace(replace(title, \"'\", ''), '!', ''), '\"', '') %s %s",
- $query, $this->pdo->likeString($tempTitle), $andYearIn
- )
- );
- }
- }
- }
-
- return (
- ($IMDBCheck === false
- ? false
- : (is_numeric($IMDBCheck['imdbid'])
- ? (int)$IMDBCheck['imdbid']
- : false
- )
- )
- );
- }
-
- /**
- * Try to get an IMDB id from search engines.
- *
- * @return bool
- */
- protected function imdbIDFromEngines()
- {
- if ($this->googleLimit < 41 && (time() - $this->googleBan) > 600) {
- if ($this->googleSearch() === true) {
- return true;
- }
- }
-
- if ($this->yahooLimit < 41) {
- if ($this->yahooSearch() === true) {
- return true;
- }
- }
-
- // Not using this right now because bing's advanced search is not good enough.
- /*if ($this->bingLimit < 41) {
- if ($this->bingSearch() === true) {
- return true;
- }
- }*/
-
- return false;
- }
-
- /**
- * Try to find a IMDB id on google.com
- *
- * @return bool
- */
- protected function googleSearch()
- {
- $buffer =Utility::getUrl([
- 'url' =>
- 'https://www.google.com/search?hl=en&as_q=&as_epq=' .
- urlencode(
- $this->currentTitle .
- ' ' .
- $this->currentYear
- ) .
- '&as_oq=&as_eq=&as_nlo=&as_nhi=&lr=&cr=&as_qdr=all&as_sitesearch=' .
- urlencode('www.imdb.com/title/') .
- '&as_occt=title&safe=images&tbs=&as_filetype=&as_rights='
- ]
- );
-
- // Make sure we got some data.
- if ($buffer !== false) {
- $this->googleLimit++;
-
- if (preg_match('/(To continue, please type the characters below)|(- did not match any documents\.)/i', $buffer, $matches)) {
- if (!empty($matches[1])) {
- $this->googleBan = time();
- }
- } else if ($this->doMovieUpdate($buffer, 'Google.com', $this->currentRelID) !== false) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Try to find a IMDB id on bing.com
- *
- * @return bool
- */
- protected function bingSearch()
- {
- $buffer = Utility::getUrl([
- 'url' =>
- "http://www.bing.com/search?q=" .
- urlencode(
- '("' .
- $this->currentTitle .
- '" and "' .
- $this->currentYear .
- '") site:www.imdb.com/title/'
- ) .
- '&qs=n&form=QBLH&filt=all'
- ]
- );
-
- if ($buffer !== false) {
- $this->bingLimit++;
-
- if ($this->doMovieUpdate($buffer, 'Bing.com', $this->currentRelID) !== false) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Try to find a IMDB id on yahoo.com
- *
- * @return bool
- */
- protected function yahooSearch()
- {
- $buffer = Utility::getUrl([
- 'url' =>
- "http://search.yahoo.com/search?n=10&ei=UTF-8&va_vt=title&vo_vt=any&ve_vt=any&vp_vt=any&vf=all&vm=p&fl=0&fr=fp-top&p=intitle:" .
- urlencode(
- 'intitle:' .
- implode(' intitle:',
- explode(
- ' ',
- preg_replace(
- '/\s+/',
- ' ',
- preg_replace(
- '/\W/',
- ' ',
- $this->currentTitle
- )
- )
- )
- ) .
- ' intitle:' .
- $this->currentYear
- ) .
- '&vs=' .
- urlencode('www.imdb.com/title/')
- ]
- );
-
- if ($buffer !== false) {
- $this->yahooLimit++;
-
- if ($this->doMovieUpdate($buffer, 'Yahoo.com', $this->currentRelID) !== false) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Parse a movie name from a release search name.
- *
- * @param string $releaseName
- *
- * @return bool
- */
- protected function parseMovieSearchName($releaseName)
- {
- $name = $year = '';
- $followingList = '[^\w]((1080|480|720)p|AC3D|Directors([^\w]CUT)?|DD5\.1|(DVD|BD|BR)(Rip)?|BluRay|divx|HDTV|iNTERNAL|LiMiTED|(Real\.)?Proper|RE(pack|Rip)|Sub\.?(fix|pack)|Unrated|WEB-DL|(x|H)[-._ ]?264|xvid)[^\w]';
-
- /* Initial scan of getting a year/name.
- * [\w. -]+ Gets 0-9a-z. - characters, most scene movie titles contain these chars.
- * ie: [61420]-[FULL]-[a.b.foreignEFNet]-[ Coraline.2009.DUTCH.INTERNAL.1080p.BluRay.x264-VeDeTT ]-[21/85] - "vedett-coralien-1080p.r04" yEnc
- * Then we look up the year, (19|20)\d\d, so $matches[1] would be Coraline $matches[2] 2009
- */
- if (preg_match('/(?P[\w. -]+)[^\w](?P(19|20)\d\d)/i', $releaseName, $matches)) {
- $name = $matches['name'];
- $year = $matches['year'];
-
- /* If we didn't find a year, try to get a name anyways.
- * Try to look for a title before the $followingList and after anything but a-z0-9 two times or more (-[ for example)
- */
- } else if (preg_match('/([^\w]{2,})?(?P[\w .-]+?)' . $followingList . '/i', $releaseName, $matches)) {
- $name = $matches['name'];
- }
-
- // Check if we got something.
- if ($name !== '') {
-
- // If we still have any of the words in $followingList, remove them.
- $name = preg_replace('/' . $followingList . '/i', ' ', $name);
- // Remove periods, underscored, anything between parenthesis.
- $name = preg_replace('/\(.*?\)|[._]/i', ' ', $name);
- // Finally remove multiple spaces and trim leading spaces.
- $name = trim(preg_replace('/\s{2,}/', ' ', $name));
- // Check if the name is long enough and not just numbers.
- if (strlen($name) > 4 && !preg_match('/^\d+$/', $name)) {
- if ($this->debug && $this->echooutput) {
- $this->pdo->log->doEcho("DB name: {$releaseName}", true);
- }
- $this->currentTitle = $name;
- $this->currentYear = ($year === '' ? false : $year);
- return true;
- }
- }
- return false;
- }
-
- /**
- * Get upcoming movies.
- *
- * @param $type
- * @param string $source
- *
- * @return array|bool
- */
- public function getUpcoming($type, $source = 'rottentomato')
- {
- $list = $this->pdo->queryOneRow(
- sprintf('SELECT * FROM upcoming WHERE source = %s AND typeID = %d', $this->pdo->escapeString($source), $type)
- );
- if ($list === false) {
- $this->updateUpcoming();
- $list = $this->pdo->queryOneRow(
- sprintf('SELECT * FROM upcoming WHERE source = %s AND typeID = %d', $this->pdo->escapeString($source), $type)
- );
- }
- return $list;
- }
-
- /**
- * Update upcoming movies.
- */
- public function updateUpcoming()
- {
- if ($this->echooutput) {
- $this->pdo->log->doEcho($this->pdo->log->header('Updating movie schedule using rotten tomatoes.'));
- }
-
- $rt = new \RottenTomato($this->site->rottentomatokey);
-
- if ($rt instanceof \RottenTomato) {
-
- $this->_getRTData('boxoffice', $rt);
- $this->_getRTData('theaters', $rt);
- $this->_getRTData('opening', $rt);
- $this->_getRTData('upcoming', $rt);
- $this->_getRTData('dvd', $rt);
-
- if ($this->echooutput) {
- $this->pdo->log->doEcho($this->pdo->log->header("Updated successfully."));
- }
-
- } else if ($this->echooutput) {
- $this->pdo->log->doEcho($this->pdo->log->header("Error retrieving your RottenTomato API Key. Exiting..." . PHP_EOL));
- }
- }
-
- protected function _getRTData($operation = '', $rt)
- {
- $count = 0;
- $check = false;
-
- do {
- $count++;
-
- switch ($operation) {
- case 'boxoffice':
- $data = $rt->getBoxOffice();
- $update = \Film::SRC_BOXOFFICE;
- break;
- case 'theaters':
- $data = $rt->getInTheaters();
- $update = \Film::SRC_INTHEATRE;
- break;
- case 'opening':
- $data = $rt->getOpening();
- $update = \Film::SRC_OPENING;
- break;
- case 'upcoming':
- $data = $rt->getUpcoming();
- $update = \Film::SRC_UPCOMING;
- break;
- case 'dvd':
- $data = $rt->getDVDReleases();
- $update = \Film::SRC_DVD;
- break;
- default:
- $data = false;
- $update = 0;
- }
-
- if ($data !== false && $data !== '') {
- $test = @json_decode($data);
- if (isset($test)) {
- $count = 2;
- $check = true;
- }
- }
-
- } while ($count < 2);
-
- if ($check === true) {
-
- $success = $this->updateInsUpcoming('rottentomato', $update, $data);
-
- if ($this->echooutput) {
- if ($success !== false) {
- $this->pdo->log->doEcho($this->pdo->log->header(sprintf("Added/updated movies to the %s list.", $operation)));
- } else {
- $this->pdo->log->doEcho($this->pdo->log->primary(sprintf("No new updates for %s list.", $operation)));
- }
- }
-
- } else {
- exit(PHP_EOL . $this->pdo->log->error("Unable to fetch from Rotten Tomatoes, verify your API Key." . PHP_EOL));
- }
- }
-
- /**
- * Update upcoming table.
- *
- * @param $source
- * @param $type
- * @param $info
- *
- * @return bool|int
- */
- protected function updateInsUpcoming($source, $type, $info)
- {
- return $this->pdo->queryExec(
- sprintf("
- INSERT INTO upcoming (source, typeID, info, updateddate)
- VALUES (%s, %d, %s, NOW())
- ON DUPLICATE KEY UPDATE info = %s",
- $this->pdo->escapeString($source),
- $type,
- $this->pdo->escapeString($info),
- $this->pdo->escapeString($info)
- )
- );
- }
-
- /**
- * Get IMDB genres.
- *
- * @return array
- */
- public function getGenres()
- {
- return array(
- 'Action',
- 'Adventure',
- 'Animation',
- 'Biography',
- 'Comedy',
- 'Crime',
- 'Documentary',
- 'Drama',
- 'Family',
- 'Fantasy',
- 'Film-Noir',
- 'Game-Show',
- 'History',
- 'Horror',
- 'Music',
- 'Musical',
- 'Mystery',
- 'News',
- 'Reality-TV',
- 'Romance',
- 'Sci-Fi',
- 'Sport',
- 'Talk-Show',
- 'Thriller',
- 'War',
- 'Western'
- );
- }
-
-}
\ No newline at end of file
diff --git a/lib/IRCClient.php b/lib/IRCClient.php
deleted file mode 100644
index 535680a0d..000000000
--- a/lib/IRCClient.php
+++ /dev/null
@@ -1,722 +0,0 @@
- string(The nick name of the person who posted.),
- * 'channel' => string(The channel name.),
- * 'message' => string(The message the person posted.)
- * );
- *
- * @note Used with the processChannelMessages() function.
- * @var array
- * @access protected
- */
- protected $_channelData = array();
-
- /**
- * Nick name when we log in.
- *
- * @var string
- * @access protected
- */
- protected $_nickName;
-
- /**
- * User name when we log in.
- *
- * @var string
- * @access protected
- */
- protected $_userName;
-
- /**
- * "Real" name when we log in.
- *
- * @var string
- * @access protected
- */
- protected $_realName;
-
- /**
- * Password when we log in.
- *
- * @var string
- * @access protected
- */
- protected $_password;
-
- /**
- * List of channels and passwords to join.
- *
- * @var array
- * @access protected
- */
- protected $_channels;
-
- /**
- * Last time we received a ping or sent a ping to the server.
- *
- * @var int
- * @access protected
- */
- protected $_lastPing;
-
- /**
- * How many times we've tried to reconnect to IRC.
- *
- * @var int
- * @access protected
- */
- protected $_currentRetries = 0;
-
- /**
- * Turns on or off debugging.
- *
- * @var bool
- */
- protected $_debug = true;
-
- /**
- * Are we already logged in to IRC?
- *
- * @var bool
- */
- protected $_alreadyLoggedIn = false;
-
- /**
- * Disconnect from IRC.
- *
- * @access public
- */
- public function __destruct()
- {
- $this->quit();
- }
-
- /**
- * Time before giving up when trying to read or write to the IRC server.
- * The default is fine, it will ping the server if the server does not ping us
- * within this time to keep the connection alive.
- *
- * @param int $timeout Seconds.
- *
- * @access public
- */
- public function setSocketTimeout($timeout)
- {
- if (!is_numeric($timeout)) {
- echo 'ERROR: IRC socket timeout must be a number!' . PHP_EOL;
- } else {
- $this->_socket_timeout = $timeout;
- }
- }
-
- /**
- * Amount of time to wait before giving up when connecting.
- *
- * @param int $timeout Seconds.
- *
- * @access public
- */
- public function setConnectionTimeout($timeout)
- {
- if (!is_numeric($timeout)) {
- echo 'ERROR: IRC connection timeout must be a number!' . PHP_EOL;
- } else {
- $this->_remote_connection_timeout = $timeout;
- }
- }
-
- /**
- * Amount of times to retry before giving up when connecting.
- *
- * @param int $retries
- *
- * @access public
- */
- public function setConnectionRetries($retries)
- {
- if (!is_numeric($retries)) {
- echo 'ERROR: IRC connection retries must be a number!' . PHP_EOL;
- } else {
- $this->_reconnectRetries = $retries;
- }
- }
-
- /**
- * Amount of time to wait between failed connects.
- *
- * @param int $delay Seconds.
- *
- * @access public
- */
- public function setReConnectDelay($delay)
- {
- if (!is_numeric($delay)) {
- echo 'ERROR: IRC reconnect delay must be a number!' . PHP_EOL;
- } else {
- $this->_reconnectDelay = $delay;
- }
- }
-
- /**
- * Connect to a IRC server.
- *
- * @param string $hostname Host name of the IRC server (can be a IP or a name).
- * @param int $port Port number of the IRC server.
- * @param bool $tls Use encryption for the socket transport? (make sure the port is right).
- *
- * @return bool
- *
- * @access public
- */
- public function connect($hostname, $port = 6667, $tls = false)
- {
- $this->_alreadyLoggedIn = false;
- $transport = ($tls === true ? 'tls' : 'tcp');
-
- $socket_string = $transport . '://' . $hostname . ':' . $port;
- if ($socket_string !== $this->_remote_socket_string || !$this->_connected()) {
- if (!is_string($hostname) || $hostname == '') {
- echo 'ERROR: IRC host name must not be empty!' . PHP_EOL;
-
- return false;
- }
-
- if (!is_numeric($port)) {
- echo 'ERROR: IRC port must be a number!' . PHP_EOL;
-
- return false;
- }
-
- $this->_remote_host = $hostname;
- $this->_remote_port = $port;
- $this->_remote_transport = $transport;
- $this->_remote_tls = $tls;
- $this->_remote_socket_string = $socket_string;
-
- // Try to connect until we run out of retries.
- while ($this->_reconnectRetries >= $this->_currentRetries++) {
- $this->_initiateStream();
- if ($this->_connected()) {
- break;
- } else {
- // Sleep between retries.
- sleep($this->_reconnectDelay);
- }
- }
- } else {
- $this->_alreadyLoggedIn = true;
- }
-
- // Set last ping time to now.
- $this->_lastPing = time();
- // Reset retries.
- $this->_currentRetries = $this->_reconnectRetries;
-
- return $this->_connected();
- }
-
- /**
- * Log in to a IRC server.
- *
- * @param string $nickName The nick name - visible in the channel.
- * @param string $userName The user name - visible in the host name.
- * @param string $realName The real name - visible in the WhoIs.
- * @param null $password The password - some servers require a password.
- *
- * @return bool
- *
- * @access public
- */
- public function login($nickName, $userName, $realName, $password = null)
- {
- if (!$this->_connected()) {
- echo 'ERROR: You must connect to IRC first!' . PHP_EOL;
-
- return false;
- }
-
- if (empty($nickName) || empty($userName) || empty($realName)) {
- echo 'ERROR: nick/user/real name must not be empty!' . PHP_EOL;
-
- return false;
- }
-
- $this->_nickName = $nickName;
- $this->_userName = $userName;
- $this->_realName = $realName;
- $this->_password = $password;
-
- if (($password !== null && !empty($password)) && !$this->_writeSocket('PASSWORD ' . $password)) {
- return false;
- }
-
- if (!$this->_writeSocket('NICK ' . $nickName)) {
- return false;
- }
-
- if (!$this->_writeSocket('USER ' . $userName . ' 0 * :' . $realName)) {
- return false;
- }
-
- // Loop over socket buffer until we find "001".
- while (true) {
- $this->_readSocket();
-
- // We got pinged, reply with a pong.
- if (preg_match('/^PING\s*:(.+?)$/', $this->_buffer, $matches)) {
- $this->_pong($matches[1]);
-
- } else if (preg_match('/^:(.*?)\s+(\d+).*?(:.+?)?$/', $this->_buffer, $matches)) {
- // We found 001, which means we are logged in.
- if ($matches[2] == 001) {
- $this->_remote_host_received = $matches[1];
- break;
-
- // We got 464, which means we need to send a password.
- } else if ($matches[2] == 464) {
- // Before the lower check, set the password : username:password
- $tempPass = $userName . ':' . $password;
-
- // Check if the user has his password in this format: username/server:password
- if (preg_match('/^.+?\/.+?:.+?$/', $password)) {
- $tempPass = $password;
- }
-
- if ($password !== null && !$this->_writeSocket('PASS ' . $tempPass)) {
- return false;
- } else if (isset($matches[3]) && strpos(strtolower($matches[3]), 'invalid password')) {
- echo 'Invalid password or username for (' . $this->_remote_host . ').';
-
- return false;
- }
- }
- //ERROR :Closing Link: kevin123[100.100.100.100] (This server is full.)
- } else if (preg_match('/^ERROR\s*:/', $this->_buffer)) {
- echo $this->_buffer . PHP_EOL;
-
- return false;
- }
- }
-
- return true;
- }
-
- /**
- * Quit from IRC.
- *
- * @param string $message Optional disconnect message.
- *
- * @return bool
- *
- * @access public
- */
- public function quit($message = null)
- {
- if ($this->_connected()) {
- $this->_writeSocket('QUIT' . ($message === null ? '' : ' :' . $message));
- }
- $this->_closeStream();
-
- return $this->_connected();
- }
-
- /**
- * Read the incoming buffer in a loop.
- *
- * @access public
- */
- public function readIncoming()
- {
- while (true) {
-
- $this->_readSocket();
-
- // If the server pings us, return it a pong.
- if (preg_match('/^PING\s*:(.+?)$/', $this->_buffer, $matches)) {
- if ($matches[1] === $this->_remote_host_received) {
- $this->_pong($matches[1]);
- }
-
- // Check for a channel message.
- } else if (preg_match('/^:(?P.+?)\!.+?\s+PRIVMSG\s+(?P#.+?)\s+:\s*(?P.+?)\s*$/',
- $this->_stripControlCharacters($this->_buffer),
- $matches
- )
- ) {
-
- $this->_channelData =
- array(
- 'nickname' => $matches['nickname'],
- 'channel' => $matches['channel'],
- 'message' => $matches['message']
- );
-
- $this->processChannelMessages();
- }
-
- // Ping the server if it has not sent us a ping in a while.
- if ((time() - $this->_lastPing) > ($this->_socket_timeout / 2)) {
- $this->_ping($this->_remote_host_received);
- }
- }
- }
-
- /**
- * Join a channel or multiple channels.
- *
- * @param array $channels Array of channels with their passwords (null if the channel doesn't need a password).
- * array( '#exampleChannel' => 'thePassword', '#exampleChan2' => null );
- *
- * @return bool
- *
- * @access public
- */
- public function joinChannels($channels = array())
- {
- $this->_channels = $channels;
-
- if (!$this->_connected()) {
- echo 'ERROR: You must connect to IRC first!' . PHP_EOL;
-
- return false;
- }
-
- if (!empty($channels)) {
- foreach ($channels as $channel => $password) {
- $this->_joinChannel($channel, $password);
- }
- }
-
- return false;
- }
-
- /**
- * Implementation.
- * Extended classes will use this function to parse the messages in the channel using $this->_channelData.
- *
- * @access protected
- */
- protected function processChannelMessages()
- {
- }
-
- /**
- * Join a channel.
- *
- * @param string $channel
- * @param string $password
- *
- * @access protected.
- */
- protected function _joinChannel($channel, $password)
- {
- $this->_writeSocket('JOIN ' . $channel . ($password === null ? '' : ' ' . $password));
- }
-
- /**
- * Send PONG to a host.
- *
- * @param string $host
- *
- * @access protected
- */
- protected function _pong($host)
- {
- if ($this->_writeSocket('PONG ' . $host) === false) {
- $this->_reconnect();
- }
-
- // If we got a ping from the IRC server, set the last ping time to now.
- if ($host === $this->_remote_host_received) {
- $this->_lastPing = time();
- }
- }
-
- /**
- * Send PING to a host.
- *
- * @param string $host
- *
- * @access protected
- */
- protected function _ping($host)
- {
- $pong = $this->_writeSocket('PING ' . $host);
-
- // Check if there's a connection error.
- if ($pong === false || ((time() - $this->_lastPing) > ($this->_socket_timeout / 2) && !preg_match('/^PONG/', $this->_buffer))) {
- $this->_reconnect();
- }
-
- // If sent a ping from the IRC server, set the last ping time to now.
- if ($host === $this->_remote_host_received) {
- $this->_lastPing = time();
- }
- }
-
- /**
- * Attempt to reconnect to IRC.
- *
- * @access protected
- */
- protected function _reconnect()
- {
- if (!$this->connect($this->_remote_host, $this->_remote_port, $this->_remote_tls)) {
- exit('FATAL: Could not reconnect to (' . $this->_remote_host . ') after (' . $this->_reconnectRetries . ') tries.' . PHP_EOL);
- }
-
- if ($this->_alreadyLoggedIn === false) {
- if (!$this->login($this->_nickName, $this->_userName, $this->_realName, $this->_password)) {
- exit('FATAL: Could not log in to (' . $this->_remote_host . ')!' . PHP_EOL);
- }
-
- $this->joinChannels($this->_channels);
- }
- }
-
- /**
- * Read response from the IRC server.
- *
- * @access protected
- */
- protected function _readSocket()
- {
- $buffer = '';
- do {
- stream_set_timeout($this->_socket, $this->_socket_timeout);
- $buffer .= fgets($this->_socket, 1024);
- } while (!empty($buffer) && !preg_match('/\v+$/', $buffer));
- $this->_buffer = trim($buffer);
-
- if ($this->_debug && $this->_buffer !== '') {
- echo 'RECV ' . $this->_buffer . PHP_EOL;
- }
- }
-
- /**
- * Send a command to the IRC server.
- *
- * @param string $command
- *
- * @return bool
- *
- * @access protected
- */
- protected function _writeSocket($command)
- {
- $command .= "\r\n";
- for ($written = 0; $written < strlen($command); $written += $fWrite) {
- stream_set_timeout($this->_socket, $this->_socket_timeout);
- $fWrite = $this->_writeSocketChar(substr($command, $written));
-
- // http://www.php.net/manual/en/function.fwrite.php#96951 | fwrite can return 0 causing an infinite loop.
- if ($fWrite === false || $fWrite <= 0) {
-
- // If it failed, try a second time.
- $fWrite = $this->_writeSocketChar(substr($command, $written));
- if ($fWrite === false || $fWrite <= 0) {
- echo 'ERROR: Could no write to socket! (the IRC server might have closed the connection)' . PHP_EOL;
-
- return false;
- }
- }
- }
-
- if ($this->_debug) {
- echo 'SEND :' . $command;
- }
-
- return true;
- }
-
- /**
- * Write a single character to the socket.
- *
- * @param string (char) $character A single character.
- *
- * @return int|bool Number of bytes written or false.
- */
- protected function _writeSocketChar($character)
- {
- return @fwrite($this->_socket, $character);
- }
-
- /**
- * Initiate stream socket to IRC server.
- *
- * @access protected
- */
- protected function _initiateStream()
- {
- $this->_closeStream();
-
- $socket = stream_socket_client(
- $this->_remote_socket_string,
- $error_number,
- $error_string,
- $this->_remote_connection_timeout
- );
-
- if ($socket === false) {
- echo 'ERROR: ' . $error_string . ' (' . $error_number . ')' . PHP_EOL;
- } else {
- $this->_socket = $socket;
- }
- }
-
- /**
- * Close the socket.
- *
- * @access protected
- */
- protected function _closeStream()
- {
- if (!is_null($this->_socket)) {
- $this->_socket = null;
- }
- }
-
- /**
- * Check if we are connected to the IRC server.
- *
- * @return bool
- *
- * @access protected
- */
- protected function _connected()
- {
- return (is_resource($this->_socket) && !feof($this->_socket));
- }
-
- /**
- * Strips control characters from a IRC message.
- *
- * @param string $text
- *
- * @return string
- *
- * @access protected
- */
- protected function _stripControlCharacters($text)
- {
- return preg_replace(
- array(
- '/(\x03(?:\d{1,2}(?:,\d{1,2})?)?)/', // Color code
- '/\x02/', // Bold
- '/\x0F/', // Escaped
- '/\x16/', // Italic
- '/\x1F/', // Underline
- '/\x12/' // Device control 2
- ),
- '',
- $text
- );
- }
-}
\ No newline at end of file
diff --git a/lib/IRCScraper.php b/lib/IRCScraper.php
deleted file mode 100644
index abbe7dac1..000000000
--- a/lib/IRCScraper.php
+++ /dev/null
@@ -1,462 +0,0 @@
-_ignoredChannels = unserialize(SCRAPE_IRC_SOURCE_IGNORE);
- } else {
- $this->_ignoredChannels = 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
- );
- }
-
- $this->_categoryIgnoreRegex = false;
- if (defined('SCRAPE_IRC_CATEGORY_IGNORE') && SCRAPE_IRC_CATEGORY_IGNORE !== '') {
- $this->_categoryIgnoreRegex = SCRAPE_IRC_CATEGORY_IGNORE;
- }
-
- $this->_titleIgnoreRegex = false;
- if (defined('SCRAPE_IRC_TITLE_IGNORE') && SCRAPE_IRC_TITLE_IGNORE !== '') {
- $this->_titleIgnoreRegex = SCRAPE_IRC_TITLE_IGNORE;
- }
-
- $this->_pdo = new DB();
- $this->_groupList = array();
- $this->_silent = $silent;
- $this->_debug = $debug;
- $this->_resetPreVariables();
- $this->_startScraping();
- }
-
- public function __destruct()
- {
- parent::__destruct();
- }
-
- /**
- * Main method for scraping.
- *
- * @access protected
- */
- protected function _startScraping()
- {
-
- // Connect to IRC.
- if ($this->connect(SCRAPE_IRC_SERVER, SCRAPE_IRC_PORT, SCRAPE_IRC_TLS) === false) {
- exit (
- 'Error connecting to (' .
- SCRAPE_IRC_SERVER .
- ':' .
- SCRAPE_IRC_PORT .
- '). Please verify your server information and try again.' .
- PHP_EOL
- );
- }
-
- // Login to IRC.
- if ($this->login(SCRAPE_IRC_NICKNAME, SCRAPE_IRC_REALNAME, SCRAPE_IRC_USERNAME, SCRAPE_IRC_PASSWORD) === false) {
- exit('Error logging in to: (' .
- SCRAPE_IRC_SERVER . ':' . SCRAPE_IRC_PORT . ') nickname: (' . SCRAPE_IRC_NICKNAME .
- '). Verify your connection information, you might also be banned from this server or there might have been a connection issue.' .
- PHP_EOL
- );
- }
-
- // Join channels.
- $this->joinChannels(array('#PreNNTmux' => null));
-
- if (!$this->_silent) {
- echo
- '[' .
- date('r') .
- '] [Scraping of IRC channels for (' .
- SCRAPE_IRC_SERVER .
- ':' .
- SCRAPE_IRC_PORT .
- ') (' .
- SCRAPE_IRC_NICKNAME .
- ') started.]' .
- PHP_EOL;
- }
-
- // Scan incoming IRC messages.
- $this->readIncoming();
- }
-
- /**
- * Process bot messages, insert/update PREs.
- *
- * @access protected
- */
- protected function processChannelMessages()
- {
- if (preg_match(
- '/^(NEW|UPD|NUK): \[DT: (?P