mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 17:28:55 +00:00
30 lines
1.0 KiB
PHP
30 lines
1.0 KiB
PHP
<?php
|
|
//This script will update all records in the cosole table
|
|
|
|
require_once realpath(dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'indexer.php');
|
|
|
|
use newznab\db\Settings;
|
|
use newznab\controllers\Console;
|
|
|
|
$console = new Console(['Echo' => true, 'Settings' => $pdo]);
|
|
|
|
$db = new Settings();
|
|
|
|
$res = $db->queryDirect(sprintf("SELECT searchname, ID from releases where consoleinfoID IS NULL and categoryID in ( select ID from category where parentID = %d ) ORDER BY id DESC LIMIT %d", Category::CAT_PARENT_GAME, Console::NUMTOPROCESSPERTIME));
|
|
|
|
if ($res != null) {
|
|
while ($arr = $db->getAssocArray($res)) {
|
|
$gameInfo = $console->parseTitle($arr['searchname']);
|
|
if ($gameInfo !== false) {
|
|
echo 'Searching ' . $gameInfo['release'] . '<br />';
|
|
$game = $console->updateConsoleInfo($gameInfo);
|
|
if ($game !== false) {
|
|
echo "<pre>";
|
|
print_r($game);
|
|
echo "</pre>";
|
|
} else {
|
|
echo '<br />Game not found<br /><br />';
|
|
}
|
|
}
|
|
}
|
|
} |