mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-30 17:58:59 +00:00
Scrutinizer Auto-Fixes
This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
This commit is contained in:
@@ -7,7 +7,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($pdo->log->error("\nThis script will check all images in covers/console and compare to db->consoleinfo.\nTo run:\nphp $argv[0] true\n"));
|
||||
}
|
||||
|
||||
|
||||
@@ -16,20 +16,20 @@ $path2covers = NN_COVERS . 'console' . DS;
|
||||
$dirItr = new \RecursiveDirectoryIterator($path2covers);
|
||||
$itr = new \RecursiveIteratorIterator($dirItr, \RecursiveIteratorIterator::LEAVES_ONLY);
|
||||
foreach ($itr as $filePath) {
|
||||
if (is_file($filePath) && preg_match('/\d+\.jpg/', $filePath)) {
|
||||
preg_match('/(\d+)\.jpg/', basename($filePath), $match);
|
||||
if (isset($match[1])) {
|
||||
$run = $pdo->queryDirect("UPDATE consoleinfo SET cover = 1 WHERE cover = 0 AND id = " . $match[1]);
|
||||
if ($run->rowCount() >= 1) {
|
||||
$covers++;
|
||||
} else {
|
||||
$run = $pdo->queryDirect("SELECT id FROM consoleinfo WHERE id = " . $match[1]);
|
||||
if ($run->rowCount() == 0) {
|
||||
echo $pdo->log->info($filePath . " not found in db.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (is_file($filePath) && preg_match('/\d+\.jpg/', $filePath)) {
|
||||
preg_match('/(\d+)\.jpg/', basename($filePath), $match);
|
||||
if (isset($match[1])) {
|
||||
$run = $pdo->queryDirect("UPDATE consoleinfo SET cover = 1 WHERE cover = 0 AND id = " . $match[1]);
|
||||
if ($run->rowCount() >= 1) {
|
||||
$covers++;
|
||||
} else {
|
||||
$run = $pdo->queryDirect("SELECT id FROM consoleinfo WHERE id = " . $match[1]);
|
||||
if ($run->rowCount() == 0) {
|
||||
echo $pdo->log->info($filePath . " not found in db.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$qry = $pdo->queryDirect("SELECT id FROM consoleinfo WHERE cover = 1");
|
||||
|
||||
Reference in New Issue
Block a user