Remove Versions classes and all related data

This commit is contained in:
DariusIII
2018-12-19 13:58:31 +01:00
parent 07074998be
commit 1077c467d6
376 changed files with 281 additions and 38949 deletions
+1 -3
View File
@@ -3,7 +3,6 @@
namespace Blacklight;
use App\Models\Settings;
use App\Extensions\util\Versions;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\File;
@@ -104,8 +103,7 @@ class NZB
$this->siteNzbPath .= '/';
}
$this->_nzbCommentString = sprintf(
'NZB Generated by: NNTmux %s %s',
(new Versions())->getGitTagInFile(),
'NZB Generated by: NNTmux %s',
now()->format('F j, Y, g:i a O')
);
$this->_siteCommentString = sprintf(
-12
View File
@@ -4,7 +4,6 @@ namespace Blacklight;
use App\Models\Category;
use App\Models\Settings;
use App\Extensions\util\Versions;
use Illuminate\Support\Facades\DB;
/**
@@ -36,15 +35,6 @@ class Tmux
$this->colorCli = new ColorCLI();
}
/**
* @return string
* @throws \RuntimeException
*/
public function version(): string
{
return (new Versions())->getGitTagInFile();
}
/**
* @param $constants
*
@@ -246,8 +236,6 @@ class Tmux
$obj->{$row['setting']} = $row['value'];
}
$obj->{'version'} = $this->version();
return $obj;
}
+1 -5
View File
@@ -2,8 +2,6 @@
namespace Blacklight;
use Blacklight\utility\Versions;
/**
* Tmux output functions for printing monitor data.
*
@@ -39,7 +37,6 @@ class TmuxOutput extends Tmux
public function __construct()
{
parent::__construct();
$this->_vers = (new Versions())->getValidVersionsFile();
$this->_setColourMasks();
}
@@ -135,11 +132,10 @@ class TmuxOutput extends Tmux
{
$buffer = '';
$state = ((int) $this->runVar['settings']['is_running'] === 1) ? 'Running' : 'Disabled';
$version = $this->_vers->versions->git->tag;
$buffer .= sprintf(
$this->tmpMasks[2],
"Monitor $state $version [".$this->runVar['constants']['sqlpatch'].']: ',
"Monitor $state ".': ',
$this->relativeTime($this->runVar['timers']['timer1'])
);
-352
View File
@@ -1,352 +0,0 @@
<?php
/**
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program (see LICENSE.txt in the base directory. If
* not, see:
*
* @link <http://www.gnu.org/licenses/>.
* @author niel
* @copyright 2014 nZEDb
*/
namespace Blacklight\db;
use App\Models\Settings;
use Blacklight\ColorCLI;
use Blacklight\utility\Git;
use Blacklight\utility\Utility;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\File;
class DbUpdate
{
/**
* @var
*/
public $backedup;
/**
* @var \PDO
*/
public $pdo;
/**
* @var mixed
*/
public $git;
/**
* @var mixed
*/
public $log;
/**
* @var
*/
public $settings;
protected $colorCli;
/**
* DbUpdate constructor.
*
* @param array $options
* @throws \Exception
*/
public function __construct(array $options = [])
{
$options += [
'backup' => true,
'db' => null,
'git' => new Git(),
'logger' => new ColorCLI(),
];
$this->git = $options['git'];
$this->log = $options['logger'];
$this->pdo = DB::connection()->getPdo();
$this->colorCli = new ColorCLI();
}
/**
* Takes new files in the correct format from the patches directory and turns them into proper patches.
*
* The files should be name as '+x~<table>.sql' where x is a number starting at 1 for your first
* patch. <table> should be the name of the primary table affected. If you have to modify more
* than one table, consider splitting into multiple patches using different patch modifier
* numbers to order them. i.e. +1~settings.sql, +2~predb.sql, etc.
*
* @param array $options
*
* @throws \Exception
*/
public function newPatches(array $options = []): void
{
$defaults = [
'ext' => 'sql',
'path' => NN_RES.'db'.DS.'patches',
'regex' => '#^'.Utility::PATH_REGEX.'\+(?P<order>\d+)~(?P<table>\w+)\.sql$#',
'safe' => true,
];
$options += $defaults;
$this->processPatches(['safe' => $options['safe']]); // Make sure we are completely up to date!
$this->colorCli->primaryOver('Looking for new patches...');
$files = Utility::getDirFiles($options);
$count = \count($files);
$this->colorCli->header(" $count found");
if ($count > 0) {
$this->colorCli->header('Processing...');
natsort($files);
$local = $this->isLocalDb() ? '' : 'LOCAL ';
foreach ($files as $file) {
if (! preg_match($options['regex'], $file, $matches)) {
$this->colorCli->error("$file does not match the pattern {$options['regex']}. Please fix this before continuing");
} else {
$this->colorCli->header('Processing patch file: '.$file);
$this->splitSQL($file, ['local' => $local]);
$current = Settings::settingValue('..sqlpatch');
$current++;
Settings::query()->where('setting', '=', 'sqlpatch')->update(['value' => $current]);
$newName = $matches['drive'].$matches['path'].
str_pad($current, 4, '0', STR_PAD_LEFT).'~'.
$matches['table'].'.sql';
rename($matches[0], $newName);
$this->git->addFile($newName);
if ($this->git->isCommited($this->git->getBranch().':'.str_replace(NN_ROOT, '', $matches[0]))) {
$this->git->addFile(" -u {$matches[0]}"); // remove old filename from the index.
}
}
}
}
}
/**
* @param array $options
*
* @return int
* @throws \RuntimeException
* @throws \Exception
*/
public function processPatches(array $options = []): int
{
$patched = 0;
$defaults = [
'ext' => 'sql',
'path' => NN_RES.'db'.DS.'patches',
'regex' => '#^'.Utility::PATH_REGEX.'(?P<patch>\d{4})~(?P<table>\w+)\.sql$#',
'safe' => true,
];
$options += $defaults;
$currentVersion = Settings::settingValue('..sqlpatch');
if (! is_numeric($currentVersion)) {
exit("Bad sqlpatch value: '$currentVersion'\n");
}
$files = empty($options['files']) ? Utility::getDirFiles($options) : $options['files'];
if (\count($files)) {
natsort($files);
$local = $this->isLocalDb() ? '' : 'LOCAL ';
$this->colorCli->primary('Looking for unprocessed patches...');
foreach ($files as $file) {
$setPatch = false;
$fp = fopen($file, 'rb');
$patch = fread($fp, filesize($file));
if (preg_match($options['regex'], str_replace('\\', '/', $file), $matches)) {
$patch = (int) $matches['patch'];
$setPatch = true;
} elseif (preg_match(
'/UPDATE `?site`? SET `?value`? = \'?(?P<patch>\d+)\'? WHERE `?setting`? = \'sqlpatch\'/i',
$patch,
$matches
)
) {
$patch = (int) $matches['patch'];
} else {
throw new \RuntimeException('No patch information available, stopping!!');
}
if ($patch > $currentVersion) {
$this->colorCli->header('Processing patch file: '.$file);
$this->splitSQL($file, ['local' => $local]);
if ($setPatch) {
Settings::query()->where('setting', '=', 'sqlpatch')->update(['value' => $patch]);
}
$patched++;
}
}
} else {
$this->colorCli->error('Have you changed the path to the patches folder, or do you have the right permissions?');
exit();
}
if ($patched === 0) {
$this->colorCli->info("Nothing to patch, you are already on version $currentVersion");
}
return $patched;
}
/**
* @param $file
* @param array $options
*/
public function splitSQL($file, array $options = []): void
{
$defaults = [
'delimiter' => ';',
'local' => null,
];
$options += $defaults;
if (! empty($options['vars'])) {
extract($options['vars'], 'EXTR_OVERWRITE');
}
set_time_limit(0);
if (File::isFile($file)) {
$file = fopen($file, 'r, b');
if (\is_resource($file)) {
$query = [];
$delimiter = $options['delimiter'];
while (! feof($file)) {
$line = fgets($file);
if ($line === false) {
continue;
}
// Skip comments.
if (preg_match('!^\s*(#|--|//)\s*(.+?)\s*$!', $line, $matches)) {
$this->colorCli->info('COMMENT: '.$matches[2]).PHP_EOL;
continue;
}
// Check for non default delimiters ($$ for example).
if (preg_match('#^\s*DELIMITER\s+(?P<delimiter>.+)\s*$#i', $line, $matches)) {
$delimiter = $matches['delimiter'];
if ($delimiter !== $options['delimiter']) {
continue;
}
}
// Check if the line has delimiter that is non default ($$ for example).
if ($delimiter !== $options['delimiter'] && preg_match('#^(.+?)'.preg_quote($delimiter).'\s*$#', $line, $matches)) {
// Check if the line has also the default delimiter (;), remove it.
if (preg_match('#^(.+?)'.preg_quote($options['delimiter']).'\s*$#', $matches[1], $matches2)) {
$matches[1] = $matches2[1];
}
// Change the non default delimiter ($$) to the default one(;).
$line = $matches[1].$options['delimiter'];
}
$query[] = $line;
if (preg_match('~'.preg_quote($delimiter, '~').'\s*$~iS', $line) === 1) {
$query = trim(implode('', $query));
if ($options['local'] !== null) {
$query = str_replace('{:local:}', $options['local'], $query);
}
try {
$this->pdo->exec($query);
$this->colorCli->alternateOver('SUCCESS: ').$this->colorCli->primary($query);
} catch (\PDOException $e) {
// Log the problem and the query.
file_put_contents(
NN_LOGS.'patcherrors.log',
'['.date('r').'] [ERROR] ['.
trim(preg_replace('/\s+/', ' ', $e->getMessage())).']'.PHP_EOL.
'['.date('r').'] [QUERY] ['.
trim(preg_replace('/\s+/', ' ', $query)).']'.PHP_EOL,
FILE_APPEND
);
if (
\in_array($e->errorInfo[1], [1091, 1060, 1061, 1071, 1146], false) ||
\in_array($e->errorInfo[0], [23505, 42701, 42703, '42P07', '42P16'], false)
) {
if ($e->errorInfo[1] === 1060) {
$this->colorCli->warning(
"$query The column already exists - No need to worry \{".
$e->errorInfo[1]."}.\n"
);
} else {
$this->colorCli->warning(
"$query Skipped - No need to worry \{".
$e->errorInfo[1]."}.\n"
);
}
} elseif (preg_match('/ALTER IGNORE/i', $query)) {
$this->pdo->exec('SET SESSION old_alter_table = 1');
try {
$this->pdo->exec($query);
$this->colorCli->alternateOver('SUCCESS: ').$this->colorCli->primary($query);
} catch (\PDOException $e) {
$this->colorCli->error("$query Failed {".$e->errorInfo[1].'}'.$e->errorInfo[2]);
exit();
}
} else {
$this->colorCli->error("$query Failed \{".$e->errorInfo[1].'}'.$e->errorInfo[2]);
exit();
}
}
while (ob_get_level() > 0) {
ob_end_flush();
}
flush();
}
if (\is_string($query) === true) {
$query = [];
}
}
}
}
}
/**
* Attempts to determine if the Db is on the local machine.
*
* If the method returns true, then the Db is definitely on the local machine. However,
* returning false only indicates that it could not positively be determined to be local - so
* assume remote.
*
* @return bool Whether the Db is definitely on the local machine.
*/
public function isLocalDb(): bool
{
$local = false;
if (! empty(config('database.connections.nntmux.port')) || config('database.connections.nntmux.host') === 'localhost') {
$local = true;
} else {
preg_match_all('/inet'.'6?'.' addr: ?([^ ]+)/', `ifconfig`, $ips);
// Check for dotted quad - if exists compare against local IP number(s)
if (preg_match('#^\d+\.\d+\.\d+\.\d+$#', config('database.connections.nntmux.host')) && \in_array(config('database.connections.nntmux.host'), $ips[1], false)) {
$local = true;
}
}
return $local;
}
}
-3
View File
@@ -24,7 +24,6 @@ namespace Blacklight\http;
use App\Models\Category;
use App\Models\Settings;
use Blacklight\utility\Utility;
use App\Extensions\util\Versions;
use Illuminate\Support\Facades\DB;
/**
@@ -125,8 +124,6 @@ abstract class Capabilities
return [
'server' => [
'appversion' => (new Versions())->getGitTagInFile(),
'version' => (new Versions())->getGitTagInRepo(),
'title' => Settings::settingValue('site.main.title'),
'strapline' => Settings::settingValue('site.main.strapline'),
'email' => Settings::settingValue('site.main.email'),
-26
View File
@@ -3,8 +3,6 @@
namespace Blacklight\utility;
use App\Models\Settings;
use Blacklight\ColorCLI;
use App\Extensions\util\Versions;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\File;
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
@@ -200,30 +198,6 @@ class Utility
return $gzipped;
}
/**
* @return bool
* @throws \Exception
*/
public static function isPatched(): bool
{
$versions = (new Versions())->getValidVersionsFile();
$patch = Settings::settingValue('..sqlpatch');
$ver = $versions->versions->sql->file;
// Check database patch version
if ($patch < $ver) {
$message = "\nYour database is not up to date. Reported patch levels\n Db: $patch\nfile: $ver\nPlease update.\n php ".
NN_ROOT."./tmux nntmux:db\n";
if (self::isCLI()) {
(new ColorCLI())->error($message);
}
throw new \RuntimeException($message);
}
return true;
}
/**
* Strips non-printing characters from a string.
*
-325
View File
@@ -1,325 +0,0 @@
<?php
namespace Blacklight\utility;
if (! defined('GIT_PRE_COMMIT')) {
define('GIT_PRE_COMMIT', false);
}
use Blacklight\ColorCLI;
class Versions
{
/**
* These constants are bitwise for checking what was changed.
*/
const UPDATED_GIT_COMMIT = 1;
const UPDATED_GIT_TAG = 2;
const UPDATED_SQL_DB_PATCH = 4;
const UPDATED_SQL_FILE_LAST = 8;
/**
* @var Git instance variable.
*/
public $git;
/**
* @var ColorCLI
*/
public $out;
/**
* @var int
*/
protected $_changes = 0;
/**
* @var null|string
*/
protected $_filespec;
/**
* @var string highest tag value
*/
protected $_gitHighestTag;
/**
* @var array of stable branches.
*/
protected $_stable = ['0.x'];
/**
* Shortcut to the newznab->versions node to make method work shorter.
* @var object SimpleXMLElement
*/
protected $_vers;
/**
* @var object simpleXMLElement
*/
protected $_xml;
/**
* Class constructor initialises the SimpleXML object and sets a few properties.
* @param string $filepath Optional filespec for the XML file to use. Will use default otherwise.
*
* @throws \Exception If the XML is invalid.
* @throws \RuntimeException If version file does not exist.
*/
public function __construct($filepath = null)
{
if ($filepath === null && \defined('NN_VERSIONS')) {
$filepath = NN_VERSIONS;
}
if (! file_exists($filepath)) {
throw new \RuntimeException("Versions file '$filepath' does not exist!'");
}
$this->_filespec = $filepath;
$this->out = new ColorCLI();
$this->git = new Git();
$this->getValidVersionsFile();
}
public function changes(): int
{
return $this->_changes;
}
/**
* Run all checks.
* @param bool $update Whether the XML should be updated by the check.
* @return bool True if any of the checks actually caused an update (not if it indicated one was needed), flase otherwise
*/
public function checkAll($update = true)
{
$this->checkGitTag($update);
$this->checkSQLDb($update);
$this->checkGitCommit($update);
return $this->hasChanged();
}
/**
* Checks the git commit number against the XML's stored value.
* @param bool $update Whether the XML should be updated by the check.
* @return int|bool The new git commit number, or false.
*/
public function checkGitCommit($update = true)
{
// Since Dec 2014 we no longer maintain the git commit count in the XML file, as it is no
// longer used in the code base.
if ((int) $this->_vers->sql->db >= 307) {
return 0;
}
$count = $this->git->commits();
if (GIT_PRE_COMMIT === true || $this->_vers->git->commit->__toString() < $count) {
// Allow pre-commit to override the commit number (often branch number is higher than dev's)
if ($update) {
if (GIT_PRE_COMMIT === true) {
// only the pre-commit script is allowed to set the NEXT commit number
$count++;
}
if ($count !== $this->_vers->git->commit) {
$this->out->primary("Updating commit number to {$count}");
$this->_vers->git->commit = $count;
$this->_changes |= self::UPDATED_GIT_COMMIT;
}
}
return $this->_vers->git->commit;
}
return false;
}
/**
* Checks the git's latest version tag against the XML's stored value. Version should be
* Major.Minor.Revision[.fix] (**commit number is NOT revision**).
* @param bool $update Whether the XML should be updated by the check.
* @return bool The new git's latest version tag, or false.
*/
public function checkGitTag($update = true)
{
trigger_error(
'This method is deprecated. Use app/extensions/utils/Versions::checkGitTag() instead.'
);
$branch = $this->git->getBranch();
$this->_gitHighestTag = $latest = trim($this->git->tagLatest());
$ver = preg_match('#v(\d+\.\d+\.\d+).*#', $latest, $matches) ? $matches[1] : $latest;
if (! \in_array($branch, $this->_stable, false)) {
if (version_compare($this->_vers->git->tag, '0.0.0', '!=')) {
$this->_vers->git->tag = '0.0.0';
$this->_changes |= self::UPDATED_GIT_TAG;
}
return $this->_vers->git->tag;
}
// Check if version file's entry is the same as current branch's tag
if (version_compare($this->_vers->git->tag, $latest, '!=')) {
if ($update) {
$this->out->primaryOver('Updating tag version to ').$this->out->headerOver($latest);
$this->_vers->git->tag = $ver;
$this->_changes |= self::UPDATED_GIT_TAG;
} else {
$this->out->primaryOver('Leaving tag version at ').
$this->out->headerOver($this->_vers->git->tag);
}
return $this->_vers->git->tag;
}
$this->out->primaryOver('Tag version is ').$this->out->header($latest);
return false;
}
/**
* Checks the database sqlpatch setting against the XML's stored value.
*
* @param bool $update Whether the XML should be updated by the check.
*
* @return bool The new database sqlpatch version, or false.
*/
public function checkSQLDb($update = false): bool
{
$this->checkSQLFileLatest($update);
if ($this->_vers->sql->db->__toString() !== $this->_vers->sql->file->__toString()) {
if ($update) {
$this->out->primaryOver('Updating Db revision to '.$this->_vers->sql->file);
$this->_vers->sql->db = $this->_vers->sql->file->__toString();
$this->_changes |= self::UPDATED_SQL_DB_PATCH;
}
return $this->_vers->patch->db;
}
return false;
}
/**
* Checks the numeric value from the last SQL patch file, updating the versions file if desired.
*
* @param bool $update Whether to update the versions file.
*
* @return bool|int False if there is a problem, otherwise the number from the last patch file.
*/
public function checkSQLFileLatest($update = true)
{
$options = [
'data' => NN_RES.'db'.DS.'schema'.DS.'data'.DS,
'ext' => 'sql',
'path' => NN_RES.'db'.DS.'patches',
'regex' => '#^'.Utility::PATH_REGEX.'(?P<patch>\d{4})~(?P<table>\w+)\.sql$#',
'safe' => true,
];
$files = Utility::getDirFiles($options);
natsort($files);
$last = preg_match($options['regex'], end($files), $matches) ? (int) $matches['patch'] : false;
if ($update) {
if ($last !== false && $this->_vers->sql->file->__toString() !== $last) {
$this->out->primary('Updating latest patch file to '.$last);
$this->_vers->sql->file = $last;
$this->_changes |= self::UPDATED_SQL_FILE_LAST;
}
if ($this->_vers->sql->file->__toString() !== $last) {
$this->_vers->sql->file = $last;
$this->_changes |= self::UPDATED_SQL_DB_PATCH;
}
}
return $last;
}
public function getCommit()
{
return $this->_vers->git->commit->__toString();
}
public function getGitHookPrecommit()
{
return $this->_vers->git->hooks->precommit->__toString();
}
public function getSQLPatchFromDb()
{
return $this->_vers->sql->db->__toString();
}
public function getSQLPatchFromFiles()
{
return $this->_vers->sql->file->__toString();
}
public function getTagVersion()
{
if (empty($this->_gitHighestTag)) {
$this->checkGitTag();
}
return $this->_gitHighestTag;
}
/**
* @param null|string $filepath
*
* @return object|\SimpleXMLElement
* @throws \Exception
*/
public function getValidVersionsFile($filepath = null)
{
$filepath = $filepath ?? $this->_filespec;
$temp = libxml_use_internal_errors(true);
$this->_xml = simplexml_load_string(file_get_contents($filepath));
libxml_use_internal_errors($temp);
if ($this->_xml === false) {
if (Utility::isCLI()) {
$this->out->error('Your versions XML file ('.$filepath.') is broken, try updating from git.');
}
throw new \RuntimeException('Failed to open versions XML file '.$filepath);
}
if ($this->_xml->count() > 0) {
$vers = $this->_xml->xpath('/nntmux/versions');
if ($vers[0]->count() === 0) {
$this->out->error('Your versions XML file ('.NN_VERSIONS.') does not contain version info, try updating from git.');
throw new \RuntimeException('Failed to find versions node in XML file '.$filepath);
}
$this->out->primary('Your versions XML file ('.NN_VERSIONS.') looks okay, continuing.');
$this->_vers = &$this->_xml->versions;
} else {
throw new \RuntimeException("No elements in file!\n");
}
return $this->_xml;
}
/**
* Check whether the XML has been changed by one of the methods here.
* @return bool True if the XML has been changed.
*/
public function hasChanged(): bool
{
return $this->_changes !== 0;
}
public function save(): void
{
if ($this->hasChanged()) {
$this->_xml->asXML($this->_filespec);
$this->_changes = 0;
}
}
}
+1
View File
@@ -1,4 +1,5 @@
2018-12-18 DariusIII
* Chg: Remove Versions classes and all related data
* Chg: Update configuration files
* Chg: Add back logoutOtherDevices Auth function
* Chg: Make login page prettier
+10 -36
View File
@@ -5,7 +5,6 @@ namespace App\Console\Commands;
use App\Models\User;
use App\Models\Settings;
use Illuminate\Console\Command;
use App\Extensions\util\Versions;
use Symfony\Component\Process\Process;
class InstallNntmux extends Command
@@ -98,20 +97,19 @@ class InstallNntmux extends Command
});
}
if ($this->updatePatch()) {
$paths = $this->updatePaths();
if ($paths !== false) {
$sql1 = Settings::query()->where('setting', '=', 'nzbpath')->update(['value' => $paths['nzb_path']]);
$sql2 = Settings::query()->where('setting', '=', 'tmpunrarpath')->update(['value' => $paths['unrar_path']]);
$sql3 = Settings::query()->where('setting', '=', 'coverspath')->update(['value' => $paths['covers_path']]);
if ($sql1 === null || $sql2 === null || $sql3 === null) {
$error = true;
} else {
$this->info('Settings table updated successfully');
}
$paths = $this->updatePaths();
if ($paths !== false) {
$sql1 = Settings::query()->where('setting', '=', 'nzbpath')->update(['value' => $paths['nzb_path']]);
$sql2 = Settings::query()->where('setting', '=', 'tmpunrarpath')->update(['value' => $paths['unrar_path']]);
$sql3 = Settings::query()->where('setting', '=', 'coverspath')->update(['value' => $paths['covers_path']]);
if ($sql1 === null || $sql2 === null || $sql3 === null) {
$error = true;
} else {
$this->info('Settings table updated successfully');
}
}
if (! $error && $this->addAdminUser()) {
@file_put_contents(base_path().'/_install/install.lock', 'application install locked on '.now());
$this->info('Generating application key');
@@ -136,30 +134,6 @@ class InstallNntmux extends Command
}
}
/**
* @return bool
* @throws \Cz\Git\GitException
*/
private function updatePatch(): bool
{
$patch = (new Versions())->getSQLPatchFromFile();
$updateSettings = false;
if ($patch > 0) {
$updateSettings = Settings::query()->where(['section' => '', 'subsection' => '', 'name' => 'sqlpatch'])->update(['value' => $patch]);
}
// If it all worked, continue the install process.
if ($updateSettings !== false) {
$this->info('Database updated successfully');
return true;
}
$this->error('Could not update sqlpatch to '.$patch.' for your database.');
return false;
}
/**
* @return array|bool
* @throws \Exception
+2 -28
View File
@@ -2,10 +2,7 @@
namespace App\Console\Commands;
use Blacklight\db\DbUpdate;
use App\Extensions\util\Git;
use Illuminate\Console\Command;
use App\Extensions\util\Versions;
class UpdateNNTmuxDB extends Command
{
@@ -37,35 +34,12 @@ class UpdateNNTmuxDB extends Command
}
/**
* Execute the console command.
*
* @return mixed
* @throws \RuntimeException
* @throws \Exception
*/
public function handle()
{
// also prevent web access.
$this->output->writeln('<info>Checking database version</info>');
$versions = new Versions(['git' => ($this->git instanceof Git) ? $this->git : null]);
try {
$currentDb = $versions->getSQLPatchFromDB();
$currentXML = $versions->getSQLPatchFromFile();
} catch (\PDOException $e) {
$this->error('Error fetching patch versions!');
return 1;
}
$this->info("Db: $currentDb,\tFile: $currentXML");
if ($currentDb < $currentXML) {
$db = new DbUpdate(['backup' => false]);
$db->processPatches(['safe' => false]);
} else {
$this->info('Up to date.');
}
$this->output->writeln('<info>Updating database</info>');
$this->call('migrate');
}
}
@@ -1,102 +0,0 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use App\Extensions\util\Versions;
class VerifyNNTmuxVersion extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'nntmux:version {type}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Returns the current version (or branch) of the indexer.
Actions:
all Show all of following info.
branch Show git branch name.
git Show git tag for current version.
sql Show SQL patch level';
private $versions;
/**
* VerifyNNTmuxVersion constructor.
*
* @throws \Cz\Git\GitException
*/
public function __construct()
{
$this->versions = new Versions();
parent::__construct();
}
/**
* @throws \Cz\Git\GitException
*/
public function handle()
{
if ($this->argument('type') === 'git') {
$this->git();
} elseif ($this->argument('type') === 'branch') {
$this->branch();
} elseif ($this->argument('type') === 'sql') {
$this->sql();
} elseif ($this->argument('type') === 'all') {
$this->all();
} else {
$this->error($this->description);
}
}
/**
* @throws \Cz\Git\GitException
*/
public function all()
{
$this->git();
$this->sql();
}
public function branch()
{
$this->output->writeln('<comment>'.'Git branch: '.$this->versions->getGitBranch().'</comment>');
}
/**
* @throws \Cz\Git\GitException
*/
public function git()
{
$this->output->writeln('<comment>Looking up Git tag version(s)</comment>');
$this->info('Hash: '.$this->versions->getGitHeadHash());
$this->info('XML version: '.$this->versions->getGitTagInFile());
$this->info('Git version: '.$this->versions->getGitTagInRepo());
}
/**
* Fetch SQL latest patch version.
*/
public function sql()
{
$this->output->writeln('<comment>Looking up SQL patch version(s)</comment>');
$latest = $this->versions->getSQLPatchFromFile();
$this->info("XML version: $latest");
try {
$dbVersion = $this->versions->getSQLPatchFromDB();
$this->info(' DB version: '.$dbVersion);
} catch (\Exception $e) {
$this->error($e->getMessage());
}
}
}
-424
View File
@@ -1,424 +0,0 @@
<?php
/**
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program (see LICENSE.txt in the base directory. If
* not, see:.
*
* @link <http://www.gnu.org/licenses/>.
* @author niel
* @copyright 2016 nZEDb
*/
namespace App\Extensions\util;
use App\Models\Settings;
use Blacklight\utility\Utility;
class Versions
{
/**
* These constants are bitwise for checking what has changed.
*/
protected const UPDATED_GIT_TAG = 1;
protected const UPDATED_SQL_DB_PATCH = 2;
protected const UPDATED_SQL_FILE_LAST = 4;
/**
* @var int Bitwise mask of elements that have been changed.
*/
protected $changes = 0;
/**
* @var \App\Extensions\util\Git
*/
protected $git;
/**
* @var
*/
protected $_config;
/**
* @var
*/
protected $versions;
/**
* @var
*/
protected $xml;
/**
* Versions constructor.
*
* @param array $config
* @throws \Cz\Git\GitException
*/
public function __construct(array $config = [])
{
$defaults = [
'git' => null,
'path' => NN_VERSIONS,
];
$config += $defaults;
$this->_config = $config;
$this->initialiseGit();
}
/**
* @throws \Cz\Git\GitException
*/
public function checkGitTag(): void
{
$this->checkGitTagInFile();
}
/**
* Checks the git's latest version tag against the XML's stored value. Version should be
* Major.Minor.Revision[.fix][-dev|-RCx].
*
* @param bool $update
*
* @return false|string version string if matched or false.
* @throws \Cz\Git\GitException
*/
public function checkGitTagInFile($update = false)
{
$this->initialiseGit();
$result = preg_match(Utility::VERSION_REGEX, $this->git->getHeadHash(), $matches) ? $matches['all'] : false;
if ($result !== false) {
if (! $this->git->isStable($this->git->getBranch())) {
$this->loadXMLFile();
$result = preg_match(
Utility::VERSION_REGEX,
$this->versions->git->tag->__toString(),
$matches
) ? $matches['digits'] : false;
if ($result !== false && version_compare($matches['digits'], '0.0.0', '!=')) {
$this->versions->git->tag = '0.0.0-dev';
$this->changes |= self::UPDATED_GIT_TAG;
}
$result = $this->versions->git->tag;
} else {
$result = $this->checkGitTagsAreEqual(['update' => $update]);
}
}
return $result;
}
/**
* @param array $options
* @return bool|\SimpleXMLElement
* @throws \Symfony\Component\Process\Exception\RuntimeException
* @throws \Symfony\Component\Process\Exception\LogicException
* @throws \RuntimeException
*/
public function checkGitTagsAreEqual(array $options = [])
{
$options += [
'update' => true,
'verbose' => true,
];
$this->loadXMLFile();
$latestTag = $this->git->tagLatest();
// Check if file's entry is the same as current branch's tag
if (version_compare($this->versions->git->tag, $latestTag, '!=')) {
if ($options['update'] === true) {
if ($options['verbose'] === true) {
echo "Updating tag version to $latestTag".PHP_EOL;
}
$this->versions->git->tag = $this->git->tagLatest();
$this->changes |= self::UPDATED_GIT_TAG;
return $this->versions->git->tag;
} // They're NOT the same but we were told not to update.
if ($options['verbose'] === true) {
echo "Current tag version $latestTag, skipping update!".PHP_EOL;
}
return false;
}
// They're the same so return true
return true;
}
/**
* Checks the database sqlpatch setting against the XML's stored value.
*
* @param bool $verbose
*
* @return bool|string The new database sqlpatch version, or false.
* @throws \RuntimeException
* @throws \Exception
*/
public function checkSQLDb($verbose = true)
{
$this->loadXMLFile();
$patch = $this->getSQLPatchFromDB();
if ($this->versions->sql->db->__toString() !== $patch) {
if ($verbose) {
echo "Updating Db revision to $patch".PHP_EOL;
}
$this->versions->sql->db = $patch;
$this->changes |= self::UPDATED_SQL_DB_PATCH;
}
return $this->isChanged(self::UPDATED_SQL_DB_PATCH) ? $patch : false;
}
/**
* @param bool $verbose
* @throws \RuntimeException
*/
public function checkSQLFileLatest($verbose = true): void
{
$this->loadXMLFile();
$lastFile = $this->getSQLPatchLast();
if ($lastFile !== false && $this->versions->sql->file->__toString() !== $lastFile) {
if ($verbose === true) {
echo "Updating latest patch file to $lastFile".PHP_EOL;
}
$this->versions->sql->file = $lastFile;
$this->changes |= self::UPDATED_SQL_FILE_LAST;
}
}
/**
* @return string
* @throws \Cz\Git\GitException
*/
public function getGitBranch(): string
{
$this->initialiseGit();
return $this->git->getBranch();
}
/**
* @return string
* @throws \Cz\Git\GitException
*/
public function getGitHeadHash(): string
{
$this->initialiseGit();
return $this->git->getHeadHash();
}
/**
* @return null|string
* @throws \RuntimeException
*/
public function getGitTagInFile(): ?string
{
$this->loadXMLFile();
return ($this->versions === null) ? null : $this->versions->git->tag->__toString();
}
/**
* @return string
* @throws \Cz\Git\GitException
*/
public function getGitTagInRepo(): string
{
$this->initialiseGit();
return $this->git->tagLatest();
}
/**
* @return null|string
* @throws \Exception
*/
public function getSQLPatchFromDB(): ?string
{
$dbVersion = Settings::settingValue('..sqlpatch');
if (! is_numeric($dbVersion)) {
throw new \RuntimeException('Bad sqlpatch value');
}
return $dbVersion;
}
/**
* @return null|string
* @throws \RuntimeException
*/
public function getSQLPatchFromFile(): ?string
{
$this->loadXMLFile();
return ($this->versions === null) ? null : $this->versions->sql->file->__toString();
}
/**
* @return bool|int
*/
public function getSQLPatchLast()
{
$options = [
'data' => NN_RES.'db'.DS.'schema'.DS.'data'.DS,
'ext' => 'sql',
'path' => NN_RES.'db'.DS.'patches',
'regex' => '#^'.Utility::PATH_REGEX.'(?P<patch>\d{4})~(?P<table>\w+)\.sql$#',
'safe' => true,
];
$files = Utility::getDirFiles($options);
natsort($files);
return preg_match($options['regex'], end($files), $matches) ? (int) $matches['patch'] : false;
}
/**
* @return string
* @throws \Cz\Git\GitException
*/
public function getTagVersion(): string
{
$this->deprecated(__METHOD__, 'getGitTagInRepo');
return $this->getGitTagInRepo();
}
/**
* @return \simpleXMLElement
* @throws \RuntimeException
*/
public function getValidVersionsFile(): \simpleXMLElement
{
$this->loadXMLFile();
return $this->xml;
}
/**
* Check whether the XML has been changed by one of the methods here.
*
* @return bool True if the XML has been changed.
*/
public function hasChanged(): bool
{
return $this->changes !== 0;
}
/**
* @param bool $verbose
*/
public function save($verbose = true): void
{
if ($this->hasChanged()) {
if ($verbose === true && $this->changes > 0) {
if ($this->isChanged(self::UPDATED_GIT_TAG)) {
echo 'Updated git tag version to '.$this->versions->git->tag.PHP_EOL;
}
if ($this->isChanged(self::UPDATED_SQL_DB_PATCH)) {
echo 'Updated Db SQL revision to '.$this->versions->sql->db.PHP_EOL;
}
if ($this->isChanged(self::UPDATED_SQL_FILE_LAST)) {
echo 'Updated latest SQL file to '.$this->versions->sql->file.PHP_EOL;
}
} elseif ($this->changes === 0) {
echo 'Version file already up to date.'.PHP_EOL;
}
$this->xml->asXML($this->_config['path']);
$this->changes = false;
}
}
/**
* @param $message
*/
protected function error($message): void
{
// TODO handle console error message.
}
/**
* @throws \Cz\Git\GitException
*/
protected function initialiseGit(): void
{
if (! ($this->git instanceof Git)) {
$this->git = new Git();
}
}
/**
* @param $property
* @return bool
*/
protected function isChanged($property): bool
{
return ($this->changes & $property) === $property;
}
/**
* @throws \RuntimeException
*/
protected function loadXMLFile(): void
{
if ($this->versions === null) {
$temp = libxml_use_internal_errors(true);
$this->xml = simplexml_load_string(file_get_contents($this->_config['path']));
libxml_use_internal_errors($temp);
if ($this->xml === false) {
$this->error("Your versions XML file ($this->_config['path']) is broken, try updating from git.");
throw new \RuntimeException("Failed to open versions XML file '{$this->_config['path']}'");
}
if ($this->xml->count() > 0) {
$vers = $this->xml->xpath('/nntmux/versions');
if ($vers[0]->count() === 0) {
$this->error("Your versions XML file ({$this->_config['path']}) does not contain version info, try updating from git.");
throw new \RuntimeException("Failed to find versions node in XML file '{$this->_config['path']}'");
}
$this->versions = &$this->xml->versions; // Create a convenience shortcut
} else {
throw new \RuntimeException("No elements in file!\n");
}
}
}
protected function _init(): void
{
if ($this->_config['git'] instanceof Git) {
$this->git = &$this->_config['git'];
}
}
/**
* @param $methodOld
* @param $methodUse
*/
private function deprecated($methodOld, $methodUse): void
{
trigger_error(
"This method ($methodOld) is deprecated. Please use '$methodUse' instead.",
E_USER_NOTICE
);
}
}
@@ -11,7 +11,6 @@ use Blacklight\Releases;
use App\Models\UserRequest;
use Illuminate\Http\Request;
use Blacklight\utility\Utility;
use App\Extensions\util\Versions;
use App\Transformers\ApiTransformer;
use App\Transformers\TagsTransformer;
use App\Transformers\DetailsTransformer;
@@ -22,7 +21,6 @@ class ApiV2Controller extends BasePageController
{
/**
* @return \Illuminate\Http\JsonResponse
* @throws \Cz\Git\GitException
*/
public function capabilities(): \Illuminate\Http\JsonResponse
{
@@ -32,8 +30,6 @@ class ApiV2Controller extends BasePageController
$capabilities = [
'server' => [
'appversion' => (new Versions())->getGitTagInFile(),
'version' => (new Versions())->getGitTagInRepo(),
'title' => Settings::settingValue('site.main.title'),
'strapline' => Settings::settingValue('site.main.strapline'),
'email' => Settings::settingValue('site.main.email'),
+1 -1
View File
@@ -61,7 +61,7 @@ class SeriesController extends BasePageController
$series[$r->series][$r->episode][] = $r;
}
$this->smarty->assign('seasons', $series);
$this->smarty->assign('seasons', array_sort_recursive($series));
$this->smarty->assign('show', $show);
$this->smarty->assign('myshows', $myshows);
-48
View File
@@ -1,48 +0,0 @@
<?php
/**
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program (see LICENSE.txt in the base directory. If
* not, see:
*
* @link <http://www.gnu.org/licenses/>.
* @author niel
* @copyright 2015 nZEDb
*/
require_once dirname(__DIR__).DIRECTORY_SEPARATOR.'bootstrap/autoload.php';
use Blacklight\db\DbUpdate;
use Blacklight\utility\Git;
use Blacklight\utility\Utility;
if (! Utility::isCLI()) {
exit;
}
$error = false;
$git = new Git();
$branch = $git->getCurrentBranchName();
if (in_array($branch, $git->mainBranches(), false)) {
// Only update patches, etc. on specific branches to lessen conflicts
try {
// Run DbUpdates to make sure we're up to date.
$DbUpdater = new DbUpdate(['git' => $git]);
$DbUpdater->newPatches(['safe' => false]);
} catch (\Exception $e) {
$error = 1;
echo 'Error while checking patches!'.PHP_EOL;
echo $e->getMessage().PHP_EOL;
}
}
exit($error);
-2
View File
@@ -43,8 +43,6 @@ do
echo ${PROJECT}/${FILE} >> ${FILE_LIST}
done
/usr/bin/php ${HOOKS}/runHooks.php
EXIT_STATUS=$?
if [ -e ${FILE_LIST} ]
-69
View File
@@ -1,69 +0,0 @@
<?php
/**
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program (see LICENSE.txt in the base directory. If
* not, see:
*
* @link <http://www.gnu.org/licenses/>.
* @author niel
* @copyright 2014 nZEDb
*/
define('GIT_PRE_COMMIT', true);
require_once dirname(__DIR__, 2).DIRECTORY_SEPARATOR.'bootstrap/autoload.php';
use Blacklight\utility\Git;
use App\Extensions\util\Versions;
echo "Running pre-commit hooks\n";
$error = false;
// TODO Add code here to check permissions on staged files.
//$files = file(NN_ROOT . 'Blacklight/build/git-hooks'), FILE_IGNORE_NEW_LINES);
//foreach ($files as $file) {
// echo "Filename: $file\n";
//}
/*
* Add all hooks BEFORE the versions are updated so they can be skipped on any errors
*/
if ($error === false) {
$git = new Git();
$branch = $git->getCurrentBranchName();
if (in_array($branch, $git->mainBranches(), false)) {
// Only update versions, etc. on specific branches to lessen conflicts
if ($error === false) {
try {
$vers = new Versions();
$vers->checkGitTag();
$vers->checkSQLFileLatest(false);
$vers->checkSQLDb(false);
$vers->save();
$git->addFile(NN_VERSIONS);
} catch (\Exception $e) {
$error = 1;
echo "Error while checking versions!\n";
echo $e->getMessage().PHP_EOL;
}
}
} else {
echo "not 'dev' or '0.x' branch, skipping version/patch updates\n";
}
} else {
echo "Error in pre-commit hooks!!\n";
}
exit($error);
-23
View File
@@ -1,23 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<nntmux>
<versions>
<git>
<tag>0.0.0-dev</tag>
<!-- commit count removed -->
<hooks>
<precommit>9</precommit>
<!-- this is the version of the pre-commit file in githooks NOT the files it calls -->
</hooks>
<commit>5351</commit></git>
<scripts>
<last>
<date>0000-00-00</date>
<ordinal>0</ordinal>
</last>
</scripts>
<sql>
<db>360</db>
<file>360</file>
</sql>
</versions>
</nntmux>
+1 -8
View File
@@ -11,14 +11,7 @@ nano Changelog
# Add changes to changelog.
git add Changelog
php build/NewPatches.php
EXIT_STATUS="$?"
if [ ${EXIT_STATUS} -gt 0 ]
then
echo "\nProblem while converting SQL patch files!\n";
exit ${EXIT_STATUS}
fi
php artisan migrate
# Commit changes.
git commit
+1 -1
View File
@@ -418,7 +418,7 @@ while ($runVar['counts']['iterations'] > 0) {
function errorOnSQL()
{
$colorCli->error(PHP_EOL.'Monitor encountered severe errors retrieving process data from MySQL. Please diagnose and try running again.'.PHP_EOL);
(new ColorCLI())->error(PHP_EOL.'Monitor encountered severe errors retrieving process data from MySQL. Please diagnose and try running again.'.PHP_EOL);
}
/**
-6
View File
@@ -8,7 +8,6 @@ use Blacklight\utility\Utility;
use Illuminate\Support\Facades\DB;
$DIR = NN_TMUX;
$patch = Settings::settingValue('..sqlpatch');
$import = Settings::settingValue('site.tmux.import') ?? 0;
$tmux_session = Settings::settingValue('site.tmux.tmux_session') ?? 0;
$seq = Settings::settingValue('site.tmux.sequential') ?? 0;
@@ -16,11 +15,6 @@ $delaytimet = Settings::settingValue('..delaytime');
$delaytimet = $delaytimet ? (int) $delaytimet : 2;
$colorCli = new ColorCLI();
try {
Utility::isPatched();
} catch (Exception $e) {
echo $e;
}
Utility::clearScreen();
echo 'Starting Tmux...'.PHP_EOL;
-1
View File
@@ -1 +0,0 @@
DELETE FROM tmux WHERE setting = 'releases_threaded';
-9
View File
@@ -1,9 +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');
-1
View File
@@ -1 +0,0 @@
INSERT IGNORE INTO tmux (setting, value) VALUES ('partrepair', 1);
-1
View File
@@ -1 +0,0 @@
ALTER TABLE releases DROP COLUMN nzbstatus;
-1
View File
@@ -1 +0,0 @@
INSERT IGNORE INTO tmux (setting, value) VALUES ('zippath', '');
@@ -1,2 +0,0 @@
ALTER TABLE releases ADD jpgstatus TINYINT(1) NOT NULL DEFAULT 0;
INSERT IGNORE INTO tmux (setting, value) VALUES ('processjpg', 0);
-1
View File
@@ -1 +0,0 @@
ALTER TABLE releases ADD prehashid INT(12) NULL DEFAULT NULL;
-1
View File
@@ -1 +0,0 @@
ALTER TABLE releases CHANGE COLUMN prehashid prehashid INT UNSIGNED NOT NULL DEFAULT '0';
-1
View File
@@ -1 +0,0 @@
ALTER TABLE releases ADD INDEX ix_releases_prehashid_searchname (prehashid, searchname);
-2
View File
@@ -1,2 +0,0 @@
ALTER TABLE prehash ADD INDEX ix_prehash_size (size);
ALTER TABLE prehash ADD INDEX ix_prehash_category (category);
-8
View File
@@ -1,8 +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;
-2
View File
@@ -1,2 +0,0 @@
INSERT IGNORE INTO tmux (setting, value) VALUE ('scrape_cz', 0);
INSERT IGNORE INTO tmux (setting, value) VALUE ('scrape_efnet', 0);
-8
View File
@@ -1,8 +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 IGNORE INTO tmux (setting, value) VALUES ('lastpretime', '0');
-32
View File
@@ -1,32 +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 '';
-2
View File
@@ -1,2 +0,0 @@
INSERT IGNORE INTO tmux (setting, value) VALUE ('nntpretries', '10');
INSERT IGNORE INTO tmux (setting, value) VALUE ('alternate_nntp', '0');
-1
View File
@@ -1 +0,0 @@
INSERT IGNORE INTO tmux (setting, value) VALUE ('sharing_timer', '60');
-3
View File
@@ -1,3 +0,0 @@
ALTER TABLE sharing ADD COLUMN max_download MEDIUMINT UNSIGNED NOT NULL DEFAULT '150';
UPDATE sharing SET max_pull = 20000;
-3
View File
@@ -1,3 +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;
-2
View File
@@ -1,2 +0,0 @@
DELETE FROM tmux WHERE setting = 'delete_parts';
DELETE FROM tmux WHERE setting = 'delete_timer';
-1
View File
@@ -1 +0,0 @@
DELETE FROM tmux WHERE setting = 'alternate_nntp';
-1
View File
@@ -1 +0,0 @@
ALTER TABLE releases ADD INDEX ix_releases_releasenfoID (releasenfoid);
-1
View File
@@ -1 +0,0 @@
INSERT IGNORE INTO tmux (setting, value) VALUE ('fanarttvkey', '');
-1
View File
@@ -1 +0,0 @@
INSERT IGNORE INTO tmux (setting, value) VALUE ('imdburl', '0');
-1
View File
@@ -1 +0,0 @@
INSERT IGNORE INTO tmux (setting, value) VALUE ('yydecoderpath', '');
-7
View File
@@ -1,7 +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;
-7
View File
@@ -1,7 +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);
-1
View File
@@ -1 +0,0 @@
INSERT IGNORE INTO tmux (setting, value) VALUE ('bins_kill_timer', '0');
-7
View File
@@ -1,7 +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);
CREATE INDEX ix_releases_nzb_guid ON releases (nzb_guid);
UPDATE releases SET nzbstatus = 1 WHERE nzbstatus = 0;
-1
View File
@@ -1 +0,0 @@
UPDATE tmux SET VALUE = 'http://reqid.nzedb.com/index.php?reqid=[REQUEST_ID]&group=[GROUP_NM]' WHERE setting = 'request_url';
-2
View File
@@ -1,2 +0,0 @@
ALTER TABLE releases DROP COLUMN nzb_guid;
ALTER TABLE releases DROP INDEX ix_releases_nzb_guid;
-4
View File
@@ -1,4 +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;
-9
View File
@@ -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 releases set isrequestid = 1
WHERE name REGEXP '^\\[ ?([[:digit:]]{4,6}) ?\\]|^REQ\s*([[:digit:]]{4,6})|^([[:digit:]]{4,6})-[[:digit:]]{1}\\['
AND isrequestid = 0;
-3
View File
@@ -1,3 +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');
-12
View File
@@ -1,12 +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}';
-1
View File
@@ -1 +0,0 @@
DELETE FROM tmux WHERE setting = 'colors';
-1
View File
@@ -1 +0,0 @@
INSERT IGNORE INTO tmux (setting, value) VALUE ('run_sharing', '0');
@@ -1,23 +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;
DROP TRIGGER IF EXISTS insert_search;
DROP TRIGGER IF EXISTS update_search;
DROP TRIGGER IF EXISTS delete_search;
CREATE TRIGGER insert_search AFTER INSERT ON releases FOR EACH ROW BEGIN INSERT IGNORE 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;
-3
View File
@@ -1,3 +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;
-1
View File
@@ -1 +0,0 @@
INSERT IGNORE INTO tmux (setting, value) VALUE ('lastpretime', '0');
-28
View File
@@ -1,28 +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 IGNORE 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 IGNORE 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;
-2
View File
@@ -1,2 +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;
-2
View File
@@ -1,2 +0,0 @@
ALTER TABLE prehash DROP md5;
ALTER TABLE prehash DROP sha1;
@@ -1,4 +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);
-2
View File
@@ -1,2 +0,0 @@
ALTER TABLE prehash DROP INDEX ix_prehash_title;
ALTER IGNORE TABLE prehash ADD UNIQUE INDEX ix_prehash_title (title);
@@ -1,6 +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);
-2
View File
@@ -1,2 +0,0 @@
ALTER TABLE users ADD COLUMN queuetype TINYINT(1) NOT NULL DEFAULT 1;
/* Add a column to pick between Sab and NZBGet. */
-2
View File
@@ -1,2 +0,0 @@
INSERT IGNORE INTO settings (setting, value) VALUES ('categorizeforeign', '1');
INSERT IGNORE INTO settings (setting, value) VALUES ('catwebdl', '0');
-91
View File
@@ -1,91 +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 IGNORE INTO category (id, title) VALUES (1000, 'Console');
INSERT IGNORE INTO category (id, title) VALUES (2000, 'Movies');
INSERT IGNORE INTO category (id, title) VALUES (3000, 'Audio');
INSERT IGNORE INTO category (id, title) VALUES (4000, 'PC');
INSERT IGNORE INTO category (id, title) VALUES (5000, 'TV');
INSERT IGNORE INTO category (id, title) VALUES (6000, 'XXX');
INSERT IGNORE INTO category (id, title) VALUES (7000, 'Books');
INSERT IGNORE INTO category (id, title) VALUES (8000, 'Other');
INSERT IGNORE INTO category (id, title, parentid) VALUES (1010, 'NDS', 1000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (1020, 'PSP', 1000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (1030, 'Wii', 1000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (1040, 'Xbox', 1000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (1050, 'Xbox 360', 1000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (1060, 'WiiWare/VC', 1000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (1070, 'XBOX 360 DLC', 1000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (1080, 'PS3', 1000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (1999, 'Other', 1000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (1110, '3DS', 1000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (1120, 'PS Vita', 1000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (1130, 'WiiU', 1000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (1140, 'Xbox One', 1000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (1180, 'PS4', 1000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (2010, 'Foreign', 2000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (2999, 'Other', 2000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (2030, 'SD', 2000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (2040, 'HD', 2000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (2050, '3D', 2000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (2060, 'BluRay', 2000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (2070, 'DVD', 2000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (2080, 'WEB-DL', 2000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (3010, 'MP3', 3000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (3020, 'Video', 3000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (3030, 'Audiobook', 3000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (3040, 'Lossless', 3000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (3999, 'Other', 3000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (3060, 'Foreign', 3000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (4010, '0day', 4000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (4020, 'ISO', 4000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (4030, 'Mac', 4000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (4040, 'Mobile-Other', 4000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (4050, 'Games', 4000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (4060, 'Mobile-iOS', 4000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (4070, 'Mobile-Android', 4000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (5010, 'WEB-DL', 5000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (5020, 'Foreign', 5000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (5030, 'SD', 5000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (5040, 'HD', 5000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (5999, 'Other', 5000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (5060, 'Sport', 5000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (5070, 'Anime', 5000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (5080, 'Documentary', 5000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (6010, 'DVD', 6000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (6020, 'WMV', 6000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (6030, 'XviD', 6000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (6040, 'x264', 6000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (6050, 'Pack', 6000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (6060, 'ImgSet', 6000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (6999, 'Other', 6000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (7010, 'Mags', 7000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (7020, 'Ebook', 7000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (7030, 'Comics', 7000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (7040, 'Technical', 7000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (7050, 'Other', 7000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (7060, 'Foreign', 7000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (8010, 'Misc', 8000);
INSERT IGNORE INTO category (id, title, parentid) VALUES (8020, 'Hashed', 8000);
-1
View File
@@ -1 +0,0 @@
INSERT IGNORE INTO tmux (setting, value) VALUE ('minsizetopostprocess', '1');
-22
View File
@@ -1,22 +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;
-1
View File
@@ -1 +0,0 @@
INSERT IGNORE INTO settings (setting, value) VALUES ('giantbombkey', '');
-2
View File
@@ -1,2 +0,0 @@
ALTER TABLE releases ADD COLUMN gamesinfo_id INT AFTER consoleinfoid;
CREATE INDEX ix_releases_gamesinfo_id ON releases (gamesinfo_id);
-1
View File
@@ -1 +0,0 @@
ALTER TABLE users ADD COLUMN gameview INT AFTER consoleview;
-1
View File
@@ -1 +0,0 @@
INSERT IGNORE INTO menu (href, title, tooltip, role, ordinal ) VALUES ('newposterwall', 'New Releases', "Newest Releases Poster Wall", 1, 11);
-1
View File
@@ -1 +0,0 @@
ALTER TABLE releases ADD COLUMN proc_sorter TINYINT(1) NOT NULL DEFAULT '0';
-5
View File
@@ -1,5 +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';
-1
View File
@@ -1 +0,0 @@
ALTER TABLE users ADD COLUMN xxxview INT AFTER gameview;
-25
View File
@@ -1,25 +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;
-2
View File
@@ -1,2 +0,0 @@
ALTER TABLE releases ADD COLUMN xxxinfo_id INT AFTER imdbid;
CREATE INDEX ix_releases_xxxinfo_id ON releases (xxxinfo_id);
-4
View File
@@ -1,4 +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';
-1
View File
@@ -1 +0,0 @@
INSERT IGNORE INTO settings (setting, value) VALUES ('lookupxxx', 1);
-1
View File
@@ -1 +0,0 @@
INSERT IGNORE INTO settings (setting, value) VALUES ('maxxxxprocessed', 100);
-3
View File
@@ -1,3 +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;
-495
View File
@@ -1,495 +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 &amp; Love Triangles', 6000, 0),
(397, 'Wives', 6000, 0),
(398, 'Swingers', 6000, 0),
(399, 'Old &amp; Young Females (18+)', 6000, 0),
(400, 'Maid', 6000, 0),
(401, 'Pantyhose &amp; 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 &amp; 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 &amp; Doctors', 6000, 0),
(426, 'British', 6000, 0),
(427, 'Fetish Wear', 6000, 0),
(428, 'Strap-Ons', 6000, 0),
(429, 'Indian', 6000, 0),
(430, 'Spoofs &amp; Parodies', 6000, 0),
(431, 'Pregnant', 6000, 0),
(432, 'Classic', 6000, 0),
(433, 'Jeans &amp; 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 &amp; 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 &amp; 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);
-4
View File
@@ -1,4 +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';
-2
View File
@@ -1,2 +0,0 @@
ALTER TABLE xxxinfo MODIFY COLUMN classused varchar(4) DEFAULT 'ade';
UPDATE xxxinfo SET classused = 'aebn' WHERE classused = 'aeb';
-1
View File
@@ -1 +0,0 @@
INSERT IGNORE INTO settings (setting, value) VALUES ('anidbkey', '');
@@ -1 +0,0 @@
ALTER TABLE animetitles CHANGE createddate unixtime INT(12) UNSIGNED NOT NULL;
-1
View File
@@ -1 +0,0 @@
INSERT IGNORE INTO settings (setting, value) VALUES ('rottentomatoquality', 'profile');
-23
View File
@@ -1,23 +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;
DROP TRIGGER IF EXISTS insert_search;
DROP TRIGGER IF EXISTS update_search;
DROP TRIGGER IF EXISTS delete_search;
CREATE TRIGGER insert_hashes AFTER INSERT ON prehash FOR EACH ROW BEGIN INSERT IGNORE 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 IGNORE 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);
-1
View File
@@ -1 +0,0 @@
CREATE INDEX ix_releases_xxxinfo_id ON releases (xxxinfo_id);
-1
View File
@@ -1 +0,0 @@
ALTER TABLE releases CHANGE nzbstatus nzbstatus TINYINT( 1 ) NOT NULL DEFAULT '0';
-1
View File
@@ -1 +0,0 @@
INSERT IGNORE INTO settings (setting, value) VALUE ('alternate_nntp', '0');
-48
View File
@@ -1,48 +0,0 @@
INSERT IGNORE INTO settings (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'),
('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');
-1
View File
@@ -1 +0,0 @@
INSERT IGNORE INTO settings (setting, value) VALUE ('maxnforetries', '5');
-3
View File
@@ -1,3 +0,0 @@
INSERT IGNORE INTO settings (setting, value) VALUES
('timeoutpath', ''),
('timeoutseconds', '0');
-1
View File
@@ -1 +0,0 @@
ALTER TABLE movieinfo ADD type VARCHAR( 32 ) NOT NULL AFTER genre ;
@@ -1,16 +0,0 @@
DROP TABLE IF EXISTS tvrage_episodes;
CREATE TABLE tvrage_episodes (
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;
-5
View File
@@ -1,5 +0,0 @@
INSERT IGNORE INTO settings (setting, value) VALUES
('lookup_reqids', '1'),
('reqidthreads', '1'),
('request_hours', '1'),
('request_url', 'http://reqid.nzedb.com/index.php');

Some files were not shown because too many files have changed in this diff Show More