Passed
Push — dev ( e5549c...f444ba )
by Darko
09:41
created
misc/testing/PostProc/updateBookImages.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 $covers = $updated = $deleted = 0;
9 9
 
10 10
 if ($argc == 1 || $argv[1] != 'true') {
11
-    exit($pdo->log->error("\nThis script will check all images in covers/book and compare to db->bookinfo.\nTo run:\nphp $argv[0] true\n"));
11
+	exit($pdo->log->error("\nThis script will check all images in covers/book and compare to db->bookinfo.\nTo run:\nphp $argv[0] true\n"));
12 12
 }
13 13
 
14 14
 
@@ -17,20 +17,20 @@  discard block
 block discarded – undo
17 17
 $dirItr = new \RecursiveDirectoryIterator($path2covers);
18 18
 $itr = new \RecursiveIteratorIterator($dirItr, \RecursiveIteratorIterator::LEAVES_ONLY);
19 19
 foreach ($itr as $filePath) {
20
-    if (is_file($filePath) && preg_match('/\d+\.jpg/', $filePath)) {
21
-        preg_match('/(\d+)\.jpg/', basename($filePath), $match);
22
-        if (isset($match[1])) {
23
-            $run = $pdo->queryDirect("UPDATE bookinfo SET cover = 1 WHERE cover = 0 AND id = " . $match[1]);
24
-            if ($run->rowCount() >= 1) {
25
-                $covers++;
26
-            } else {
27
-                $run = $pdo->queryDirect("SELECT id FROM bookinfo WHERE id = " . $match[1]);
28
-                if ($run->rowCount() == 0) {
29
-                    echo $pdo->log->info($filePath . " not found in db.");
30
-                }
31
-            }
32
-        }
33
-    }
20
+	if (is_file($filePath) && preg_match('/\d+\.jpg/', $filePath)) {
21
+		preg_match('/(\d+)\.jpg/', basename($filePath), $match);
22
+		if (isset($match[1])) {
23
+			$run = $pdo->queryDirect("UPDATE bookinfo SET cover = 1 WHERE cover = 0 AND id = " . $match[1]);
24
+			if ($run->rowCount() >= 1) {
25
+				$covers++;
26
+			} else {
27
+				$run = $pdo->queryDirect("SELECT id FROM bookinfo WHERE id = " . $match[1]);
28
+				if ($run->rowCount() == 0) {
29
+					echo $pdo->log->info($filePath . " not found in db.");
30
+				}
31
+			}
32
+		}
33
+	}
34 34
 }
35 35
 
36 36
 $qry = $pdo->queryDirect("SELECT id FROM bookinfo WHERE cover = 1");
Please login to merge, or discard this patch.
misc/testing/PostProc/getGameCovers.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
 				echo $pdo->log->primary($gameInfo['release'] . ' not found');
28 28
 			} else {
29 29
 				if (file_exists(NN_COVERS . 'games' . DS . $gameData . '.jpg')) {
30
-					$pdo->queryExec(sprintf('UPDATE gamesinfo SET cover = 1 WHERE id = %d',	$arr['id']));
30
+					$pdo->queryExec(sprintf('UPDATE gamesinfo SET cover = 1 WHERE id = %d', $arr['id']));
31 31
 				}
32 32
 			}
33 33
 		}
Please login to merge, or discard this patch.
misc/testing/PostProc/updateConsoleImages.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 $covers = $updated = $deleted = 0;
9 9
 
10 10
 if ($argc == 1 || $argv[1] != 'true') {
11
-    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"));
11
+	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"));
12 12
 }
13 13
 
14 14
 
@@ -17,20 +17,20 @@  discard block
 block discarded – undo
17 17
 $dirItr = new \RecursiveDirectoryIterator($path2covers);
18 18
 $itr = new \RecursiveIteratorIterator($dirItr, \RecursiveIteratorIterator::LEAVES_ONLY);
19 19
 foreach ($itr as $filePath) {
20
-    if (is_file($filePath) && preg_match('/\d+\.jpg/', $filePath)) {
21
-        preg_match('/(\d+)\.jpg/', basename($filePath), $match);
22
-        if (isset($match[1])) {
23
-            $run = $pdo->queryDirect("UPDATE consoleinfo SET cover = 1 WHERE cover = 0 AND id = " . $match[1]);
24
-            if ($run->rowCount() >= 1) {
25
-                $covers++;
26
-            } else {
27
-                $run = $pdo->queryDirect("SELECT id FROM consoleinfo WHERE id = " . $match[1]);
28
-                if ($run->rowCount() == 0) {
29
-                    echo $pdo->log->info($filePath . " not found in db.");
30
-                }
31
-            }
32
-        }
33
-    }
20
+	if (is_file($filePath) && preg_match('/\d+\.jpg/', $filePath)) {
21
+		preg_match('/(\d+)\.jpg/', basename($filePath), $match);
22
+		if (isset($match[1])) {
23
+			$run = $pdo->queryDirect("UPDATE consoleinfo SET cover = 1 WHERE cover = 0 AND id = " . $match[1]);
24
+			if ($run->rowCount() >= 1) {
25
+				$covers++;
26
+			} else {
27
+				$run = $pdo->queryDirect("SELECT id FROM consoleinfo WHERE id = " . $match[1]);
28
+				if ($run->rowCount() == 0) {
29
+					echo $pdo->log->info($filePath . " not found in db.");
30
+				}
31
+			}
32
+		}
33
+	}
34 34
 }
35 35
 
36 36
 $qry = $pdo->queryDirect("SELECT id FROM consoleinfo WHERE cover = 1");
Please login to merge, or discard this patch.
misc/testing/fix_filesize.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,5 +39,5 @@
 block discarded – undo
39 39
 	$pdo->queryExec("UPDATE releases SET size = '{$filesize}' WHERE id = '{$item['id']}' LIMIT 1");
40 40
 
41 41
 	$compl++;
42
-	echo sprintf("[%6d / %6d] %0.2f",$compl, $total, ($compl/$total) * 100) . '%' . "\n";
42
+	echo sprintf("[%6d / %6d] %0.2f", $compl, $total, ($compl / $total) * 100) . '%' . "\n";
43 43
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,8 +19,7 @@
 block discarded – undo
19 19
 $compl = 0;
20 20
 echo "Updating file size for " . count($items) . " release(s)\n";
21 21
 
22
-while ($item = array_pop($items))
23
-{
22
+while ($item = array_pop($items)) {
24 23
 	$nzbpath = $nzb->getNZBPath($item['guid'], $pdo->getSetting('nzbpath'));
25 24
 
26 25
 	ob_start();
Please login to merge, or discard this patch.
misc/testing/Releases/delete_releases.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 if ($totalArgs < 2) {
17 17
 	exit($cli->info($n .
18 18
 		'This deletes releases based on a list of criteria you pass.' . $n .
19
-		'Usage:' . $n . $n.
19
+		'Usage:' . $n . $n .
20 20
 		'List of supported criteria:' . $n .
21 21
 		'fromname   : Look for names of people who posted releases (the poster name). (modifiers: equals, like)' . $n .
22 22
 		'groupname  : Look in groups. (modifiers: equals, like)' . $n .
@@ -44,11 +44,11 @@  discard block
 block discarded – undo
44 44
 		$_SERVER['_'] . ' ' . $argv[0] . ' groupname=equals="alt.binaries.teevee" searchname=like="olympics 2014" postdate=bigger="5"' . $n .
45 45
 		$_SERVER['_'] . ' ' . $argv[0] . ' guid=equals="8fb5956bae3de4fb94edcc69da44d6883d586fd0"' . $n .
46 46
 		$_SERVER['_'] . ' ' . $argv[0] . ' size=smaller="104857600" size=bigger="2048" groupname=like="movies"' . $n .
47
-		$_SERVER['_'] . ' ' . $argv[0] . ' fromname=like="@XviD.net" groupname=equals="alt.binaries.movies.divx" ignore' .$n .
47
+		$_SERVER['_'] . ' ' . $argv[0] . ' fromname=like="@XviD.net" groupname=equals="alt.binaries.movies.divx" ignore' . $n .
48 48
 		$_SERVER['_'] . ' ' . $argv[0] . ' imdbid=equals=NULL categories_id=equals=2999 nzbstatus=equals=1 adddate=bigger=2880 # Remove other movie releases with non-cleaned names added > 120 days ago'
49 49
 	));
50 50
 }
51 51
 
52 52
 $RR = new ReleaseRemover();
53 53
 // Remove argv[0] and send the array.
54
-$RR->removeByCriteria(array_slice($argv, 1, $totalArgs-1));
54
+$RR->removeByCriteria(array_slice($argv, 1, $totalArgs - 1));
Please login to merge, or discard this patch.
misc/sphinxsearch/populate_rt_indexes.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
 
55 55
 	$lastId = $minId - 1;
56 56
 	echo "[Starting to populate sphinx RT index $table with $total releases.]\n";
57
-	for ($i = $minId; $i <= ($total + $max + $minId) ; $i += $max) {
57
+	for ($i = $minId; $i <= ($total + $max + $minId); $i += $max) {
58 58
 
59 59
 		$rows = $pdo->queryDirect(sprintf($query, $lastId, $max));
60 60
 		if (!$rows) {
Please login to merge, or discard this patch.
misc/sphinxsearch/create_se_tables.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
 	filename    VARCHAR(1000) NULL,
37 37
 	INDEX(query)
38 38
 ) ENGINE=SPHINX CONNECTION="%sreleases_rt"
39
-DDLSQL;
39
+ddlsql;
40 40
 
41 41
 $tables                     = [];
42 42
 $tables['releases_se']      = sprintf($tableSQL_releases, $sphinxConnection);
Please login to merge, or discard this patch.
misc/IRCScraper/scrape.php 1 patch
Switch Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -8,16 +8,16 @@
 block discarded – undo
8 8
 }
9 9
 
10 10
 switch (true) {
11
-	case is_file(IRC_SCRAPER_CONFIG):
12
-		break;
13
-	case is_file(NN_ROOT . 'misc/testing/IRCScraper/settings.php'):
14
-		rename(NN_ROOT . 'misc/testing/IRCScraper/settings.php', IRC_SCRAPER_CONFIG);
15
-		break;
16
-	default:
17
-		exit(
18
-			'Copy ' . NN_CONFIGS . 'ircscraper_settings_example.php to ' .
19
-			IRC_SCRAPER_CONFIG . ' and change the settings.' . PHP_EOL
20
-		);
11
+		case is_file(IRC_SCRAPER_CONFIG):
12
+			break;
13
+		case is_file(NN_ROOT . 'misc/testing/IRCScraper/settings.php'):
14
+			rename(NN_ROOT . 'misc/testing/IRCScraper/settings.php', IRC_SCRAPER_CONFIG);
15
+			break;
16
+		default:
17
+			exit(
18
+				'Copy ' . NN_CONFIGS . 'ircscraper_settings_example.php to ' .
19
+				IRC_SCRAPER_CONFIG . ' and change the settings.' . PHP_EOL
20
+			);
21 21
 }
22 22
 
23 23
 if (!isset($argv[1]) || $argv[1] != 'true') {
Please login to merge, or discard this patch.
cli/data/predb_import_daily_batch.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@
 block discarded – undo
123 123
 				continue;
124 124
 			} else {
125 125
 				if (NN_DEBUG) {
126
-					echo "Dump {$match[2]} downloaded\n";
126
+					echo "dump {$match[2]} downloaded\n";
127 127
 				}
128 128
 			}
129 129
 
Please login to merge, or discard this patch.