Passed
Pull Request — master (#1608)
by Darko
06:58
created
app/Models/Predb.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -196,7 +196,7 @@
 block discarded – undo
196 196
             return $predb;
197 197
         }
198 198
         $sql = self::query()->leftJoin('releases', 'releases.predb_id', '=', 'predb.id')->orderByDesc('predb.predate');
199
-        if (! empty($search)) {
199
+        if (!empty($search)) {
200 200
             if (config('nntmux.elasticsearch_enabled') === true) {
201 201
                 $ids = (new ElasticSearchSiteSearch)->predbIndexSearch($search);
202 202
             } else {
Please login to merge, or discard this patch.
app/Models/Release.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
     public static function updateRelease($id, $name, $searchName, $fromName, $categoryId, $parts, $grabs, $size, $postedDate, $addedDate, $videoId, $episodeId, $imDbId, $aniDbId): void
276 276
     {
277 277
         $movieInfoId = null;
278
-        if (! empty($imDbId)) {
278
+        if (!empty($imDbId)) {
279 279
             $movieInfoId = MovieInfo::whereImdbid($imDbId)->first(['id']);
280 280
         }
281 281
         self::whereId($id)->update(
@@ -526,12 +526,12 @@  discard block
 block discarded – undo
526 526
 
527 527
         preg_match('/(^\w+[-_. ].+?\.(\d+p)).+/i', $rel['searchname'], $similar);
528 528
 
529
-        if (! empty($similar)) {
529
+        if (!empty($similar)) {
530 530
             if (config('nntmux.elasticsearch_enabled') === true) {
531 531
                 $searchResult = (new ElasticSearchSiteSearch)->indexSearch($similar[1], 10);
532 532
             } else {
533 533
                 $searchResult = (new ManticoreSearch)->searchIndexes('releases_rt', $similar[1]);
534
-                if (! empty($searchResult)) {
534
+                if (!empty($searchResult)) {
535 535
                     $searchResult = Arr::wrap(Arr::get($searchResult, 'id'));
536 536
                 }
537 537
             }
Please login to merge, or discard this patch.
app/Console/Commands/NntmuxPopulateSearchIndexes.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
         $manticore->truncateRTIndex(Arr::wrap('releases_rt'));
65 65
         $data = [];
66 66
         $total = Release::count();
67
-        if (! $total) {
67
+        if (!$total) {
68 68
             $this->warn('Releases table is empty. Nothing to do.');
69 69
             exit();
70 70
         }
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
             ->select(['releases.id', 'releases.name', 'releases.searchname', 'releases.fromname', 'releases.categories_id'])
85 85
             ->selectRaw('IFNULL(GROUP_CONCAT(release_files.name SEPARATOR " "),"") filename')
86 86
             ->groupBy('id')
87
-            ->chunk($max, function ($releases) use ($manticore, $bar, $data) {
87
+            ->chunk($max, function($releases) use ($manticore, $bar, $data) {
88 88
                 foreach ($releases as $r) {
89 89
                     $data[] = [
90 90
                         'id' => $r->id,
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
         $data = [];
113 113
 
114 114
         $total = Predb::count();
115
-        if (! $total) {
115
+        if (!$total) {
116 116
             $this->warn('PreDB table is empty. Nothing to do.');
117 117
             exit();
118 118
         }
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
             ->select(['id', 'title', 'filename', 'source'])
130 130
             ->groupBy('id')
131 131
             ->orderBy('id')
132
-            ->chunk($max, function ($pre) use ($manticore, $bar, $data) {
132
+            ->chunk($max, function($pre) use ($manticore, $bar, $data) {
133 133
                 foreach ($pre as $p) {
134 134
                     $data[] = [
135 135
                         'id' => $p->id,
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
         $data = ['body' => []];
152 152
         $elastic = new ElasticSearchSiteSearch;
153 153
         $total = Release::count();
154
-        if (! $total) {
154
+        if (!$total) {
155 155
             $this->warn('Could not get database information for releases table.');
156 156
             exit();
157 157
         }
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
             ->select(['releases.id', 'releases.name', 'releases.searchname', 'releases.fromname', 'releases.categories_id', 'releases.postdate'])
170 170
             ->selectRaw('IFNULL(GROUP_CONCAT(release_files.name SEPARATOR " "),"") filename')
171 171
             ->groupBy('id')
172
-            ->chunk($max, function ($releases) use ($bar, $data) {
172
+            ->chunk($max, function($releases) use ($bar, $data) {
173 173
                 foreach ($releases as $r) {
174 174
                     $searchName = str_replace(['.', '-'], ' ', $r->searchname);
175 175
                     $data['body'][] = [
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
         $data = ['body' => []];
203 203
         $elastic = new ElasticSearchSiteSearch;
204 204
         $total = Predb::count();
205
-        if (! $total) {
205
+        if (!$total) {
206 206
             $this->warn('Could not get database information for predb table.');
207 207
             exit();
208 208
         }
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
             ->select(['id', 'title', 'filename', 'source'])
220 220
             ->groupBy('id')
221 221
             ->orderBy('id')
222
-            ->chunk($max, function ($pre) use ($bar, $data) {
222
+            ->chunk($max, function($pre) use ($bar, $data) {
223 223
                 foreach ($pre as $p) {
224 224
                     $data['body'][] = [
225 225
                         'index' => [
Please login to merge, or discard this patch.
app/Console/Commands/CleanNZB.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
     public function handle(): void
38 38
     {
39 39
         // Check if any options are false
40
-        if (! $this->option('notindb') && ! $this->option('notondisk')) {
40
+        if (!$this->option('notindb') && !$this->option('notondisk')) {
41 41
             $this->error('You must specify at least one option. See: --help');
42 42
             exit();
43 43
         }
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
             $guid = stristr($filePath->getFilename(), '.nzb.gz', true);
64 64
             if (File::isFile($filePath) && $guid) {
65 65
                 // If NZB file guid is not present in DB delete the file from disk
66
-                if (! $releases->whereGuid($guid)->exists()) {
66
+                if (!$releases->whereGuid($guid)->exists()) {
67 67
                     if ($delete) {
68 68
                         File::delete($filePath);
69 69
                     }
@@ -88,11 +88,11 @@  discard block
 block discarded – undo
88 88
         $total = Release::count();
89 89
         $this->alert("Total releases to check: $total");
90 90
 
91
-        Release::where('nzbstatus', 1)->chunkById((int) $this->option('chunksize'), function (Collection $releases) use ($delete, &$checked, &$deleted, $nzb, $rel) {
91
+        Release::where('nzbstatus', 1)->chunkById((int) $this->option('chunksize'), function(Collection $releases) use ($delete, &$checked, &$deleted, $nzb, $rel) {
92 92
             echo 'Total done: '.$checked."\r";
93 93
             foreach ($releases as $r) {
94 94
 
95
-                if (! $nzb->NZBPath($r->guid)) {
95
+                if (!$nzb->NZBPath($r->guid)) {
96 96
                     if ($delete) {
97 97
                         $rel->deleteSingle(['g' => $r->guid, 'i' => $r->id], $nzb, new ReleaseImage);
98 98
                     }
Please login to merge, or discard this patch.
Blacklight/Movie.php 1 patch
Spacing   +68 added lines, -68 removed lines patch added patch discarded remove patch
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
         $this->config->language = $this->lookuplanguage;
138 138
         $this->config->throwHttpExceptions = false;
139 139
         $cacheDir = storage_path('framework/cache/imdb_cache');
140
-        if (! File::isDirectory($cacheDir)) {
140
+        if (!File::isDirectory($cacheDir)) {
141 141
             File::makeDirectory($cacheDir, 0777, false, true);
142 142
         }
143 143
         $this->config->cachedir = $cacheDir;
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 					ORDER BY %s %s %s",
191 191
                 $this->showPasswords,
192 192
                 $this->getBrowseBy(),
193
-                (! empty($catsrch) ? $catsrch : ''),
193
+                (!empty($catsrch) ? $catsrch : ''),
194 194
                 (
195 195
                     $maxAge > 0
196 196
                     ? 'AND r.postdate > NOW() - INTERVAL '.$maxAge.'DAY '
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
             Cache::put(md5($moviesSql.$page), $movies, $expiresAt);
211 211
         }
212 212
         $movieIDs = $releaseIDs = [];
213
-        if (! empty($movies['result'])) {
213
+        if (!empty($movies['result'])) {
214 214
             foreach ($movies['result'] as $movie => $id) {
215 215
                 $movieIDs[] = $id->imdbid;
216 216
                 $releaseIDs[] = $id->grp_release_id;
@@ -249,9 +249,9 @@  discard block
 block discarded – undo
249 249
 			AND r.id IN (%s) %s
250 250
 			GROUP BY m.imdbid
251 251
 			ORDER BY %s %s",
252
-            (\is_array($movieIDs) && ! empty($movieIDs) ? implode(',', $movieIDs) : -1),
253
-            (\is_array($releaseIDs) && ! empty($releaseIDs) ? implode(',', $releaseIDs) : -1),
254
-            (! empty($catsrch) ? $catsrch : ''),
252
+            (\is_array($movieIDs) && !empty($movieIDs) ? implode(',', $movieIDs) : -1),
253
+            (\is_array($releaseIDs) && !empty($releaseIDs) ? implode(',', $releaseIDs) : -1),
254
+            (!empty($catsrch) ? $catsrch : ''),
255 255
             $order[0],
256 256
             $order[1]
257 257
         );
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
         $browseBy = ' ';
298 298
         $browseByArr = ['title', 'director', 'actors', 'genre', 'rating', 'year', 'imdb'];
299 299
         foreach ($browseByArr as $bb) {
300
-            if (request()->has($bb) && ! empty(request()->input($bb))) {
300
+            if (request()->has($bb) && !empty(request()->input($bb))) {
301 301
                 $bbv = stripslashes(request()->input($bb));
302 302
                 if ($bb === 'rating') {
303 303
                     $bbv .= '.';
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
 
331 331
         if ($this->traktcheck !== null) {
332 332
             $data = $this->traktTv->client->movieSummary('tt'.$imdbId, 'full');
333
-            if (($data !== false) && ! empty($data['trailer'])) {
333
+            if (($data !== false) && !empty($data['trailer'])) {
334 334
                 return $data['trailer'];
335 335
             }
336 336
         }
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
             return false;
357 357
         }
358 358
 
359
-        if (! empty($data['trailer'])) {
359
+        if (!empty($data['trailer'])) {
360 360
             $data['trailer'] = str_ireplace(
361 361
                 ['watch?v=', 'http://'],
362 362
                 ['embed/', 'https://'],
@@ -390,17 +390,17 @@  discard block
 block discarded – undo
390 390
      */
391 391
     private function checkTraktValue($value)
392 392
     {
393
-        if (\is_array($value) && ! empty($value)) {
393
+        if (\is_array($value) && !empty($value)) {
394 394
             $temp = '';
395 395
             foreach ($value as $val) {
396
-                if (! \is_array($val) && ! \is_object($val)) {
396
+                if (!\is_array($val) && !\is_object($val)) {
397 397
                     $temp .= $val;
398 398
                 }
399 399
             }
400 400
             $value = $temp;
401 401
         }
402 402
 
403
-        return ! empty($value) ? $value : '';
403
+        return !empty($value) ? $value : '';
404 404
     }
405 405
 
406 406
     /**
@@ -421,7 +421,7 @@  discard block
 block discarded – undo
421 421
      */
422 422
     public function update(array $values): bool
423 423
     {
424
-        if (! \count($values)) {
424
+        if (!\count($values)) {
425 425
             return false;
426 426
         }
427 427
 
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
         $onDuplicateKey = ['created_at' => now()];
430 430
         $found = 0;
431 431
         foreach ($values as $key => $value) {
432
-            if (! empty($value)) {
432
+            if (!empty($value)) {
433 433
                 $found++;
434 434
                 if (\in_array($key, ['genre', 'language'], false)) {
435 435
                     $value = substr($value, 0, 64);
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
                 $onDuplicateKey += [$key => $value];
439 439
             }
440 440
         }
441
-        if (! $found) {
441
+        if (!$found) {
442 442
             return false;
443 443
         }
444 444
         foreach ($query as $key => $value) {
@@ -455,19 +455,19 @@  discard block
 block discarded – undo
455 455
      */
456 456
     protected function setVariables(string|array $variable1, string|array $variable2, string|array $variable3, string|array $variable4, string|array $variable5)
457 457
     {
458
-        if (! empty($variable1)) {
458
+        if (!empty($variable1)) {
459 459
             return $variable1;
460 460
         }
461
-        if (! empty($variable2)) {
461
+        if (!empty($variable2)) {
462 462
             return $variable2;
463 463
         }
464
-        if (! empty($variable3)) {
464
+        if (!empty($variable3)) {
465 465
             return $variable3;
466 466
         }
467
-        if (! empty($variable4)) {
467
+        if (!empty($variable4)) {
468 468
             return $variable4;
469 469
         }
470
-        if (! empty($variable5)) {
470
+        if (!empty($variable5)) {
471 471
             return $variable5;
472 472
         }
473 473
 
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
 
503 503
         $iTunes = $this->fetchItunesMovieProperties($this->currentTitle);
504 504
 
505
-        if (! $imdb && ! $tmdb && ! $trakt && ! $omdb && empty($iTunes)) {
505
+        if (!$imdb && !$tmdb && !$trakt && !$omdb && empty($iTunes)) {
506 506
             return false;
507 507
         }
508 508
 
@@ -515,36 +515,36 @@  discard block
 block discarded – undo
515 515
         $mov['type'] = $mov['director'] = $mov['actors'] = $mov['language'] = '';
516 516
 
517 517
         $mov['imdbid'] = $imdbId;
518
-        $mov['tmdbid'] = (! isset($tmdb['tmdbid']) || $tmdb['tmdbid'] === '') ? 0 : $tmdb['tmdbid'];
519
-        $mov['traktid'] = (! isset($trakt['id']) || $trakt['id'] === '') ? 0 : $trakt['id'];
518
+        $mov['tmdbid'] = (!isset($tmdb['tmdbid']) || $tmdb['tmdbid'] === '') ? 0 : $tmdb['tmdbid'];
519
+        $mov['traktid'] = (!isset($trakt['id']) || $trakt['id'] === '') ? 0 : $trakt['id'];
520 520
 
521 521
         // Prefer Fanart.tv cover over TMDB,TMDB over IMDB,IMDB over OMDB and OMDB over iTunes.
522
-        if (! empty($fanart['cover'])) {
522
+        if (!empty($fanart['cover'])) {
523 523
             $mov['cover'] = $this->releaseImage->saveImage($imdbId.'-cover', $fanart['cover'], $this->imgSavePath);
524
-        } elseif (! empty($tmdb['cover'])) {
524
+        } elseif (!empty($tmdb['cover'])) {
525 525
             $mov['cover'] = $this->releaseImage->saveImage($imdbId.'-cover', $tmdb['cover'], $this->imgSavePath);
526
-        } elseif (! empty($imdb['cover'])) {
526
+        } elseif (!empty($imdb['cover'])) {
527 527
             $mov['cover'] = $this->releaseImage->saveImage($imdbId.'-cover', $imdb['cover'], $this->imgSavePath);
528
-        } elseif (! empty($omdb['cover'])) {
528
+        } elseif (!empty($omdb['cover'])) {
529 529
             $mov['cover'] = $this->releaseImage->saveImage($imdbId.'-cover', $omdb['cover'], $this->imgSavePath);
530
-        } elseif (! empty($iTunes['cover'])) {
530
+        } elseif (!empty($iTunes['cover'])) {
531 531
             $mov['cover'] = $this->releaseImage->saveImage($imdbId.'-cover', $iTunes['cover'], $this->imgSavePath);
532 532
         }
533 533
 
534 534
         // Backdrops.
535
-        if (! empty($fanart['backdrop'])) {
535
+        if (!empty($fanart['backdrop'])) {
536 536
             $mov['backdrop'] = $this->releaseImage->saveImage($imdbId.'-backdrop', $fanart['backdrop'], $this->imgSavePath, 1920, 1024);
537
-        } elseif (! empty($tmdb['backdrop'])) {
537
+        } elseif (!empty($tmdb['backdrop'])) {
538 538
             $mov['backdrop'] = $this->releaseImage->saveImage($imdbId.'-backdrop', $tmdb['backdrop'], $this->imgSavePath, 1920, 1024);
539 539
         }
540 540
 
541 541
         // Banner
542
-        if (! empty($fanart['banner'])) {
542
+        if (!empty($fanart['banner'])) {
543 543
             $mov['banner'] = $this->releaseImage->saveImage($imdbId.'-banner', $fanart['banner'], $this->imgSavePath);
544 544
         }
545 545
 
546 546
         // RottenTomatoes rating from OmdbAPI
547
-        if ($omdb !== false && ! empty($omdb['rtRating'])) {
547
+        if ($omdb !== false && !empty($omdb['rtRating'])) {
548 548
             $mov['rtrating'] = $omdb['rtRating'];
549 549
         }
550 550
 
@@ -555,29 +555,29 @@  discard block
 block discarded – undo
555 555
         $mov['year'] = $this->setVariables($imdb['year'] ?? '', $tmdb['year'] ?? '', $trakt['year'] ?? '', $omdb['year'] ?? '', $iTunes['year'] ?? '');
556 556
         $mov['genre'] = $this->setVariables($imdb['genre'] ?? '', $tmdb['genre'] ?? '', $trakt['genres'] ?? '', $omdb['genre'] ?? '', $iTunes['genre'] ?? '');
557 557
 
558
-        if (! empty($imdb['type'])) {
558
+        if (!empty($imdb['type'])) {
559 559
             $mov['type'] = $imdb['type'];
560 560
         }
561 561
 
562
-        if (! empty($imdb['director'])) {
562
+        if (!empty($imdb['director'])) {
563 563
             $mov['director'] = \is_array($imdb['director']) ? implode(', ', array_unique($imdb['director'])) : $imdb['director'];
564
-        } elseif (! empty($omdb['director'])) {
564
+        } elseif (!empty($omdb['director'])) {
565 565
             $mov['director'] = \is_array($omdb['director']) ? implode(', ', array_unique($omdb['director'])) : $omdb['director'];
566
-        } elseif (! empty($tmdb['director'])) {
566
+        } elseif (!empty($tmdb['director'])) {
567 567
             $mov['director'] = \is_array($tmdb['director']) ? implode(', ', array_unique($tmdb['director'])) : $tmdb['director'];
568 568
         }
569 569
 
570
-        if (! empty($imdb['actors'])) {
570
+        if (!empty($imdb['actors'])) {
571 571
             $mov['actors'] = \is_array($imdb['actors']) ? implode(', ', array_unique($imdb['actors'])) : $imdb['actors'];
572
-        } elseif (! empty($omdb['actors'])) {
572
+        } elseif (!empty($omdb['actors'])) {
573 573
             $mov['actors'] = \is_array($omdb['actors']) ? implode(', ', array_unique($omdb['actors'])) : $omdb['actors'];
574
-        } elseif (! empty($tmdb['actors'])) {
574
+        } elseif (!empty($tmdb['actors'])) {
575 575
             $mov['actors'] = \is_array($tmdb['actors']) ? implode(', ', array_unique($tmdb['actors'])) : $tmdb['actors'];
576 576
         }
577 577
 
578
-        if (! empty($imdb['language'])) {
578
+        if (!empty($imdb['language'])) {
579 579
             $mov['language'] = \is_array($imdb['language']) ? implode(', ', array_unique($imdb['language'])) : $imdb['language'];
580
-        } elseif (! empty($omdb['language']) && ! is_bool($omdb['language'])) {
580
+        } elseif (!empty($omdb['language']) && !is_bool($omdb['language'])) {
581 581
             $mov['language'] = \is_array($omdb['language']) ? implode(', ', array_unique($omdb['language'])) : $omdb['language'];
582 582
         }
583 583
 
@@ -635,20 +635,20 @@  discard block
 block discarded – undo
635 635
         if ($this->fanartapikey !== null) {
636 636
             $art = $this->fanart->getMovieFanArt('tt'.$imdbId);
637 637
 
638
-            if (! empty($art)) {
638
+            if (!empty($art)) {
639 639
                 if (isset($art['status']) && $art['status'] === 'error') {
640 640
                     return false;
641 641
                 }
642 642
                 $ret = [];
643
-                if (! empty($art['moviebackground'][0]['url'])) {
643
+                if (!empty($art['moviebackground'][0]['url'])) {
644 644
                     $ret['backdrop'] = $art['moviebackground'][0]['url'];
645
-                } elseif (! empty($art['moviethumb'][0]['url'])) {
645
+                } elseif (!empty($art['moviethumb'][0]['url'])) {
646 646
                     $ret['backdrop'] = $art['moviethumb'][0]['url'];
647 647
                 }
648
-                if (! empty($art['movieposter'][0]['url'])) {
648
+                if (!empty($art['movieposter'][0]['url'])) {
649 649
                     $ret['cover'] = $art['movieposter'][0]['url'];
650 650
                 }
651
-                if (! empty($art['moviebanner'][0]['url'])) {
651
+                if (!empty($art['moviebanner'][0]['url'])) {
652 652
                     $ret['banner'] = $art['moviebanner'][0]['url'];
653 653
                 }
654 654
 
@@ -685,7 +685,7 @@  discard block
 block discarded – undo
685 685
             return false;
686 686
         }
687 687
 
688
-        if (! empty($tmdbLookup)) {
688
+        if (!empty($tmdbLookup)) {
689 689
             if ($this->currentTitle !== '') {
690 690
                 // Check the similarity.
691 691
                 similar_text($this->currentTitle, $tmdbLookup['title'], $percent);
@@ -714,7 +714,7 @@  discard block
 block discarded – undo
714 714
                 $ret['rating'] = '';
715 715
             }
716 716
             $actors = Arr::pluck($tmdbLookup['credits']['cast'], 'name');
717
-            if (! empty($actors)) {
717
+            if (!empty($actors)) {
718 718
                 $ret['actors'] = $actors;
719 719
             } else {
720 720
                 $ret['actors'] = '';
@@ -725,7 +725,7 @@  discard block
 block discarded – undo
725 725
                 }
726 726
             }
727 727
             $overview = $tmdbLookup['overview'];
728
-            if (! empty($overview)) {
728
+            if (!empty($overview)) {
729 729
                 $ret['plot'] = $overview;
730 730
             } else {
731 731
                 $ret['plot'] = '';
@@ -735,13 +735,13 @@  discard block
 block discarded – undo
735 735
             $ret['tagline'] = $tagline ?? '';
736 736
 
737 737
             $released = $tmdbLookup['release_date'];
738
-            if (! empty($released)) {
738
+            if (!empty($released)) {
739 739
                 $ret['year'] = Carbon::parse($released)->year;
740 740
             } else {
741 741
                 $ret['year'] = '';
742 742
             }
743 743
             $genresa = $tmdbLookup['genres'];
744
-            if (! empty($genresa) && \count($genresa) > 0) {
744
+            if (!empty($genresa) && \count($genresa) > 0) {
745 745
                 $genres = [];
746 746
                 foreach ($genresa as $genre) {
747 747
                     $genres[] = $genre['name'];
@@ -751,13 +751,13 @@  discard block
 block discarded – undo
751 751
                 $ret['genre'] = '';
752 752
             }
753 753
             $posterp = $tmdbLookup['poster_path'];
754
-            if (! empty($posterp)) {
754
+            if (!empty($posterp)) {
755 755
                 $ret['cover'] = 'https://image.tmdb.org/t/p/original'.$posterp;
756 756
             } else {
757 757
                 $ret['cover'] = '';
758 758
             }
759 759
             $backdrop = $tmdbLookup['backdrop_path'];
760
-            if (! empty($backdrop)) {
760
+            if (!empty($backdrop)) {
761 761
                 $ret['backdrop'] = 'https://image.tmdb.org/t/p/original'.$backdrop;
762 762
             } else {
763 763
                 $ret['backdrop'] = '';
@@ -779,9 +779,9 @@  discard block
 block discarded – undo
779 779
     {
780 780
         $realId = (new Title($imdbId, $this->config))->real_id();
781 781
         $result = new Title($realId, $this->config);
782
-        $title = ! empty($result->orig_title()) ? $result->orig_title() : $result->title();
783
-        if (! empty($title)) {
784
-            if (! empty($this->currentTitle)) {
782
+        $title = !empty($result->orig_title()) ? $result->orig_title() : $result->title();
783
+        if (!empty($title)) {
784
+            if (!empty($this->currentTitle)) {
785 785
                 similar_text($this->currentTitle, $title, $percent);
786 786
                 if ($percent >= self::MATCH_PERCENT) {
787 787
                     similar_text($this->currentYear, $result->year(), $percent);
@@ -790,7 +790,7 @@  discard block
 block discarded – undo
790 790
                             'title' => $title,
791 791
                             'tagline' => $result->tagline() ?? '',
792 792
                             'plot' => Arr::get($result->plot_split(), '0.plot'),
793
-                            'rating' => ! empty($result->rating()) ? $result->rating() : '',
793
+                            'rating' => !empty($result->rating()) ? $result->rating() : '',
794 794
                             'year' => $result->year() ?? '',
795 795
                             'cover' => $result->photo() ?? '',
796 796
                             'genre' => $result->genre() ?? '',
@@ -815,7 +815,7 @@  discard block
 block discarded – undo
815 815
                 'title' => $title,
816 816
                 'tagline' => $result->tagline() ?? '',
817 817
                 'plot' => Arr::get($result->plot_split(), '0.plot'),
818
-                'rating' => ! empty($result->rating()) ? $result->rating() : '',
818
+                'rating' => !empty($result->rating()) ? $result->rating() : '',
819 819
                 'year' => $result->year() ?? '',
820 820
                 'cover' => $result->photo() ?? '',
821 821
                 'genre' => $result->genre() ?? '',
@@ -889,7 +889,7 @@  discard block
 block discarded – undo
889 889
         if ($this->omdbapikey !== null) {
890 890
             $resp = $this->omdbApi->fetch('i', 'tt'.$imdbId);
891 891
 
892
-            if (\is_object($resp) && $resp->message === 'OK' && ! Str::contains($resp->data->Response, 'Error:') && $resp->data->Response !== 'False') {
892
+            if (\is_object($resp) && $resp->message === 'OK' && !Str::contains($resp->data->Response, 'Error:') && $resp->data->Response !== 'False') {
893 893
                 similar_text($this->currentTitle, $resp->data->Title, $percent);
894 894
                 if ($percent >= self::MATCH_PERCENT) {
895 895
                     similar_text($this->currentYear, $resp->data->Year, $percent);
@@ -1055,7 +1055,7 @@  discard block
 block discarded – undo
1055 1055
             // Loop over releases.
1056 1056
             foreach ($res as $arr) {
1057 1057
                 // Try to get a name/year.
1058
-                if (! $this->parseMovieSearchName($arr['searchname'])) {
1058
+                if (!$this->parseMovieSearchName($arr['searchname'])) {
1059 1059
                     //We didn't find a name, so set to all 0's so we don't parse again.
1060 1060
                     Release::query()->where('id', $arr['id'])->update(['imdbid' => 0000000]);
1061 1061
 
@@ -1089,7 +1089,7 @@  discard block
 block discarded – undo
1089 1089
                     try {
1090 1090
                         $imdbSearch = new TitleSearch($this->config);
1091 1091
                         foreach ($imdbSearch->search($this->currentTitle, [TitleSearch::MOVIE]) as $imdbTitle) {
1092
-                            if (! empty($imdbTitle->title())) {
1092
+                            if (!empty($imdbTitle->title())) {
1093 1093
                                 similar_text($imdbTitle->title(), $this->currentTitle, $percent);
1094 1094
                                 if ($percent >= self::MATCH_PERCENT) {
1095 1095
                                     similar_text($this->currentYear, $imdbTitle->year(), $percent);
@@ -1119,10 +1119,10 @@  discard block
 block discarded – undo
1119 1119
                             $buffer = $this->omdbApi->search($omdbTitle, 'movie');
1120 1120
                         }
1121 1121
 
1122
-                        if (\is_object($buffer) && $buffer->message === 'OK' && ! Str::contains($buffer->data->Response, 'Error:') && $buffer->data->Response === 'True') {
1122
+                        if (\is_object($buffer) && $buffer->message === 'OK' && !Str::contains($buffer->data->Response, 'Error:') && $buffer->data->Response === 'True') {
1123 1123
                             $getIMDBid = $buffer->data->Search[0]->imdbID;
1124 1124
 
1125
-                            if (! empty($getIMDBid)) {
1125
+                            if (!empty($getIMDBid)) {
1126 1126
                                 $imdbId = $this->doMovieUpdate($getIMDBid, 'OMDbAPI', $arr['id']);
1127 1127
                                 if ($imdbId !== false) {
1128 1128
                                     $movieUpdated = true;
@@ -1137,7 +1137,7 @@  discard block
 block discarded – undo
1137 1137
                     $data = $this->traktTv->client->movieSummary($movieName, 'full');
1138 1138
                     if ($data !== false) {
1139 1139
                         $this->parseTraktTv($data);
1140
-                        if (! empty($data['ids']['imdb'])) {
1140
+                        if (!empty($data['ids']['imdb'])) {
1141 1141
                             $imdbId = $this->doMovieUpdate($data['ids']['imdb'], 'Trakt', $arr['id']);
1142 1142
                             if ($imdbId !== false) {
1143 1143
                                 $movieUpdated = true;
@@ -1150,13 +1150,13 @@  discard block
 block discarded – undo
1150 1150
                 if ($movieUpdated === false) {
1151 1151
                     try {
1152 1152
                         $data = Tmdb::getSearchApi()->searchMovies($this->currentTitle);
1153
-                        if (($data['total_results'] > 0) && ! empty($data['results'])) {
1153
+                        if (($data['total_results'] > 0) && !empty($data['results'])) {
1154 1154
                             foreach ($data['results'] as $result) {
1155
-                                if (! empty($result['id']) && ! empty($result['release_date'])) {
1155
+                                if (!empty($result['id']) && !empty($result['release_date'])) {
1156 1156
                                     similar_text($this->currentYear, Carbon::parse($result['release_date'])->year, $percent);
1157 1157
                                     if ($percent >= self::YEAR_MATCH_PERCENT) {
1158 1158
                                         $ret = $this->fetchTMDBProperties($result['id'], true);
1159
-                                        if ($ret !== false && ! empty($ret['imdbid'])) {
1159
+                                        if ($ret !== false && !empty($ret['imdbid'])) {
1160 1160
                                             $imdbId = $this->doMovieUpdate('tt'.$ret['imdbid'], 'TMDB', $arr['id']);
1161 1161
                                             if ($imdbId !== false) {
1162 1162
                                                 $movieUpdated = true;
@@ -1257,7 +1257,7 @@  discard block
 block discarded – undo
1257 1257
             // Finally remove multiple spaces and trim leading spaces.
1258 1258
             $name = trim(preg_replace('/\s{2,}/', ' ', $name));
1259 1259
             // Check if the name is long enough and not just numbers.
1260
-            if (\strlen($name) > 4 && ! preg_match('/^\d+$/', $name)) {
1260
+            if (\strlen($name) > 4 && !preg_match('/^\d+$/', $name)) {
1261 1261
                 $this->currentTitle = $name;
1262 1262
                 $this->currentYear = $year;
1263 1263
 
Please login to merge, or discard this patch.
app/Http/Controllers/GetNzbController.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
             }
35 35
 
36 36
             $res = User::getByRssToken($request->input('r'));
37
-            if (! $res) {
37
+            if (!$res) {
38 38
                 return Utility::showApiError(100);
39 39
             }
40 40
 
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
             return Utility::showApiError(501);
53 53
         }
54 54
 
55
-        if (! $request->input('id')) {
55
+        if (!$request->input('id')) {
56 56
             return Utility::showApiError(200, 'Parameter id is required');
57 57
         }
58 58
 
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 
87 87
         $nzbPath = (new NZB)->getNZBPath($request->input('id'));
88 88
 
89
-        if (! File::exists($nzbPath)) {
89
+        if (!File::exists($nzbPath)) {
90 90
             return Utility::showApiError(300, 'NZB file not found!');
91 91
         }
92 92
 
@@ -110,9 +110,9 @@  discard block
 block discarded – undo
110 110
             'X-DNZB-Details' => url('/').'/details/'.$request->input('id'),
111 111
         ];
112 112
 
113
-        if (! empty($relData['imdbid']) && $relData['imdbid'] > 0) {
113
+        if (!empty($relData['imdbid']) && $relData['imdbid'] > 0) {
114 114
             $headers += ['X-DNZB-MoreInfo' => 'http://www.imdb.com/title/tt'.$relData['imdbid']];
115
-        } elseif (! empty($relData['tvdb']) && $relData['tvdb'] > 0) {
115
+        } elseif (!empty($relData['tvdb']) && $relData['tvdb'] > 0) {
116 116
             $headers += ['X-DNZB-MoreInfo' => 'http://www.thetvdb.com/?tab=series&id='.$relData['tvdb']];
117 117
         }
118 118
 
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 
126 126
         $cleanName = str_replace([',', ' ', '/', '\\'], '_', $relData['searchname']);
127 127
 
128
-        return response()->streamDownload(function () use ($nzbPath) {
128
+        return response()->streamDownload(function() use ($nzbPath) {
129 129
             echo $nzbPath;
130 130
         }, $cleanName.'.nzb', $headers);
131 131
     }
Please login to merge, or discard this patch.
routes/web.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -83,18 +83,18 @@  discard block
 block discarded – undo
83 83
 Route::post('login', [LoginController::class, 'login'])->name('login.post');
84 84
 Route::match(['GET', 'POST'], 'logout', [LoginController::class, 'logout'])->name('logout');
85 85
 
86
-Route::middleware('isVerified')->group(function () {
86
+Route::middleware('isVerified')->group(function() {
87 87
     Route::match(['GET', 'POST'], 'resetpassword', [ResetPasswordController::class, 'reset'])->name('resetpassword');
88 88
     Route::match(['GET', 'POST'], 'profile', [ProfileController::class, 'show'])->name('profile');
89 89
 
90
-    Route::prefix('browse')->group(function () {
90
+    Route::prefix('browse')->group(function() {
91 91
         Route::match(['GET', 'POST'], 'tags', [BrowseController::class, 'tags'])->name('tags');
92 92
         Route::match(['GET', 'POST'], 'group', [BrowseController::class, 'group'])->name('group');
93 93
         Route::match(['GET', 'POST'], 'All', [BrowseController::class, 'index'])->name('All');
94 94
         Route::match(['GET', 'POST'], '{parentCategory}/{id?}', [BrowseController::class, 'show'])->middleware('clearance')->name('browse');
95 95
     });
96 96
 
97
-    Route::prefix('cart')->group(function () {
97
+    Route::prefix('cart')->group(function() {
98 98
         Route::match(['GET', 'POST'], 'index', [CartController::class, 'index'])->name('cart.index');
99 99
         Route::match(['GET', 'POST'], 'add', [CartController::class, 'store'])->name('cart.add');
100 100
         Route::match(['GET', 'POST'], 'delete/{id}', [CartController::class, 'destroy'])->name('cart.delete');
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
     Route::match(['GET', 'POST'], 'content', [ContentController::class, 'show'])->name('content');
111 111
     Route::match(['GET', 'POST'], 'failed', [FailedReleasesController::class, 'failed'])->name('failed');
112 112
 
113
-    Route::middleware('clearance')->group(function () {
113
+    Route::middleware('clearance')->group(function() {
114 114
         Route::match(['GET', 'POST'], 'Games', [GamesController::class, 'show'])->name('Games');
115 115
         Route::match(['GET', 'POST'], 'Movies/{id?}', [MovieController::class, 'showMovies'])->name('Movies');
116 116
         Route::match(['GET', 'POST'], 'movie', [MovieController::class, 'showMovies'])->name('movie');
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
     Route::post('disable2fa', [PasswordSecurityController::class, 'disable2fa'])->name('disable2fa');
143 143
 });
144 144
 
145
-Route::middleware('role:Admin', '2fa')->prefix('admin')->group(function () {
145
+Route::middleware('role:Admin', '2fa')->prefix('admin')->group(function() {
146 146
     Route::match(['GET', 'POST'], 'index', [AdminPageController::class, 'index'])->name('admin.index');
147 147
     Route::match(['GET', 'POST'], 'anidb-delete/{id}', [AdminAnidbController::class, 'destroy'])->name('admin.anidb-delete');
148 148
     Route::match(['GET', 'POST'], 'anidb-edit/{id}', [AdminAnidbController::class, 'edit'])->name('admin.anidb-edit');
@@ -205,11 +205,11 @@  discard block
 block discarded – undo
205 205
 
206 206
 });
207 207
 
208
-Route::middleware('role_or_permission:Admin|Moderator|edit release')->prefix('admin')->group(function () {
208
+Route::middleware('role_or_permission:Admin|Moderator|edit release')->prefix('admin')->group(function() {
209 209
     Route::match(['GET', 'POST'], 'release-edit', [AdminReleasesController::class, 'edit'])->name('admin.release-edit');
210 210
 });
211 211
 
212
-Route::post('2faVerify', function () {
212
+Route::post('2faVerify', function() {
213 213
     return redirect()->to(URL()->previous());
214 214
 })->name('2faVerify')->middleware('2fa');
215 215
 
Please login to merge, or discard this patch.
Blacklight/Releases.php 1 patch
Spacing   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
             ($start === 0 ? ' LIMIT '.$num : ' LIMIT '.$num.' OFFSET '.$start)
87 87
         );
88 88
 
89
-        Cache::remember(md5($qry.$page), config('nntmux.cache_expiry_medium'), function () use ($qry, $cat, $maxAge, $excludedCats, $groupName) {
89
+        Cache::remember(md5($qry.$page), config('nntmux.cache_expiry_medium'), function() use ($qry, $cat, $maxAge, $excludedCats, $groupName) {
90 90
             $sql = self::fromQuery($qry);
91 91
             if (\count($sql) > 0) {
92 92
                 $possibleRows = $this->getBrowseCount($cat, $maxAge, $excludedCats, $groupName);
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
 				GROUP BY r.id
263 263
 				ORDER BY %s %s %s",
264 264
             $this->uSQL($userShows, 'videos_id'),
265
-            (! empty($excludedCats) ? ' AND r.categories_id NOT IN ('.implode(',', $excludedCats).')' : ''),
265
+            (!empty($excludedCats) ? ' AND r.categories_id NOT IN ('.implode(',', $excludedCats).')' : ''),
266 266
             NZB::NZB_ADDED,
267 267
             Category::TV_ROOT,
268 268
             Category::TV_OTHER,
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
             $orderBy[1],
273 273
             ($offset === false ? '' : (' LIMIT '.$limit.' OFFSET '.$offset))
274 274
         );
275
-        Cache::remember(md5($sql), config('nntmux.cache_expiry_long'), function () use ($sql) {
275
+        Cache::remember(md5($sql), config('nntmux.cache_expiry_long'), function() use ($sql) {
276 276
             return self::fromQuery($sql);
277 277
         });
278 278
     }
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
     {
327 327
         // Delete NZB from disk.
328 328
         $nzbPath = $nzb->NZBPath($identifiers['g']);
329
-        if (! empty($nzbPath)) {
329
+        if (!empty($nzbPath)) {
330 330
             File::delete($nzbPath);
331 331
         }
332 332
 
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
      */
367 367
     public function updateMulti($guids, $category, $grabs, $videoId, $episodeId, $anidbId, $imdbId)
368 368
     {
369
-        if (! \is_array($guids) || \count($guids) < 1) {
369
+        if (!\is_array($guids) || \count($guids) < 1) {
370 370
             return false;
371 371
         }
372 372
 
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
         $sql = '(1=2 ';
391 391
         foreach ($userQuery as $query) {
392 392
             $sql .= sprintf('OR (r.%s = %d', $type, $query->$type);
393
-            if (! empty($query->categories)) {
393
+            if (!empty($query->categories)) {
394 394
                 $catsArr = explode('|', $query->categories);
395 395
                 if (\count($catsArr) > 1) {
396 396
                     $sql .= sprintf(' AND r.categories_id IN (%s)', implode(',', $catsArr));
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
             $orderBy = $this->getBrowseOrder($orderBy);
432 432
         }
433 433
 
434
-        $searchFields = Arr::where($searchArr, static function ($value) {
434
+        $searchFields = Arr::where($searchArr, static function($value) {
435 435
             return $value !== -1;
436 436
         });
437 437
 
@@ -441,7 +441,7 @@  discard block
 block discarded – undo
441 441
             $searchResult = $this->elasticSearch->indexSearch($phrases, $limit);
442 442
         } else {
443 443
             $searchResult = $this->manticoreSearch->searchIndexes('releases_rt', '', [], $searchFields);
444
-            if (! empty($searchResult)) {
444
+            if (!empty($searchResult)) {
445 445
                 $searchResult = Arr::wrap(Arr::get($searchResult, 'id'));
446 446
             }
447 447
         }
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
             $limit,
506 506
             $offset
507 507
         );
508
-        Cache::remember(md5($sql), config('nntmux.cache_expiry_medium'), function () use ($sql, $baseSql) {
508
+        Cache::remember(md5($sql), config('nntmux.cache_expiry_medium'), function() use ($sql, $baseSql) {
509 509
             $releases = self::fromQuery($sql);
510 510
             if ($releases->isNotEmpty()) {
511 511
                 $releases[0]->_totalrows = $this->getPagerCount($baseSql);
@@ -525,7 +525,7 @@  discard block
 block discarded – undo
525 525
                 $searchResult = $this->elasticSearch->indexSearchApi($searchName, $limit);
526 526
             } else {
527 527
                 $searchResult = $this->manticoreSearch->searchIndexes('releases_rt', $searchName, ['searchname']);
528
-                if (! empty($searchResult)) {
528
+                if (!empty($searchResult)) {
529 529
                     $searchResult = Arr::wrap(Arr::get($searchResult, 'id'));
530 530
                 }
531 531
             }
@@ -541,7 +541,7 @@  discard block
 block discarded – undo
541 541
             ((int) $groupName !== -1 ? sprintf(' AND r.groups_id = %d ', UsenetGroup::getIDByName($groupName)) : ''),
542 542
             $catQuery,
543 543
             (\count($excludedCats) > 0 ? ' AND r.categories_id NOT IN ('.implode(',', $excludedCats).')' : ''),
544
-            (! empty($searchResult) ? 'AND r.id IN ('.implode(',', $searchResult).')' : ''),
544
+            (!empty($searchResult) ? 'AND r.id IN ('.implode(',', $searchResult).')' : ''),
545 545
             ($minSize > 0 ? sprintf('AND r.size >= %d', $minSize) : '')
546 546
         );
547 547
         $baseSql = sprintf(
@@ -572,8 +572,8 @@  discard block
 block discarded – undo
572 572
             $offset
573 573
         );
574 574
 
575
-        Cache::remember(md5($sql), config('nntmux.cache_expiry_medium'), function () use ($sql, $baseSql, $searchName, $searchResult) {
576
-            if ($searchName !== -1 && ! empty($searchResult)) {
575
+        Cache::remember(md5($sql), config('nntmux.cache_expiry_medium'), function() use ($sql, $baseSql, $searchName, $searchResult) {
576
+            if ($searchName !== -1 && !empty($searchResult)) {
577 577
                 $releases = self::fromQuery($sql);
578 578
             } elseif ($searchName !== -1 && empty($searchResult)) {
579 579
                 $releases = collect();
@@ -624,11 +624,11 @@  discard block
 block discarded – undo
624 624
             $show = self::fromQuery($showQry);
625 625
 
626 626
             if ($show->isNotEmpty()) {
627
-                if ((! empty($episode) && ! empty($series)) && $show[0]->episodes !== '') {
627
+                if ((!empty($episode) && !empty($series)) && $show[0]->episodes !== '') {
628 628
                     $showSql .= ' AND r.tv_episodes_id IN ('.$show[0]->episodes.') AND tve.series = '.$series;
629
-                } elseif (! empty($episode) && $show[0]->episodes !== '') {
629
+                } elseif (!empty($episode) && $show[0]->episodes !== '') {
630 630
                     $showSql = sprintf('AND r.tv_episodes_id IN (%s)', $show[0]->episodes);
631
-                } elseif (! empty($series) && empty($episode)) {
631
+                } elseif (!empty($series) && empty($episode)) {
632 632
                     // If $series is set but episode is not, return Season Packs and Episodes
633 633
                     $showSql .= ' AND r.tv_episodes_id IN ('.$show[0]->episodes.') AND tve.series = '.$series;
634 634
                 }
@@ -642,26 +642,26 @@  discard block
 block discarded – undo
642 642
         }
643 643
 
644 644
         // If $name is set it is a fallback search, add available SxxExx/airdate info to the query
645
-        if (! empty($name) && $showSql === '') {
646
-            if (! empty($series) && (int) $series < 1900) {
645
+        if (!empty($name) && $showSql === '') {
646
+            if (!empty($series) && (int) $series < 1900) {
647 647
                 $name .= sprintf(' S%s', str_pad($series, 2, '0', STR_PAD_LEFT));
648
-                if (! empty($episode) && ! str_contains($episode, '/')) {
648
+                if (!empty($episode) && !str_contains($episode, '/')) {
649 649
                     $name .= sprintf('E%s', str_pad($episode, 2, '0', STR_PAD_LEFT));
650 650
                 }
651 651
                 // If season is not empty but episode is, add a wildcard to the search
652 652
                 if (empty($episode)) {
653 653
                     $name .= '*';
654 654
                 }
655
-            } elseif (! empty($airDate)) {
655
+            } elseif (!empty($airDate)) {
656 656
                 $name .= sprintf(' %s', str_replace(['/', '-', '.', '_'], ' ', $airDate));
657 657
             }
658 658
         }
659
-        if (! empty($name)) {
659
+        if (!empty($name)) {
660 660
             if (config('nntmux.elasticsearch_enabled') === true) {
661 661
                 $searchResult = $this->elasticSearch->indexSearchTMA($name, $limit);
662 662
             } else {
663 663
                 $searchResult = $this->manticoreSearch->searchIndexes('releases_rt', $name, ['searchname']);
664
-                if (! empty($searchResult)) {
664
+                if (!empty($searchResult)) {
665 665
                     $searchResult = Arr::wrap(Arr::get($searchResult, 'id'));
666 666
                 }
667 667
             }
@@ -677,11 +677,11 @@  discard block
 block discarded – undo
677 677
             NZB::NZB_ADDED,
678 678
             $this->showPasswords(),
679 679
             $showSql,
680
-            (! empty($name) && ! empty($searchResult)) ? 'AND r.id IN ('.implode(',', $searchResult).')' : '',
680
+            (!empty($name) && !empty($searchResult)) ? 'AND r.id IN ('.implode(',', $searchResult).')' : '',
681 681
             Category::getCategorySearch($cat),
682 682
             $maxAge > 0 ? sprintf('AND r.postdate > NOW() - INTERVAL %d DAY', $maxAge) : '',
683 683
             $minSize > 0 ? sprintf('AND r.size >= %d', $minSize) : '',
684
-            ! empty($excludedCategories) ? sprintf('AND r.categories_id NOT IN('.implode(',', $excludedCategories).')') : ''
684
+            !empty($excludedCategories) ? sprintf('AND r.categories_id NOT IN('.implode(',', $excludedCategories).')') : ''
685 685
         );
686 686
         $baseSql = sprintf(
687 687
             "SELECT r.searchname, r.guid, r.postdate, r.groups_id, r.categories_id, r.size, r.totalpart, r.fromname, r.passwordstatus, r.grabs, r.comments, r.adddate, r.videos_id, r.tv_episodes_id, r.haspreview, r.jpgstatus,
@@ -714,8 +714,8 @@  discard block
 block discarded – undo
714 714
             $offset
715 715
         );
716 716
 
717
-        Cache::remember(md5($sql), config('nntmux.cache_expiry_medium'), function () use ($sql, $baseSql, $name, $searchResult) {
718
-            $releases = ((! empty($name) && ! empty($searchResult)) || empty($name)) ? self::fromQuery($sql) : [];
717
+        Cache::remember(md5($sql), config('nntmux.cache_expiry_medium'), function() use ($sql, $baseSql, $name, $searchResult) {
718
+            $releases = ((!empty($name) && !empty($searchResult)) || empty($name)) ? self::fromQuery($sql) : [];
719 719
             if (count($releases) !== 0 && $releases->isNotEmpty()) {
720 720
                 $releases[0]->_totalrows = $this->getPagerCount(
721 721
                     preg_replace('#LEFT(\s+OUTER)?\s+JOIN\s+(?!tv_episodes)\s+.*ON.*=.*\n#i', ' ', $baseSql)
@@ -759,11 +759,11 @@  discard block
 block discarded – undo
759 759
 
760 760
             $show = self::fromQuery($showQry);
761 761
             if ($show->isNotEmpty()) {
762
-                if ((! empty($episode) && ! empty($series)) && $show[0]->episodes !== '') {
762
+                if ((!empty($episode) && !empty($series)) && $show[0]->episodes !== '') {
763 763
                     $showSql .= ' AND r.tv_episodes_id IN ('.$show[0]->episodes.') AND tve.series = '.$series;
764
-                } elseif (! empty($episode) && $show[0]->episodes !== '') {
764
+                } elseif (!empty($episode) && $show[0]->episodes !== '') {
765 765
                     $showSql = sprintf('AND r.tv_episodes_id IN (%s)', $show[0]->episodes);
766
-                } elseif (! empty($series) && empty($episode)) {
766
+                } elseif (!empty($series) && empty($episode)) {
767 767
                     // If $series is set but episode is not, return Season Packs and Episodes
768 768
                     $showSql .= ' AND r.tv_episodes_id IN ('.$show[0]->episodes.') AND tve.series = '.$series;
769 769
                 }
@@ -776,26 +776,26 @@  discard block
 block discarded – undo
776 776
             }
777 777
         }
778 778
         // If $name is set it is a fallback search, add available SxxExx/airdate info to the query
779
-        if (! empty($name) && $showSql === '') {
780
-            if (! empty($series) && (int) $series < 1900) {
779
+        if (!empty($name) && $showSql === '') {
780
+            if (!empty($series) && (int) $series < 1900) {
781 781
                 $name .= sprintf(' S%s', str_pad($series, 2, '0', STR_PAD_LEFT));
782
-                if (! empty($episode) && ! str_contains($episode, '/')) {
782
+                if (!empty($episode) && !str_contains($episode, '/')) {
783 783
                     $name .= sprintf('E%s', str_pad($episode, 2, '0', STR_PAD_LEFT));
784 784
                 }
785 785
                 // If season is not empty but episode is, add a wildcard to the search
786 786
                 if (empty($episode)) {
787 787
                     $name .= '*';
788 788
                 }
789
-            } elseif (! empty($airDate)) {
789
+            } elseif (!empty($airDate)) {
790 790
                 $name .= sprintf(' %s', str_replace(['/', '-', '.', '_'], ' ', $airDate));
791 791
             }
792 792
         }
793
-        if (! empty($name)) {
793
+        if (!empty($name)) {
794 794
             if (config('nntmux.elasticsearch_enabled') === true) {
795 795
                 $searchResult = $this->elasticSearch->indexSearchTMA($name, $limit);
796 796
             } else {
797 797
                 $searchResult = $this->manticoreSearch->searchIndexes('releases_rt', $name, ['searchname']);
798
-                if (! empty($searchResult)) {
798
+                if (!empty($searchResult)) {
799 799
                     $searchResult = Arr::wrap(Arr::get($searchResult, 'id'));
800 800
                 }
801 801
             }
@@ -811,11 +811,11 @@  discard block
 block discarded – undo
811 811
             NZB::NZB_ADDED,
812 812
             $this->showPasswords(),
813 813
             $showSql,
814
-            (! empty($searchResult) ? 'AND r.id IN ('.implode(',', $searchResult).')' : ''),
814
+            (!empty($searchResult) ? 'AND r.id IN ('.implode(',', $searchResult).')' : ''),
815 815
             Category::getCategorySearch($cat),
816 816
             ($maxAge > 0 ? sprintf('AND r.postdate > NOW() - INTERVAL %d DAY', $maxAge) : ''),
817 817
             ($minSize > 0 ? sprintf('AND r.size >= %d', $minSize) : ''),
818
-            ! empty($excludedCategories) ? sprintf('AND r.categories_id NOT IN('.implode(',', $excludedCategories).')') : ''
818
+            !empty($excludedCategories) ? sprintf('AND r.categories_id NOT IN('.implode(',', $excludedCategories).')') : ''
819 819
         );
820 820
         $baseSql = sprintf(
821 821
             "SELECT r.searchname, r.guid, r.postdate, r.groups_id, r.categories_id, r.size, r.totalpart, r.fromname, r.passwordstatus, r.grabs, r.comments, r.adddate, r.tv_episodes_id, r.haspreview, r.jpgstatus,
@@ -842,7 +842,7 @@  discard block
 block discarded – undo
842 842
             $offset
843 843
         );
844 844
 
845
-        Cache::remember(md5($sql), config('nntmux.cache_expiry_medium'), function () use ($sql, $baseSql) {
845
+        Cache::remember(md5($sql), config('nntmux.cache_expiry_medium'), function() use ($sql, $baseSql) {
846 846
             $releases = self::fromQuery($sql);
847 847
             if ($releases->isNotEmpty()) {
848 848
                 $releases[0]->_totalrows = $this->getPagerCount(
@@ -859,12 +859,12 @@  discard block
 block discarded – undo
859 859
      */
860 860
     public function animeSearch($aniDbID, int $offset = 0, int $limit = 100, string $name = '', array $cat = [-1], int $maxAge = -1, array $excludedCategories = [])
861 861
     {
862
-        if (! empty($name)) {
862
+        if (!empty($name)) {
863 863
             if (config('nntmux.elasticsearch_enabled') === true) {
864 864
                 $searchResult = $this->elasticSearch->indexSearchTMA($name, $limit);
865 865
             } else {
866 866
                 $searchResult = $this->manticoreSearch->searchIndexes('releases_rt', $name, ['searchname']);
867
-                if (! empty($searchResult)) {
867
+                if (!empty($searchResult)) {
868 868
                     $searchResult = Arr::wrap(Arr::get($searchResult, 'id'));
869 869
                 }
870 870
             }
@@ -881,8 +881,8 @@  discard block
 block discarded – undo
881 881
             $this->showPasswords(),
882 882
             NZB::NZB_ADDED,
883 883
             ($aniDbID > -1 ? sprintf(' AND r.anidbid = %d ', $aniDbID) : ''),
884
-            (! empty($searchResult) ? 'AND r.id IN ('.implode(',', $searchResult).')' : ''),
885
-            ! empty($excludedCategories) ? sprintf('AND r.categories_id NOT IN('.implode(',', $excludedCategories).')') : '',
884
+            (!empty($searchResult) ? 'AND r.id IN ('.implode(',', $searchResult).')' : ''),
885
+            !empty($excludedCategories) ? sprintf('AND r.categories_id NOT IN('.implode(',', $excludedCategories).')') : '',
886 886
             Category::getCategorySearch($cat),
887 887
             ($maxAge > 0 ? sprintf(' AND r.postdate > NOW() - INTERVAL %d DAY ', $maxAge) : '')
888 888
         );
@@ -908,7 +908,7 @@  discard block
 block discarded – undo
908 908
             $offset
909 909
         );
910 910
 
911
-        Cache::remember(md5($sql), config('nntmux.cache_expiry_medium'), function () use ($sql, $baseSql) {
911
+        Cache::remember(md5($sql), config('nntmux.cache_expiry_medium'), function() use ($sql, $baseSql) {
912 912
             $releases = self::fromQuery($sql);
913 913
             if ($releases->isNotEmpty()) {
914 914
                 $releases[0]->_totalrows = $this->getPagerCount($baseSql);
@@ -923,12 +923,12 @@  discard block
 block discarded – undo
923 923
      */
924 924
     public function moviesSearch(int $imDbId = -1, int $tmDbId = -1, int $traktId = -1, int $offset = 0, int $limit = 100, string $name = '', array $cat = [-1], int $maxAge = -1, int $minSize = 0, array $excludedCategories = [])
925 925
     {
926
-        if (! empty($name)) {
926
+        if (!empty($name)) {
927 927
             if (config('nntmux.elasticsearch_enabled') === true) {
928 928
                 $searchResult = $this->elasticSearch->indexSearchTMA($name, $limit);
929 929
             } else {
930 930
                 $searchResult = $this->manticoreSearch->searchIndexes('releases_rt', $name, ['searchname']);
931
-                if (! empty($searchResult)) {
931
+                if (!empty($searchResult)) {
932 932
                     $searchResult = Arr::wrap(Arr::get($searchResult, 'id'));
933 933
                 }
934 934
             }
@@ -945,11 +945,11 @@  discard block
 block discarded – undo
945 945
 			%s %s %s %s %s %s %s',
946 946
             NZB::NZB_ADDED,
947 947
             $this->showPasswords(),
948
-            (! empty($searchResult) ? 'AND r.id IN ('.implode(',', $searchResult).')' : ''),
948
+            (!empty($searchResult) ? 'AND r.id IN ('.implode(',', $searchResult).')' : ''),
949 949
             ($imDbId !== -1 && is_numeric($imDbId)) ? sprintf(' AND m.imdbid = \'%s\' ', $imDbId) : '',
950 950
             ($tmDbId !== -1 && is_numeric($tmDbId)) ? sprintf(' AND m.tmdbid = %d ', $tmDbId) : '',
951 951
             ($traktId !== -1 && is_numeric($traktId)) ? sprintf(' AND m.traktid = %d ', $traktId) : '',
952
-            ! empty($excludedCategories) ? sprintf('AND r.categories_id NOT IN('.implode(',', $excludedCategories).')') : '',
952
+            !empty($excludedCategories) ? sprintf('AND r.categories_id NOT IN('.implode(',', $excludedCategories).')') : '',
953 953
             Category::getCategorySearch($cat),
954 954
             $maxAge > 0 ? sprintf(' AND r.postdate > NOW() - INTERVAL %d DAY ', $maxAge) : '',
955 955
             $minSize > 0 ? sprintf('AND r.size >= %d', $minSize) : ''
@@ -977,7 +977,7 @@  discard block
 block discarded – undo
977 977
             $offset
978 978
         );
979 979
 
980
-        Cache::remember(md5($sql), config('nntmux.cache_expiry_medium'), function () use ($sql, $baseSql) {
980
+        Cache::remember(md5($sql), config('nntmux.cache_expiry_medium'), function() use ($sql, $baseSql) {
981 981
             $releases = self::fromQuery($sql);
982 982
             if ($releases->isNotEmpty()) {
983 983
                 $releases[0]->_totalrows = $this->getPagerCount($baseSql);
@@ -1001,7 +1001,7 @@  discard block
 block discarded – undo
1001 1001
             }
1002 1002
 
1003 1003
             $results = $this->search(['searchname' => getSimilarName($name)], -1, '', '', -1, -1, 0, config('nntmux.items_per_page'), '', -1, $excludedCats, 'basic', [$parentCat]);
1004
-            if (! $results) {
1004
+            if (!$results) {
1005 1005
                 return $ret;
1006 1006
             }
1007 1007
 
@@ -1030,7 +1030,7 @@  discard block
 block discarded – undo
1030 1030
             (int) config('nntmux.max_pager_results')
1031 1031
         );
1032 1032
 
1033
-        Cache::remember(md5($sql), config('nntmux.cache_expiry_short'), function () use ($sql) {
1033
+        Cache::remember(md5($sql), config('nntmux.cache_expiry_short'), function() use ($sql) {
1034 1034
             $count = self::fromQuery($sql);
1035 1035
 
1036 1036
             return $count[0]->count ?? 0;
Please login to merge, or discard this patch.