From da3513211b5cdb2bbc4f6e802befeb477f6817ef Mon Sep 17 00:00:00 2001 From: DariusIII Date: Wed, 8 Nov 2017 15:30:29 +0100 Subject: [PATCH] Fix it properly --- misc/testing/PostProc/updateConsoleImages.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/misc/testing/PostProc/updateConsoleImages.php b/misc/testing/PostProc/updateConsoleImages.php index 14b847e4b..677022825 100644 --- a/misc/testing/PostProc/updateConsoleImages.php +++ b/misc/testing/PostProc/updateConsoleImages.php @@ -2,6 +2,7 @@ require_once dirname(__DIR__, 3).DIRECTORY_SEPARATOR.'bootstrap.php'; +use nntmux\ColorCLI; use nntmux\db\DB; use App\Models\ConsoleInfo; @@ -9,7 +10,7 @@ $pdo = new DB(); $covers = $updated = $deleted = 0; if ($argc === 1 || $argv[1] !== 'true') { - exit($pdo->log->error("\nThis script will check all images in covers/console and compare to db->consoleinfo.\nTo run:\nphp $argv[0] true\n")); + exit(ColorCLI::error("\nThis script will check all images in covers/console and compare to db->consoleinfo.\nTo run:\nphp $argv[0] true\n")); } $path2covers = NN_COVERS.'console'.DS; @@ -30,8 +31,8 @@ foreach ($itr as $filePath) { $covers++; } else { $run = ConsoleInfo::query()->where('id', $match[1])->value('id'); - if ($run->count() === 0) { - echo $pdo->log->info($filePath.' not found in db.'); + if ($run === 0) { + echo ColorCLI::info($filePath.' not found in db.'); } } }