Switch to category constants from category numbers, part 1

This commit is contained in:
DariusIII
2016-02-09 12:37:30 +01:00
parent 222b6b93e1
commit 9fc39bf490
13 changed files with 115 additions and 50 deletions
+9 -1
View File
@@ -3,15 +3,23 @@
require_once realpath(dirname(dirname(dirname(__DIR__))) . DIRECTORY_SEPARATOR . 'indexer.php');
use newznab\Category;
use newznab\db\Settings;
use newznab\Console;
$category = new Category();
$pdo = new Settings();
$console = new Console(['Echo' => true, 'Settings' => $pdo]);
$res = $pdo->queryDirect(sprintf("SELECT searchname, id FROM releases WHERE consoleinfoid IS NULL AND categoryid BETWEEN 1000 AND 1999 ORDER BY id DESC" ));
$res = $pdo->queryDirect(
sprintf(
"SELECT searchname, id FROM releases WHERE consoleinfoid IS NULL AND categoryid
BETWEEN %s AND %s ORDER BY id DESC",
Category::GAME_ROOT,
Category::GAME_OTHER
));
if ($res instanceof \Traversable) {
echo $pdo->log->header("Updating console info for " . number_format($res->rowCount()) . " releases.");