diff --git a/misc/testing/PostProc/getGameCovers.php b/misc/testing/PostProc/getGameCovers.php index 1e319112d..5c67f83ec 100644 --- a/misc/testing/PostProc/getGameCovers.php +++ b/misc/testing/PostProc/getGameCovers.php @@ -1,9 +1,10 @@ true, 'Settings' => $pdo]); $res = $pdo->query( - sprintf("SELECT id, title FROM gamesinfo WHERE cover = 0 ORDER BY id DESC LIMIT 100") + sprintf('SELECT id, title FROM gamesinfo WHERE cover = 0 ORDER BY id DESC LIMIT 100') ); $total = count($res); if ($total > 0) { - echo $pdo->log->header("Updating game covers for " . number_format($total) . " releases."); + echo ColorCLI::header('Updating game covers for ' . number_format($total) . ' releases.'); foreach ($res as $arr) { $starttime = microtime(true); $gameInfo = $game->parseTitle($arr['title']); if ($gameInfo !== false) { - echo $pdo->log->primary('Looking up: ' . $gameInfo['release']); + echo ColorCLI::primary('Looking up: ' . $gameInfo['release']); $gameData = $game->updateGamesInfo($gameInfo); if ($gameData === false) { - echo $pdo->log->primary($gameInfo['release'] . ' not found'); + echo ColorCLI::primary($gameInfo['release'] . ' not found'); } else { if (file_exists(NN_COVERS . 'games' . DS . $gameData . '.jpg')) { $pdo->queryExec(sprintf('UPDATE gamesinfo SET cover = 1 WHERE id = %d', $arr['id'])); @@ -35,7 +36,7 @@ if ($total > 0) { // amazon limits are 1 per 1 sec $diff = floor((microtime(true) - $starttime) * 1000000); if (1000000 - $diff > 0) { - echo $pdo->log->alternate("Sleeping"); + echo ColorCLI::alternate('Sleeping'); usleep(1000000 - $diff); } } diff --git a/nntmux/Games.php b/nntmux/Games.php index 950bef134..26ee6a4e9 100755 --- a/nntmux/Games.php +++ b/nntmux/Games.php @@ -497,7 +497,7 @@ class Games } } } - if (empty($this->_gameResults['title']) || empty($this->_gameResults->name)){ + if (empty($this->_gameResults->name) || empty($this->_gameResults['title'])){ return false; } if (!is_array($this->_gameResults)){ @@ -622,7 +622,7 @@ class Games $game['title'] = $gameInfo['title']; } if(!isset($game['releasedate'])){ - $game['releasedate'] = ""; + $game['releasedate'] = ''; } if ($game['releasedate'] == '') {