Move files around.

This commit is contained in:
Darko
2015-05-28 12:36:00 +02:00
parent a5ea73deec
commit ae0434ac11
1403 changed files with 13 additions and 18 deletions
@@ -0,0 +1,20 @@
Inlcuded in this folder are init.d scripts for unix users. These are NOT to be cronned.
They must be ran by init.d or in a screen.
You MUST set the paths to where you have installed newznab.
The recommended way to run script is via screen. You should copy newznab_screen.sh
to newznab_local.sh so that when you svn update (or export), your changes are not lost.
Detailed instructions...
cp newznab_screen.sh newznab_local.sh
edit newznab_local.sh to specify paths to your installation
chmod +x newznab_local.sh
screen bash
./newznab_local.sh
ctrl-ad to detach screen
This will update binaries and releases in a continuous cycle.
@@ -0,0 +1,6 @@
<?php
require_once dirname(dirname(dirname(dirname(dirname(__DIR__))))) . DIRECTORY_SEPARATOR . 'www' . DIRECTORY_SEPARATOR . 'config.php';
if (is_file(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'settings.php')) {
require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . 'settings.php';
}
@@ -0,0 +1,338 @@
<?php
if (!isset($argv[1])) {
exit("This script is not intended to be run manually." . PHP_EOL);
}
require_once dirname(__FILE__) . '/../../../../../www/config.php';
use newznab\db\DB;
use newznab\processing\PProcess;
use newznab\processing\post\ProcessAdditional;
// Are we coming from python or php ? $options[0] => (string): python|php
// The type of process we want to do: $options[1] => (string): releases
$options = explode(' ', $argv[1]);
switch ($options[1]) {
// Runs backFill interval or all.
// $options[2] => (string)group name, Name of group to work on.
// $options[3] => (int) backfill type from tmux settings. 1 = Backfill interval , 2 = Bakfill all
case 'backfill':
if (in_array((int)$options[3], [1, 2])) {
$pdo = new DB();
$value = $pdo->queryOneRow("SELECT value FROM tmux WHERE setting = 'backfill_qty'");
if ($value !== false) {
$nntp = nntp($pdo);
(new \Backfill())->backfillAllGroups($options[2], ($options[3] == 1 ? '' : $value['value']));
}
}
break;
/* BackFill up to x number of articles for all groups.
*
* $options[2] => (string) Group name.
* $options[3] => (int) Quantity of articles to download.
*/
case 'backfill_all_quantity':
$pdo = new DB();
$nntp = nntp($pdo);
(new \Backfill())->backfillAllGroups($options[2], $options[3]);
break;
// BackFill a single group, 10000 parts.
// $options[2] => (string)group name, Name of group to work on.
case 'backfill_all_quick':
$pdo = new DB();
$nntp = nntp($pdo);
(new \Backfill())->backfillAllGroups($options[2], 10000, 'normal');
break;
/* Get a range of article headers for a group.
*
* $options[2] => (string) backfill/binaries
* $options[3] => (string) Group name.
* $options[4] => (int) First article number in range.
* $options[5] => (int) Last article number in range.
* $options[6] => (int) Number of threads.
*/
case 'get_range':
$pdo = new DB();
$nntp = nntp($pdo);
$groups = new \Groups();
$s = new Sites();
$site = $s->get();
$groupMySQL = $groups->getByName($options[3]);
if ($nntp->isError($nntp->selectGroup($groupMySQL['name']))) {
if ($nntp->isError($nntp->dataError($nntp, $groupMySQL['name']))) {
return;
}
}
$binaries = new \Binaries(['NNTP' => $nntp, 'Settings' => $pdo, 'Groups' => $groups]);
$return = $binaries->scan($groupMySQL, $options[4], $options[5], ($site->safepartrepair == 1 ? 'update' : 'backfill'));
if (empty($return)) {
exit();
}
$columns = [];
switch ($options[2]) {
case 'binaries':
if ($return['lastArticleNumber'] <= $groupMySQL['last_record']){
exit();
}
$columns[1] = sprintf(
'last_record_postdate = %s',
$pdo->from_unixtime(
(is_numeric($return['lastArticleDate']) ? $return['lastArticleDate'] : strtotime($return['lastArticleDate']))
)
);
$columns[2] = sprintf('last_record = %s', $return['lastArticleNumber']);
$query = sprintf(
'UPDATE groups SET %s, %s, last_updated = NOW() WHERE id = %d AND last_record < %s',
$columns[1],
$columns[2],
$groupMySQL['id'],
$return['lastArticleNumber']
);
break;
case 'backfill':
if ($return['firstArticleNumber'] >= $groupMySQL['first_record']){
exit();
}
$columns[1] = sprintf(
'first_record_postdate = %s',
$pdo->from_unixtime(
(is_numeric($return['firstArticleDate']) ? $return['firstArticleDate'] : strtotime($return['firstArticleDate']))
)
);
$columns[2] = sprintf('first_record = %s', $return['firstArticleNumber']);
$query = sprintf(
'UPDATE groups SET %s, %s, last_updated = NOW() WHERE id = %d AND first_record > %s',
$columns[1],
$columns[2],
$groupMySQL['id'],
$return['firstArticleNumber']
);
break;
default:
exit();
}
$pdo->queryExec($query);
break;
/* Do part repair for a group.
*
* $options[2] => (string) Group name.
*/
case 'part_repair':
$pdo = new DB();
$groups = new \Groups(['Settings' => $pdo]);
$groupMySQL = $groups->getByName($options[2]);
$nntp = nntp($pdo);
// Select group, here, only once
$data = $nntp->selectGroup($groupMySQL['name']);
if ($nntp->isError($data)) {
if ($nntp->dataError($nntp, $groupMySQL['name']) === false) {
exit();
}
}
(new \Binaries())->partRepair($groupMySQL);
break;
// Process releases.
// $options[2] => (string)groupCount, number of groups terminated by _ | (int)groupid, group to work on
case 'releases':
$pdo = new DB();
$s = new Sites();
$site = $s->get();
$releases = new \Releases(['Settings' => $pdo]);
//Runs function that are per group
if (is_numeric($options[2])) {
processReleases($site, $releases, $options[2]);
} else {
// Run functions that run on releases table after all others completed.
$groupCount = rtrim($options[2], '_');
if (!is_numeric($groupCount)) {
$groupCount = 1;
}
$releases->deletedReleasesByGroup();
$releases->deleteReleases();
$releases->processRequestIDs('', (5000 * $groupCount), true);
$releases->processRequestIDs('', (1000 * $groupCount), false);
$releases->categorizeReleases(2);
}
break;
// Process all local requestid for a single group.
// $options[2] => (int)groupid, group to work on
case 'requestid':
if (is_numeric($options[2])) {
(new \RequestIDLocal(['Echo' => true]))->lookupRequestIDs(['GroupID' => $options[2], 'limit' => 5000]);
}
break;
/* Update a single group's article headers.
*
* $options[2] => (string) Group name.
*/
case 'update_group_headers':
$pdo = new DB();
$nntp = nntp($pdo);
$groups = new \Groups();
$groupMySQL = $groups->getByName($options[2]);
(new \Binaries(['NNTP' => $nntp, 'Groups' => $groups, 'Settings' => $pdo]))->updateGroup($groupMySQL);
break;
// Do a single group (update_binaries/backFill/update_releases/postprocess).
// $options[2] => (int)groupid, group to work on
case 'update_per_group':
if (is_numeric($options[2])) {
$pdo = new DB();
// Get the group info from MySQL.
$groupMySQL = $pdo->queryOneRow(sprintf('SELECT * FROM groups WHERE id = %d', $options[2]));
if ($groupMySQL === false) {
exit('ERROR: Group not found with id ' . $options[2] . PHP_EOL);
}
// Connect to NNTP.
$nntp = nntp($pdo);
$backFill = new \Backfill();
// Update the group for new binaries.
(new \Binaries())->updateGroup($groupMySQL);
// BackFill the group with 20k articles.
$backFill->backfillAllGroups($groupMySQL['name'], 20000, 'normal');
// Create releases.
processReleases(new \Releases(['Settings' => $pdo]), $options[2]);
// Post process the releases.
(new ProcessAdditional(['Echo' => true, 'NNTP' => $nntp, 'Settings' => $pdo]))->start($options[2]);
(new \Info(['Echo' => true, 'Settings' => $pdo]))->processNfoFiles($nntp, $options[2]);
}
break;
// Post process additional and NFO.
// $options[2] => (char)Letter or number a-f 0-9, first character of release guid.
case 'pp_additional':
case 'pp_nfo':
if (charCheck($options[2])) {
$pdo = new DB();
// Create the connection here and pass, this is for post processing, so check for alternate.
$nntp = nntp($pdo, true);
if ($options[1] === 'pp_nfo') {
(new \Info(['Echo' => true, 'Settings' => $pdo]))->processNfoFiles($nntp, '', $options[2]);
} else {
(new ProcessAdditional(['Echo' => true, 'NNTP' => $nntp, 'Settings' => $pdo]))->start('', $options[2]);
}
}
break;
/* Post process movies.
*
* $options[2] (char) Single character, first letter of release guid.
* $options[3] (int) Process all releases or renamed releases only.
*/
case 'pp_movie':
if (charCheck($options[2])) {
$pdo = new DB();
(new PProcess(['Settings' => $pdo]))->processMovies('', $options[2], (isset($options[3]) ? $options[3] : ''));
}
break;
/* Post process TV.
*
* $options[2] (char) Single character, first letter of release guid.
* $options[3] (int) Process all releases or renamed releases only.
*/
case 'pp_tv':
if (charCheck($options[2])) {
$pdo = new DB();
(new PProcess(['Settings' => $pdo]))->processTv('', $options[2], (isset($options[3]) ? $options[3] : ''));
}
break;
}
/**
* Create / process releases for a groupid.
*
* @param \Releases $releases
* @param int $groupID
*/
function processReleases($site, $releases, $groupID)
{
$s = new Sites();
$site = $s->get();
$releaseCreationLimit = ($site->maxnzbsprocessed != '' ? (int)$site->maxnzbsprocessed : 1000);
$releases->applyRegex($groupID);
$releases->processIncompleteBinaries($groupID);
$releases->createReleases($groupID);
do {
$releasesCount = $releases->createReleases($groupID);
// This loops as long as the number of releases or nzbs added was >= the limit (meaning there are more waiting to be created)
} while (($releasesCount['added'] + $releasesCount['dupes']) >= $releaseCreationLimit);
$releases->deleteBinaries($groupID);
}
/**
* Check if the character contains a-f or 0-9.
*
* @param string $char
*
* @return bool
*/
function charCheck($char)
{
if (in_array($char, ['a','b','c','d','e','f','0','1','2','3','4','5','6','7','8','9'])) {
return true;
}
return false;
}
/**
* Check if the group should be processed.
*
* @param \newznab\db\DB $pdo
* @param int $groupID
*/
function collectionCheck(&$pdo, $groupID)
{
if ($pdo->queryOneRow(sprintf('SELECT id FROM collections_%d LIMIT 1', $groupID)) === false) {
exit();
}
}
/**
* Connect to usenet, return NNTP object.
*
* @param \DB $pdo
* @param bool $alternate Use alternate NNTP provider.
*
* @return NNTP
*/
function &nntp(&$pdo, $alternate = false)
{
$nntp = new \NNTP(['Settings' => $pdo]);
$s = new Sites();
$site = $s->get();
if (($alternate && $site->alternate_nntp == 1 ? $nntp->doConnect(true, true) : $nntp->doConnect()) !== true) {
exit("ERROR: Unable to connect to usenet." . PHP_EOL);
}
return $nntp;
}
@@ -0,0 +1 @@
/settings.php
@@ -0,0 +1,19 @@
####These multi-processing scripts require a POSIX compliant operating system and the PHP pcntl extension.
####binaries.php
This will download new headers for all active groups using your binaries threads site setting.
You can pass a argument, a number to limit the max amount of new headers to download.
####releases.php
This is identical to the python releases_threaded.py
This will create new releases/delete unwanted releases, process requestid's, categorize releases by group
using your release threads site setting.
####update_per_group.php:
This is identical to the python update_threaded.py
This will download new headers for all active groups, backfill 20k headers from all backfill enabled groups,
create new releases/delete unwanted releases, process requestid's, categorize releases, process additional and NFO
by group using your release threads site setting.
@@ -0,0 +1,8 @@
<?php
declare(ticks=1);
require('.do_not_run/require.php');
use newznab\libraries\Forking;
// Check if argument 1 is numeric, which is to limit article count.
(new Forking())->processWorkType(
'backfill', (isset($argv[1]) && is_numeric($argv[1]) && $argv[1] > 0 ? array(0 => $argv[1]) : array(0 => false))
);
@@ -0,0 +1,10 @@
<?php
if (!isset($argv[1]) || !is_numeric($argv[1])) {
exit(
'Argument 1 => (Number) Set to 0 to ignore, else fetches up to x new headers for every active group.' . PHP_EOL
);
}
declare(ticks=1);
require('.do_not_run/require.php');
use newznab\libraries\Forking;
(new Forking())->processWorkType('binaries', array(0 => $argv[1]));
@@ -0,0 +1,20 @@
<?php
if (!isset($argv[1]) || !in_array($argv[1], ['nfo', 'filename', 'md5', 'par2', 'miscsorter', 'predbft'])) {
exit(
'First argument (mandatory):' . PHP_EOL .
'nfo => Attempt to fix release name using the nfo.' . PHP_EOL .
'filename => Attempt to fix release name using the filenames.' . PHP_EOL .
'md5 => Attempt to fix release name using the MD5.' . PHP_EOL .
'par2 => Attempt to fix release name using the par2.' . PHP_EOL .
'miscsorter => Attempt to fix release name using magic.' . PHP_EOL .
'predbft => Attempt to fix release name using Predb full text matching.' . PHP_EOL . PHP_EOL
);
}
declare(ticks=1);
require('.do_not_run/require.php');
use newznab\libraries\Forking;
(new Forking())->processWorkType('fixRelNames_' . $argv[1], [0 => $argv[1]]);
@@ -0,0 +1,34 @@
<?php
declare(ticks=1);
require('.do_not_run/require.php');
use newznab\libraries\ForkingImportNZB;
if (!isset($argv[1]) || !is_dir($argv[1])) {
exit(
'First argument (mandatory):' . PHP_EOL .
'Path to a folder, containing folders with .nzb or .nzb.gz files inside them.' . PHP_EOL .
'If you supply a path containing only files, the files will be ignored.' . PHP_EOL .
'The sub-folders will be searched recursively for NZB files.' . PHP_EOL . PHP_EOL .
'Second argument (optional):' . PHP_EOL .
'Number of processes, how many processes to run max at a time. (default is 1)' . PHP_EOL . PHP_EOL .
'Third argument (optional):' . PHP_EOL .
'true|false => Delete the NZB files after they are imported (recommended), if you stop and restart you will have to go over the imported files again.' . PHP_EOL . PHP_EOL .
'Fourth argument (optional)' . PHP_EOL .
'true|false => Delete the NZB if importing it fails (not recommended).' . PHP_EOL .
'Fifth argument (optional):' . PHP_EOL .
'true|false => Use the NZB file name as the release name (not recommended), the names in the NZB are better.' . PHP_EOL . PHP_EOL .
'Sixth argument (optional):' . PHP_EOL .
'How many NZB files to import per process, if this is not set, it will do 50,000 per process.' . PHP_EOL . PHP_EOL .
'Note that successfully imported NZB files WILL be deleted.' . PHP_EOL
);
}
(new ForkingImportNZB())->start(
$argv[1],
(isset($argv[2]) && is_numeric($argv[2]) && $argv[2] > 0 ? $argv[2] : 1),
(isset($argv[3]) && $argv[3] === 'true' ? 'true' : 'false'),
(isset($argv[4]) && $argv[4] === 'true' ? 'true' : 'false'),
(isset($argv[5]) && $argv[5] === 'true' ? 'true' : 'false'),
(isset($argv[6]) && is_numeric($argv[6]) && $argv[6] > 0 ? $argv[6] : 50000)
);
@@ -0,0 +1,21 @@
<?php
if (!isset($argv[1]) || !in_array($argv[1], ['ama', 'add', 'mov', 'nfo', 'sha', 'tv'])) {
exit(
'First argument (mandatory):' . PHP_EOL .
'ama => Do amazon processing, this does not use multi-processing, because of amazon API restrictions.' . PHP_EOL .
'add => Do additional (rar|zip) processing.' . PHP_EOL .
'mov => Do movie processing.' . PHP_EOL .
'nfo => Do NFO processing.' . PHP_EOL .
'sha => Do sharing processing, this does not use multi-processing.' . PHP_EOL .
'tv => Do TV processing.' . PHP_EOL . PHP_EOL .
'Second argument (optional):' . PHP_EOL .
'true|false => Only post-process renamed releases. This is for the mov|tv options.' . PHP_EOL
);
}
declare(ticks=1);
require('.do_not_run/require.php');
use newznab\libraries\Forking;
(new Forking())->processWorkType('postProcess_' . $argv[1], (isset($argv[2]) && $argv[2] === 'true' ? [0 => true] : []));
@@ -0,0 +1,7 @@
<?php
declare(ticks=1);
require('.do_not_run/require.php');
use newznab\libraries\Forking;
(new Forking())->processWorkType('releases');
@@ -0,0 +1,7 @@
<?php
declare(ticks=1);
require('.do_not_run/require.php');
use \newznab\libraries\Forking;
(new Forking())->processWorkType('request_id');
@@ -0,0 +1,15 @@
<?php
if (!isset($argv[1]) || !in_array($argv[1], ['backfill', 'binaries'])) {
exit(
'First argument (mandatory):' . PHP_EOL .
'binaries => Do Safe Binaries update.' . PHP_EOL .
'backfill => Do Safe Backfill update.' . PHP_EOL
);
}
declare(ticks=1);
require('.do_not_run/require.php');
use \newznab\libraries\Forking;
(new Forking())->processWorkType('safe_' . $argv[1]);
@@ -0,0 +1,49 @@
<?php
/**
* Maximum time in seconds a child can stay alive.
* Keeps long processes, like groups with millions of parts from preventing other groups to update.
*
* @default 1800
*/
define('NN_MULTIPROCESSING_MAX_CHILD_TIME', 1800);
/**
* How much work can 1 child do.
* Increasing this currently reduces performance with no benefits, here for testing or future use.
*
* @default 1
*/
define('NN_MULTIPROCESSING_MAX_CHILD_WORK', 1);
/**
* This setting can be used to override your site settings, to cap the maximum amount of child processes.
* Set to 0 to ignore.
*
* @default 0
*/
define('NN_MULTIPROCESSING_MAX_CHILDREN_OVERRIDE', 0);
/**
* Which type of messages to display on the screen.
*
* -1 All messages.
* 2 Critical messages.
* 4 Warnings.
* 6 Info messages.
* 7 Debug messages.
*
* @default 6
*/
define('NN_MULTIPROCESSING_LOG_TYPE', 6);
/**
* How to display the text output (echo's) from the child processes.
*
* 0 - Do not display any anything.
* 1 - Display the text as the child outputs it in real time. (This will mix all the child process text output.)
* 2 - Display the text when the child is done. (This will display the text serially.)
*
* @default 1
*/
define('NN_MULTIPROCESSING_CHILD_OUTPUT_TYPE', 1);
@@ -0,0 +1,8 @@
<?php
declare(ticks=1);
require('.do_not_run/require.php');
use \newznab\libraries\Forking;
// This is the same as the python update_threaded.php
(new Forking())->processWorkType('update_per_group');
@@ -0,0 +1,88 @@
#!/bin/sh
#
# /etc/init.d/newznab: start and stop the newznab update script
#
# run update-rc.d newznab_ubuntu.sh defaults
### BEGIN INIT INFO
# Provides: Newznab
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start newznab at boot time
# Description: Enable newznab service provided by daemon.
### END INIT INFO
RED=$(tput setaf 1)
GREEN=$(tput setaf 2)
NORMAL=$(tput sgr0)
col=40
# Newznab variables
NN_PATH="/var/www/newznab/htdocs/misc/update_scripts"
NN_BINUP="update_binaries.php"
NN_RELUP="update_releases.php"
NN_PREDB="update_predb.php true"
NN_OPT="optimise_db.php"
NN_TV="update_tvschedule.php"
NN_THEATERS="update_theaters.php"
NN_SLEEP_TIME="10" # in seconds . 10sec is good for 100s of groups. 600sec might be a good start for fewer.
NN_PID_PATH="/var/run/"
PIDFILE="newznab_sh.pid"
LASTOPTIMIZE=`date +%s`
test -f /lib/lsb/init-functions || exit 1
. /lib/lsb/init-functions
case "$1" in
start)
if [ -f ${NN_PID_PATH}${PIDFILE} ]
then
echo "$0 is already running."
else
echo -n "Starting Newznab binaries update..."
cd ${NN_PATH}
while :
do
CURRTIME=`date +%s`
php ${NN_BINUP} 2>&1 > /dev/null && php ${NN_RELUP} 2>&1 > /dev/null && php ${NN_PREDB} 2>&1 > /dev/null
DIFF=$(($CURRTIME-$LASTOPTIMIZE))
if [ "$DIFF" -gt 43200 ] || [ "$DIFF" -lt 1 ]
then
LASTOPTIMIZE=`date +%s`
php ${NN_OPT} 2>&1 > /dev/null && php ${NN_TV} 2>&1 > /dev/null && php ${NN_THEATERS} 2>&1 > /dev/null
fi
sleep ${NN_SLEEP_TIME}
done &
PID=$!
echo $PID > ${NN_PID_PATH}${PIDFILE}
sleep 2
if [ -f ${NN_PID_PATH}${PIDFILE} ]
then
printf '%s%*s%s\n' "$GREEN" $col '[OK]' "$NORMAL"
else
printf '%s%*s%s\n' "$RED" $col '[FAIL]' "$NORMAL"
fi
fi &
;;
stop)
echo -n "Stopping Newznab binaries update..."
kill -9 `cat ${NN_PID_PATH}${PIDFILE}` && kill -9 `cat ${NN_PID_PATH}${PIDFILE}` && rm ${NN_PID_PATH}${PIDFILE}
sleep 2
if [ -f ${NN_PID_PATH}${PIDFILE} ]
then
printf '%s%*s%s\n' "$RED" $col '[FAIL]' "$NORMAL"
else
printf '%s%*s%s\n' "$GREEN" $col '[OK]' "$NORMAL"
fi
;;
*)
echo "Usage: $0 [start|stop]"
exit 1
esac
@@ -0,0 +1,31 @@
#!/bin/sh
# call this script from within screen to get binaries, processes releases and
# every half day get tv/theatre info and optimise the database
set -e
export NEWZNAB_PATH="/usr/local/www/newznab/misc/update_scripts"
export NEWZNAB_SLEEP_TIME="600" # in seconds
LASTOPTIMIZE=`date +%s`
while :
do
CURRTIME=`date +%s`
cd ${NEWZNAB_PATH}
/usr/bin/php5 ${NEWZNAB_PATH}/update_binaries.php
/usr/bin/php5 ${NEWZNAB_PATH}/update_releases.php
DIFF=$(($CURRTIME-$LASTOPTIMIZE))
if [ "$DIFF" -gt 43200 ] || [ "$DIFF" -lt 1 ]
then
LASTOPTIMIZE=`date +%s`
/usr/bin/php5 ${NEWZNAB_PATH}/optimise_db.php
/usr/bin/php5 ${NEWZNAB_PATH}/update_tvschedule.php
/usr/bin/php5 ${NEWZNAB_PATH}/update_theaters.php
fi
echo "waiting ${NEWZNAB_SLEEP_TIME} seconds..."
sleep ${NEWZNAB_SLEEP_TIME}
done
@@ -0,0 +1,51 @@
#!/bin/sh
#
# Ian - 16/11/2011
# /etc/init.d/newznab: start and stop the newznab update script
#
# run update-rc.d newznab_ubuntu.sh defaults
### BEGIN INIT INFO
# Provides: Newznab
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start newznab at boot time
# Description: Enable newznab service provided by daemon.
### END INIT INFO
# Newznab variables
NN_PATH="/var/www/newznab/misc/update_scripts"
NN_BINUP="update_binaries.php"
NN_RELUP="update_releases.php"
NN_SLEEP_TIME="600" # in seconds . 10sec is good for 100s of groups. 600sec might be a good start for fewer.
NN_PID_PATH="/var/run/"
PIDFILE="newznab_binup.pid"
test -f /lib/lsb/init-functions || exit 1
. /lib/lsb/init-functions
case "$1" in
start)
[ -f ${NN_PID_PATH}${PIDFILE} ] && { echo "$0 is already ruNNing."; false; }
echo -n "Starting Newznab binaries update"
cd ${NN_PATH}
(while (true);do cd ${NN_PATH} && php ${NN_BINUP} 2>&1 > /dev/null && php ${NN_RELUP} 2>&1 > /dev/null ; sleep ${NN_SLEEP_TIME} ;done) &
PID=`echo $!`
echo $PID > ${NN_PID_PATH}${PIDFILE}
;;
stop)
echo -n "Stopping Newznab binaries update"
kill -9 `cat ${NN_PID_PATH}${PIDFILE}`
;;
*)
echo "Usage: $0 [start|stop]"
exit 1
esac
@@ -0,0 +1,3 @@
processAlternate*
processAdditional*
@@ -0,0 +1,4 @@
<?php
require_once(dirname(__FILE__) . "/../../../../../www/config.php");
@@ -0,0 +1,97 @@
<?php
require_once(dirname(__FILE__) . "/config.php");
use newznab\db\DB;
use newznab\processing\PProcess;
$c = new ColorCLI();
if (!isset($argv[1])) {
exit($c->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(['Settings' => $pdo]);
$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(['Settings' => $pdo, 'Nfo' => $Nfo, 'NameFixer' => $namefixer])));
$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++;
}
}
}
@@ -0,0 +1,210 @@
<?php
require_once(dirname(__FILE__) . "/config.php");
use newznab\db\DB;
use newznab\processing\PProcess;
$pdo = new DB();
$s = new Sites();
$site = $s->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++;
}
}
}
}
@@ -0,0 +1,141 @@
<?php
require_once(dirname(__FILE__) . '/config.php');
use newznab\db\DB;
use newznab\processing\PProcess;
$pdo = new DB();
$s = new Sites();
$site = $s->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)]);
$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();
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();
break;
case 'pre':
break;
case 'sharing':
$postProcess->processSharing($nntp);
break;
case 'spotnab':
$postProcess->processSpotnab();
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;
}
@@ -0,0 +1,43 @@
<?php
require_once(dirname(__FILE__) . '/config.php');
use newznab\processing\PProcess;
$c = new ColorCLI();
if (!isset($argv[1])) {
exit($c->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]);
}
@@ -0,0 +1,10 @@
<?php
//This script is ported from nZEDb and adapted for newznab
require_once('config.php');
// This script is simply so I can show sleep progress in bash script
$consoletools = new ConsoleTools();
if (isset($argv[1]) && is_numeric($argv[1]))
{
$consoletools->showsleep($argv[1]);
}
@@ -0,0 +1,53 @@
<?php
require_once(dirname(__FILE__) . "/config.php");
$time = TIME();
$c = new ColorCLI();
if (isset($argv[1])) {
$group = $argv[1];
echo $c->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");
@@ -0,0 +1,56 @@
<?php
require_once(dirname(__FILE__) . '/config.php');
use newznab\db\DB;
$start = TIME();
$pdo = new DB();
$consoleTools = new \ConsoleTools(['ColorCLI' => $pdo->log]);
// Create the connection here and pass
$nntp = new \NNTP(['Settings' => $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;
}
@@ -0,0 +1,72 @@
<?php
require_once("config.php");
use newznab\db\DB;
$s = new \Sites();
$site = $s->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"));
}
@@ -0,0 +1,2 @@
tmux_user.conf
my.cnf
@@ -0,0 +1,58 @@
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
# http://interfacelab.com/nginx-php-fpm-apc-awesome/
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##
server {
# Change these settings to match your machine
listen 80; ## listen for ipv4; this line is default and implied
listen [::]:80 default_server ipv6only=on; ## listen for ipv6
server_name localhost; #this must be change to an ip or fqdn or else redirects will not work
# Everything below here doesn't need to be changed
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
root /var/www/newznab/www/;
index index.html index.htm index.php;
location ~* \.(?:ico|css|js|gif|inc|txt|gz|xml|png|jpe?g) {
expires max;
add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}
location / { try_files $uri $uri/ @rewrites; }
location @rewrites {
rewrite ^/([^/\.]+)/([^/]+)/([^/]+)/? /index.php?page=$1&id=$2&subpage=$3 last;
rewrite ^/([^/\.]+)/([^/]+)/?$ /index.php?page=$1&id=$2 last;
rewrite ^/([^/\.]+)/?$ /index.php?page=$1 last;
}
location /admin { }
location /install { }
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
# With php5-cgi alone:
#fastcgi_pass 127.0.0.1:9000;
# With php5-fpm:
fastcgi_pass unix:/var/run/php5-fpm.sock;
#fastcgi_index index.php;
include fastcgi_params;
#include /etc/nginx/fastcgi_params;
}
}
@@ -0,0 +1,80 @@
# C-b is not acceptable -- Vim uses it
set-option -g prefix C-a
bind-key C-a last-window
# use UTF8
set -g utf8
set-window-option -g utf8 on
# Start numbering at 1
#set -g base-index 1
# Start panes at 1 instead of 0. tmux 1.6 only
#setw -g pane-base-index 1
# Allows for faster key repetition
set -s escape-time 0
#set 256 color display
set -g default-terminal "screen-256color"
# Set status bar
set -g status-bg black
set -g status-fg white
set -g status-left ""
set -g status-right "#[fg=green]#H"
# Rather than constraining window size to the maximum size of any client
# connected to the *session*, constrain window size to the maximum size of any
# client connected to *that window*. Much more reasonable.
setw -g aggressive-resize on
# Allows us to use C-a a <command> to send commands to a TMUX session inside
# another TMUX session
bind-key a send-prefix
# Activity monitoring
setw -g monitor-activity on
#set -g visual-activity on
# # Refresh the status bar every 30 seconds. Try to keep the nzb folder to a reasonable number
set-option -g status-interval 1
# Example of using a shell command in the status line
#set -g status-right "#[fg=yellow]#(uptime | cut -d ',' -f 2-)"
#set -g status-right "#[fg=red]#(ls -1 changeme | wc -l) NZB's left to process #[fg=yellow]#(uptime | cut -d ',' -f 2-)"
#set -g status-right "#[fg=yellow]#(free -m | grep 'Mem' | awk '{ print \"Ram Used: \"$3\" MB\";}') #[fg=yellow]#(free -m | grep 'Mem' | awk '{ print \"Ram Free: \"$4\" MB\";}') \
#[fg=yellow]#(free -m | grep 'Swap' | awk '{ print \"Swap Used: \"$3\" MB\";}') #[fg=yellow]#(uptime | cut -d ',' -f 2-)"
set -g status-right "#[fg=yellow]#(free -m | grep '+' | awk '{ print \"Ram Used: \"$3\" MB, Ram Free: \"$4\" MB\";}')#(free -m | grep 'Swap' | awk '{ print \",Swap Used: \"$3\" MB\";}') #[fg=cyan,bold]%m-%d-%Y #(uptime)"
set-option -g status-right-length 200
#set -g status-right '#[fg=green][#[fg=blue]%Y-%m-%d #[fg=white]%H:%M#[default] #($HOME/bin/battery)#[fg=green]]'
# Highlight active window
set-window-option -g window-status-current-bg red
#reduce memory and scrollback buffer
set -g history-limit 1000
#mouse - allows selct pane and resize with mouse
set -g mode-mouse on
set -g mouse-resize-pane on
set -g mouse-select-pane on
set -g mouse-select-window on
set -g set-remain-on-exit on
bind m \
set -g mode-mouse on \;\
set -g mouse-resize-pane on \;\
set -g mouse-select-pane on \;\
set -g mouse-select-window on \;\
display 'Mouse: ON'
bind M \
set -g mode-mouse off \;\
set -g mouse-resize-pane off \;\
set -g mouse-select-pane off \;\
set -g mouse-select-window off \;\
display 'Mouse: OFF'
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,181 @@
<?php
require_once(dirname(__FILE__) . "/../../bin/config.php");
use newznab\db\DB;
// This script can dump all tables or just binaries/parts/partrepair/groups.
$pdo = new DB();
$exportopts = "";
//determine mysql platform Percona or Other
$mysqlplatform = exec('mysqladmin version | grep "Percona"');
if (strlen($mysqlplatform) > 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");
}
@@ -0,0 +1,197 @@
<?php
require_once(dirname(__FILE__) . "/../../bin/config.php");
use newznab\db\DB;
use newznab\utility\Utility;
// Function inspired by : http://stackoverflow.com/questions/1883079/best-practice-import-mysql-file-in-php-split-queries/2011454#2011454
function SplitSQL($file, $delimiter = ';')
{
set_time_limit(0);
if (is_file($file) === true) {
$file = fopen($file, 'r');
if (is_resource($file) === true) {
$query = array();
$db = new DB();
$dbsys = DB_TYPE;
$c = new ColorCLI();
while (feof($file) === false) {
$query[] = fgets($file);
if (preg_match('~' . preg_quote($delimiter, '~') . '\s*$~iS', end($query)) === 1) {
$query = trim(implode('', $query));
if ($dbsys == "pgsql") {
$query = str_replace(array("`", chr(96)), '', $query);
}
try {
$qry = $db->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.");
}
@@ -0,0 +1,3 @@
DELETE FROM `tmux` WHERE `setting` = 'releases_threaded';
UPDATE `tmux` set `value` = '1' where `setting` = 'sqlpatch';
@@ -0,0 +1,11 @@
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';
@@ -0,0 +1,3 @@
INSERT IGNORE INTO `tmux` (`setting`, `value`) VALUES ('partrepair', 1);
UPDATE `tmux` set `value` = '4' where `setting` = 'sqlpatch';
@@ -0,0 +1,3 @@
ALTER TABLE `releases` DROP COLUMN `nzbstatus`;
UPDATE `tmux` set `value` = '5' where `setting` = 'sqlpatch';
@@ -0,0 +1,3 @@
INSERT IGNORE INTO `tmux` (`setting`, `value`) VALUES ('zippath', '');
UPDATE `tmux` set `value` = '6' where `setting` = 'sqlpatch';
@@ -0,0 +1,4 @@
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';
@@ -0,0 +1,3 @@
ALTER TABLE `releases` ADD `prehashid` INT(12) NULL DEFAULT NULL;
UPDATE `tmux` set `value` = '8' where `setting` = 'sqlpatch';
@@ -0,0 +1,2 @@
ALTER TABLE `releases` CHANGE COLUMN `prehashid` `prehashid` INT UNSIGNED NOT NULL DEFAULT '0';
UPDATE `tmux` set `value` = '9' where `setting` = 'sqlpatch';
@@ -0,0 +1,2 @@
ALTER TABLE `releases` ADD INDEX `ix_releases_prehashid_searchname` (`prehashid`, `searchname`);
UPDATE `tmux` set `value` = '10' where `setting` = 'sqlpatch';
@@ -0,0 +1,3 @@
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';
@@ -0,0 +1,10 @@
/* 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';
@@ -0,0 +1,4 @@
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';
@@ -0,0 +1,10 @@
/* 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';
@@ -0,0 +1,34 @@
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';
@@ -0,0 +1,4 @@
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';
@@ -0,0 +1,3 @@
INSERT IGNORE INTO tmux (setting, value) VALUE ('sharing_timer', '60');
UPDATE tmux SET value = '17' WHERE setting = 'sqlpatch';
@@ -0,0 +1,5 @@
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';
@@ -0,0 +1,5 @@
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';
@@ -0,0 +1,6 @@
DELETE FROM `tmux` WHERE `setting` = 'delete_parts';
DELETE FROM `tmux` WHERE `setting` = 'delete_timer';
UPDATE `tmux` set `value` = '20' where `setting` = 'sqlpatch';
@@ -0,0 +1,5 @@
DELETE FROM `tmux` WHERE `setting` = 'alternate_nntp';
UPDATE `tmux` set `value` = '21' where `setting` = 'sqlpatch';
@@ -0,0 +1,3 @@
ALTER TABLE `releases` ADD INDEX `ix_releases_releasenfoID` (`releasenfoid`);
UPDATE `tmux` set `value` = '22' where `setting` = 'sqlpatch';
@@ -0,0 +1,3 @@
INSERT IGNORE INTO tmux (setting, value) VALUE ('fanarttvkey', '');
UPDATE tmux SET value = '23' WHERE setting = 'sqlpatch';
@@ -0,0 +1,3 @@
INSERT IGNORE INTO tmux (setting, value) VALUE ('imdburl', '0');
UPDATE tmux SET value = '24' WHERE setting = 'sqlpatch';
@@ -0,0 +1,3 @@
INSERT IGNORE INTO tmux (setting, value) VALUE ('yydecoderpath', '');
UPDATE tmux SET value = '25' WHERE setting = 'sqlpatch';
@@ -0,0 +1,9 @@
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';
@@ -0,0 +1,9 @@
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';
@@ -0,0 +1,3 @@
INSERT IGNORE INTO tmux (setting, value) VALUE ('bins_kill_timer', '0');
UPDATE tmux SET value = '28' WHERE setting = 'sqlpatch';
@@ -0,0 +1,11 @@
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';
@@ -0,0 +1,3 @@
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';
@@ -0,0 +1,4 @@
ALTER TABLE `releases` DROP COLUMN `nzb_guid`;
ALTER TABLE `releases` DROP INDEX `ix_releases_nzb_guid`;
UPDATE `tmux` set `value` = '31' where `setting` = 'sqlpatch';
@@ -0,0 +1,9 @@
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';
@@ -0,0 +1,11 @@
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';
@@ -0,0 +1,5 @@
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';
@@ -0,0 +1,16 @@
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';
@@ -0,0 +1,3 @@
DELETE FROM `tmux` WHERE `setting` = 'colors';
UPDATE `tmux` SET value = '36' WHERE `setting` = 'sqlpatch';
@@ -0,0 +1,3 @@
INSERT IGNORE INTO tmux (setting, value) VALUE ('run_sharing', '0');
UPDATE `tmux` SET value = '37' WHERE `setting` = 'sqlpatch';
@@ -0,0 +1,25 @@
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';
@@ -0,0 +1,5 @@
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';
@@ -0,0 +1,3 @@
INSERT IGNORE INTO tmux (setting, value) VALUE ('lastpretime', '0');
UPDATE `tmux` SET value = '40' WHERE `setting` = 'sqlpatch';
@@ -0,0 +1,45 @@
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';
@@ -0,0 +1,4 @@
DROP TRIGGER IF EXISTS update_hashes;
CREATE TRIGGER update_hashes AFTER UPDATE ON prehash FOR EACH ROW BEGIN IF NEW.title != OLD.title THEN UPDATE predbhash SET hashes = CONCAT_WS(',', MD5(NEW.title), MD5(MD5(NEW.title)), SHA1(NEW.title)) WHERE pre_id = OLD.id;END IF;END;
UPDATE `tmux` SET value = '42' WHERE `setting` = 'sqlpatch';
@@ -0,0 +1,3 @@
ALTER TABLE prehash DROP md5;
ALTER TABLE prehash DROP sha1;
UPDATE `tmux` SET value = '43' WHERE `setting` = 'sqlpatch';
@@ -0,0 +1,5 @@
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';
@@ -0,0 +1,3 @@
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';
@@ -0,0 +1,7 @@
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';
@@ -0,0 +1,5 @@
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';
@@ -0,0 +1,3 @@
INSERT INTO `site` (`setting`, `value`) VALUES ('categorizeforeign', '1');
INSERT INTO `site` (`setting`, `value`) VALUES ('catwebdl', '0');
UPDATE `tmux` SET `value` = '49' WHERE `setting` = 'sqlpatch';
@@ -0,0 +1,93 @@
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';
@@ -0,0 +1,2 @@
INSERT IGNORE INTO tmux (setting, value) VALUE ('minsizetopostprocess', '1');
UPDATE `tmux` SET `value` = '51' WHERE `setting` = 'sqlpatch';
@@ -0,0 +1,24 @@
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';
@@ -0,0 +1,2 @@
INSERT INTO `site` (`setting`, `value`) VALUES ('giantbombkey', '');
UPDATE `tmux` SET `value` = '53' WHERE `setting` = 'sqlpatch';
@@ -0,0 +1,3 @@
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';
@@ -0,0 +1,2 @@
ALTER TABLE users ADD COLUMN gameview INT AFTER consoleview;
UPDATE `tmux` SET `value` = '55' WHERE `setting` = 'sqlpatch';
@@ -0,0 +1,2 @@
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';
@@ -0,0 +1,2 @@
ALTER TABLE releases ADD COLUMN proc_sorter TINYINT(1) NOT NULL DEFAULT '0';
UPDATE `tmux` SET `value` = '57' WHERE `setting` = 'sqlpatch';
@@ -0,0 +1,6 @@
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';
@@ -0,0 +1,2 @@
ALTER TABLE users ADD COLUMN xxxview INT AFTER gameview;
UPDATE `tmux` set `value` = '59' where `setting` = 'sqlpatch';
@@ -0,0 +1,27 @@
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';
@@ -0,0 +1,3 @@
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';
@@ -0,0 +1,5 @@
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';
@@ -0,0 +1,2 @@
INSERT INTO `site` (`setting`, `value`) VALUES ('lookupxxx', 1);
UPDATE `tmux` SET `value` = '63' WHERE `setting` = 'sqlpatch';
@@ -0,0 +1,2 @@
INSERT INTO `site` (`setting`, `value`) VALUES ('maxxxxprocessed', 100);
UPDATE `tmux` SET `value` = '64' WHERE `setting` = 'sqlpatch';
@@ -0,0 +1,4 @@
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';
@@ -0,0 +1,497 @@
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);
UPDATE `tmux` SET `value` = '66' WHERE `setting` = 'sqlpatch';

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