mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 09:18:54 +00:00
Switch to category constants from category numbers, part 1
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
<?php
|
||||
require_once realpath(dirname(dirname(dirname(__DIR__))) . DIRECTORY_SEPARATOR . 'indexer.php');
|
||||
|
||||
use newznab\Category;
|
||||
use newznab\ConsoleTools;
|
||||
use newznab\db\Settings;
|
||||
|
||||
$category = new Category();
|
||||
$pdo = new Settings();
|
||||
$consoletools = new ConsoleTools(['ColorCLI' => $pdo->log]);
|
||||
$ran = false;
|
||||
@@ -61,7 +63,7 @@ if (isset($argv[1]) && ($argv[1] === "consoles" || $argv[1] === "all")) {
|
||||
$where = ' WHERE consoleinfoid IS NOT NULL';
|
||||
} else {
|
||||
echo $pdo->log->header("Resetting all failed Console postprocessing");
|
||||
$where = " WHERE consoleinfoid IN (-2, 0) AND categoryid BETWEEN 1000 AND 1999";
|
||||
$where = " WHERE consoleinfoid IN (-2, 0) AND categoryid BETWEEN " . Category::GAME_ROOT . " AND " . Category::GAME_OTHER;
|
||||
}
|
||||
|
||||
$qry = $pdo->queryDirect("SELECT id FROM releases" . $where);
|
||||
@@ -117,7 +119,7 @@ if (isset($argv[1]) && ($argv[1] === "movies" || $argv[1] === "all")) {
|
||||
$where = ' WHERE imdbid IS NOT NULL';
|
||||
} else {
|
||||
echo $pdo->log->header("Resetting all failed Movie postprocessing");
|
||||
$where = " WHERE imdbid IN (-2, 0) AND categoryid BETWEEN 2000 AND 2999";
|
||||
$where = " WHERE imdbid IN (-2, 0) AND categoryid BETWEEN " . Category::MOVIE_ROOT . " AND " . Category::MOVIE_OTHER;
|
||||
}
|
||||
|
||||
$qry = $pdo->queryDirect("SELECT id FROM releases" . $where);
|
||||
@@ -145,7 +147,7 @@ if (isset($argv[1]) && ($argv[1] === "music" || $argv[1] === "all")) {
|
||||
$where = ' WHERE musicinfoid IS NOT NULL';
|
||||
} else {
|
||||
echo $pdo->log->header("Resetting all failed Music postprocessing");
|
||||
$where = " WHERE musicinfoid IN (-2, 0) AND categoryid BETWEEN 3000 AND 3999";
|
||||
$where = " WHERE musicinfoid IN (-2, 0) AND categoryid BETWEEN " . Category::MUSIC_ROOT . " AND " . Category::MUSIC_OTHER;
|
||||
}
|
||||
|
||||
$qry = $pdo->queryDirect("SELECT id FROM releases" . $where);
|
||||
|
||||
Reference in New Issue
Block a user