@@ -7,7 +7,7 @@ |
||
7 | 7 | $c = new Blacklight\ColorCLI(); |
8 | 8 | $tvmaze = new TVMaze(); |
9 | 9 | |
10 | -if (! empty($argv[1]) && is_numeric($argv[2]) && is_numeric($argv[3])) { |
|
10 | +if (!empty($argv[1]) && is_numeric($argv[2]) && is_numeric($argv[3])) { |
|
11 | 11 | // Test if your TVMaze API configuration is working |
12 | 12 | // If it works you should get a var dumped array of the show/season/episode entered |
13 | 13 |
@@ -7,7 +7,7 @@ |
||
7 | 7 | $c = new Blacklight\ColorCLI(); |
8 | 8 | $trakt = new TraktTv(); |
9 | 9 | |
10 | -if (! empty($argv[1]) && is_numeric($argv[2]) && is_numeric($argv[3])) { |
|
10 | +if (!empty($argv[1]) && is_numeric($argv[2]) && is_numeric($argv[3])) { |
|
11 | 11 | // Test if your Trakt API key and configuration are working |
12 | 12 | // If it works you should get a printed array of the show/season/episode entered |
13 | 13 |
@@ -7,7 +7,7 @@ |
||
7 | 7 | $c = new Blacklight\ColorCLI(); |
8 | 8 | $tvDB = new TVDB(); |
9 | 9 | |
10 | -if (! empty($argv[1]) && isset($argv[2], $argv[3]) && is_numeric($argv[2]) && is_numeric($argv[3])) { |
|
10 | +if (!empty($argv[1]) && isset($argv[2], $argv[3]) && is_numeric($argv[2]) && is_numeric($argv[3])) { |
|
11 | 11 | // Test if your TvDB API key and configuration are working |
12 | 12 | // If it works you should get a var dumped array of the show/season/episode entered |
13 | 13 |
@@ -8,7 +8,7 @@ |
||
8 | 8 | $omdb = new OMDbAPI(config('nntmux_api.omdb_api_key')); |
9 | 9 | $colorCli = new ColorCLI(); |
10 | 10 | |
11 | -if (! empty($argv[1]) && ! empty($argv[2]) && ($argv[2] !== 'series' || $argv[2] !== 'movie')) { |
|
11 | +if (!empty($argv[1]) && !empty($argv[2]) && ($argv[2] !== 'series' || $argv[2] !== 'movie')) { |
|
12 | 12 | // Test if your OMDb API key and configuration are working |
13 | 13 | // If it works you should get a printed array of the show entered |
14 | 14 |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | |
8 | 8 | $colorCli = new ColorCLI(); |
9 | 9 | |
10 | -if (! empty($argv[1]) && is_numeric($argv[2]) && is_numeric($argv[3])) { |
|
10 | +if (!empty($argv[1]) && is_numeric($argv[2]) && is_numeric($argv[3])) { |
|
11 | 11 | // Test if your TMDB API configuration is working |
12 | 12 | // If it works you should get a var dumped array of the show/season/episode entered |
13 | 13 | |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | print_r($series); |
20 | 20 | |
21 | 21 | // Use the first show found (highest match) and get the requested season/episode from $argv |
22 | - if (! empty($series) && $series['total_results'] > 0) { |
|
22 | + if (!empty($series) && $series['total_results'] > 0) { |
|
23 | 23 | $seriesAppends = [ |
24 | 24 | 'networks' => Tmdb::getTvApi()->getTvshow($series['results'][0]['id'])['networks'], |
25 | 25 | 'alternative_titles' => Tmdb::getTvApi()->getAlternativeTitles($series['results'][0]['id']), |
@@ -8,7 +8,7 @@ |
||
8 | 8 | $fanart = new FanartTV(config('nntmux_api.fanarttv_api_key')); |
9 | 9 | $colorCli = new ColorCLI(); |
10 | 10 | |
11 | -if (! empty($argv[1])) { |
|
11 | +if (!empty($argv[1])) { |
|
12 | 12 | // Test if you can fetch Fanart.TV images |
13 | 13 | |
14 | 14 | // Search for a movie/tv |
@@ -23,19 +23,19 @@ discard block |
||
23 | 23 | } |
24 | 24 | |
25 | 25 | // Verify arguments. |
26 | -if (! is_dir($argv[1])) { |
|
26 | +if (!is_dir($argv[1])) { |
|
27 | 27 | exit('Error: arg1 must be a path (you might not have read access to this path)'.$n); |
28 | 28 | } |
29 | -if (! in_array($argv[2], ['true', 'false'], false)) { |
|
29 | +if (!in_array($argv[2], ['true', 'false'], false)) { |
|
30 | 30 | exit('Error: arg2 must be true or false'.$n); |
31 | 31 | } |
32 | -if (! in_array($argv[3], ['true', 'false'], false)) { |
|
32 | +if (!in_array($argv[3], ['true', 'false'], false)) { |
|
33 | 33 | exit('Error: arg3 must be true or false'.$n); |
34 | 34 | } |
35 | -if (! in_array($argv[4], ['true', 'false'], false)) { |
|
35 | +if (!in_array($argv[4], ['true', 'false'], false)) { |
|
36 | 36 | exit('Error: arg4 must be true or false'.$n); |
37 | 37 | } |
38 | -if (! is_numeric($argv[5])) { |
|
38 | +if (!is_numeric($argv[5])) { |
|
39 | 39 | exit('Error: arg5 must be a number'.$n); |
40 | 40 | } |
41 | 41 | if ($argv[5] < 0) { |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | |
45 | 45 | $path = $argv[1]; |
46 | 46 | // Check if path ends with dir separator. |
47 | -if (! Str::endsWith($path, '/')) { |
|
47 | +if (!Str::endsWith($path, '/')) { |
|
48 | 48 | $path .= '/'; |
49 | 49 | } |
50 | 50 |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | |
5 | 5 | use Illuminate\Support\Facades\File; |
6 | 6 | |
7 | -if (! isset($argv[1]) || ! isset($argv[2])) { |
|
7 | +if (!isset($argv[1]) || !isset($argv[2])) { |
|
8 | 8 | exit( |
9 | 9 | 'Argument 1 is a input string. ie PRE name.'.PHP_EOL. |
10 | 10 | 'Argument 2 is a expected hash or encoding. ie MD5 string. Passing true on Argument 3 ignores this.'.PHP_EOL. |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | |
75 | 75 | $secondArray = []; |
76 | 76 | foreach ($firstArray as $key => $value) { |
77 | - if (! $this->_writeToFile) { |
|
77 | + if (!$this->_writeToFile) { |
|
78 | 78 | if (\in_array($value, $this->_expectedString, false)) { |
79 | 79 | exit( |
80 | 80 | '['. |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | $thirdArray = []; |
97 | 97 | foreach ($secondArray as $key => $value) { |
98 | 98 | foreach ($value as $key2 => $value2) { |
99 | - if (! $this->_writeToFile) { |
|
99 | + if (!$this->_writeToFile) { |
|
100 | 100 | if (\in_array($value2, $this->_expectedString, false)) { |
101 | 101 | exit( |
102 | 102 | '['. |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | foreach ($thirdArray as $key => $value) { |
124 | 124 | foreach ($value as $key2 => $value2) { |
125 | 125 | foreach ($value2 as $key3 => $value3) { |
126 | - if (! $this->_writeToFile) { |
|
126 | + if (!$this->_writeToFile) { |
|
127 | 127 | if (in_array($value3, $this->_expectedString)) { |
128 | 128 | exit( |
129 | 129 | '['. |
@@ -13,14 +13,14 @@ discard block |
||
13 | 13 | $dir = resource_path().'/movednzbs/'; |
14 | 14 | $colorCli = new ColorCLI(); |
15 | 15 | |
16 | -if (! isset($argv[1]) || ! in_array($argv[1], ['true', 'move'])) { |
|
16 | +if (!isset($argv[1]) || !in_array($argv[1], ['true', 'move'])) { |
|
17 | 17 | $colorCli->error("This script can remove all nzbs not found in the db and all releases with no nzbs found. It can also move invalid nzbs.\n\n" |
18 | 18 | ."php $argv[0] true ...: For a dry run, to see how many would be moved.\n" |
19 | 19 | ."php $argv[0] move ...: Move NZBs that are possibly bad or have no release. They are moved into this folder: $dir"); |
20 | 20 | exit(); |
21 | 21 | } |
22 | 22 | |
23 | -if (! File::isDirectory($dir) && ! File::makeDirectory($dir)) { |
|
23 | +if (!File::isDirectory($dir) && !File::makeDirectory($dir)) { |
|
24 | 24 | exit("ERROR: Could not create folder [$dir].".PHP_EOL); |
25 | 25 | } |
26 | 26 | |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | if (File::isFile($filePath) && $guid) { |
44 | 44 | $nzbfile = Utility::unzipGzipFile($filePath); |
45 | 45 | $nzbContents = $nzb->nzbFileList($nzbfile, ['no-file-key' => false, 'strip-count' => true]); |
46 | - if (! $nzbfile || ! @simplexml_load_string($nzbfile) || count($nzbContents) === 0) { |
|
46 | + if (!$nzbfile || !@simplexml_load_string($nzbfile) || count($nzbContents) === 0) { |
|
47 | 47 | if ($argv[1] === 'move') { |
48 | 48 | rename($filePath, $dir.$guid.'.nzb.gz'); |
49 | 49 | } |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | $res = Release::query()->select(['id', 'guid', 'nzbstatus'])->get(); |
65 | 65 | foreach ($res as $row) { |
66 | 66 | $nzbpath = $nzb->getNZBPath($row->guid); |
67 | - if (! File::isFile($nzbpath)) { |
|
67 | + if (!File::isFile($nzbpath)) { |
|
68 | 68 | $deleted++; |
69 | 69 | $releases->deleteSingle(['g' => $row->guid, 'i' => $row->id], $nzb, $releaseImage); |
70 | 70 | } elseif ($row->nzbstatus !== 1) { |