@@ -137,7 +137,7 @@ discard block |
||
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; |
@@ -185,8 +185,8 @@ discard block |
||
185 | 185 | ->where('m.title', '!=', '') |
186 | 186 | ->where('m.imdbid', '!=', '0000000') |
187 | 187 | ->when($maxAge > 0, fn ($query) => $query->whereRaw('r.postdate > NOW() - INTERVAL ? DAY', [$maxAge])) |
188 | - ->when(! empty($excludedCats), fn ($query) => $query->whereNotIn('r.categories_id', $excludedCats)) |
|
189 | - ->when(! empty($categorySearch), fn ($query) => $query->whereRaw($categorySearch)) |
|
188 | + ->when(!empty($excludedCats), fn ($query) => $query->whereNotIn('r.categories_id', $excludedCats)) |
|
189 | + ->when(!empty($categorySearch), fn ($query) => $query->whereRaw($categorySearch)) |
|
190 | 190 | ->groupBy('m.imdbid') |
191 | 191 | ->orderBy($order[0], $order[1]) |
192 | 192 | ->offset($start) |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | $movieIDs = $movies->pluck('imdbid')->toArray(); |
199 | 199 | $releaseIDs = $movies->pluck('grp_release_id')->toArray(); |
200 | 200 | |
201 | - if (! empty($movieIDs)) { |
|
201 | + if (!empty($movieIDs)) { |
|
202 | 202 | $moviesDetailQuery = Release::query() |
203 | 203 | ->selectRaw(' |
204 | 204 | GROUP_CONCAT(r.id ORDER BY r.postdate DESC SEPARATOR ",") AS grp_release_id, |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | ->join('movieinfo as m', 'm.imdbid', '=', 'r.imdbid') |
229 | 229 | ->whereIn('m.imdbid', $movieIDs) |
230 | 230 | ->whereIn('r.id', $releaseIDs) |
231 | - ->when(! empty($categorySearch), fn ($query) => $query->whereRaw($categorySearch)) |
|
231 | + ->when(!empty($categorySearch), fn ($query) => $query->whereRaw($categorySearch)) |
|
232 | 232 | ->groupBy('m.imdbid') |
233 | 233 | ->orderBy($order[0], $order[1]) |
234 | 234 | ->get(); |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | $browseBy = ' '; |
286 | 286 | $browseByArr = ['title', 'director', 'actors', 'genre', 'rating', 'year', 'imdb']; |
287 | 287 | foreach ($browseByArr as $bb) { |
288 | - if (request()->has($bb) && ! empty(request()->input($bb))) { |
|
288 | + if (request()->has($bb) && !empty(request()->input($bb))) { |
|
289 | 289 | $bbv = stripslashes(request()->input($bb)); |
290 | 290 | if ($bb === 'rating') { |
291 | 291 | $bbv .= '.'; |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | |
319 | 319 | if ($this->traktcheck !== null) { |
320 | 320 | $data = $this->traktTv->client->movieSummary('tt'.$imdbId, 'full'); |
321 | - if (($data !== false) && ! empty($data['trailer'])) { |
|
321 | + if (($data !== false) && !empty($data['trailer'])) { |
|
322 | 322 | return $data['trailer']; |
323 | 323 | } |
324 | 324 | } |
@@ -344,7 +344,7 @@ discard block |
||
344 | 344 | return false; |
345 | 345 | } |
346 | 346 | |
347 | - if (! empty($data['trailer'])) { |
|
347 | + if (!empty($data['trailer'])) { |
|
348 | 348 | $data['trailer'] = str_ireplace( |
349 | 349 | ['watch?v=', 'http://'], |
350 | 350 | ['embed/', 'https://'], |
@@ -378,17 +378,17 @@ discard block |
||
378 | 378 | */ |
379 | 379 | private function checkTraktValue($value) |
380 | 380 | { |
381 | - if (\is_array($value) && ! empty($value)) { |
|
381 | + if (\is_array($value) && !empty($value)) { |
|
382 | 382 | $temp = ''; |
383 | 383 | foreach ($value as $val) { |
384 | - if (! \is_array($val) && ! \is_object($val)) { |
|
384 | + if (!\is_array($val) && !\is_object($val)) { |
|
385 | 385 | $temp .= $val; |
386 | 386 | } |
387 | 387 | } |
388 | 388 | $value = $temp; |
389 | 389 | } |
390 | 390 | |
391 | - return ! empty($value) ? $value : ''; |
|
391 | + return !empty($value) ? $value : ''; |
|
392 | 392 | } |
393 | 393 | |
394 | 394 | /** |
@@ -409,7 +409,7 @@ discard block |
||
409 | 409 | */ |
410 | 410 | public function update(array $values): bool |
411 | 411 | { |
412 | - if (! \count($values)) { |
|
412 | + if (!\count($values)) { |
|
413 | 413 | return false; |
414 | 414 | } |
415 | 415 | |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | $onDuplicateKey = ['created_at' => now()]; |
418 | 418 | $found = 0; |
419 | 419 | foreach ($values as $key => $value) { |
420 | - if (! empty($value)) { |
|
420 | + if (!empty($value)) { |
|
421 | 421 | $found++; |
422 | 422 | if (\in_array($key, ['genre', 'language'], false)) { |
423 | 423 | $value = substr($value, 0, 64); |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | $onDuplicateKey += [$key => $value]; |
427 | 427 | } |
428 | 428 | } |
429 | - if (! $found) { |
|
429 | + if (!$found) { |
|
430 | 430 | return false; |
431 | 431 | } |
432 | 432 | foreach ($query as $key => $value) { |
@@ -443,19 +443,19 @@ discard block |
||
443 | 443 | */ |
444 | 444 | protected function setVariables(string|array $variable1, string|array $variable2, string|array $variable3, string|array $variable4, string|array $variable5) |
445 | 445 | { |
446 | - if (! empty($variable1)) { |
|
446 | + if (!empty($variable1)) { |
|
447 | 447 | return $variable1; |
448 | 448 | } |
449 | - if (! empty($variable2)) { |
|
449 | + if (!empty($variable2)) { |
|
450 | 450 | return $variable2; |
451 | 451 | } |
452 | - if (! empty($variable3)) { |
|
452 | + if (!empty($variable3)) { |
|
453 | 453 | return $variable3; |
454 | 454 | } |
455 | - if (! empty($variable4)) { |
|
455 | + if (!empty($variable4)) { |
|
456 | 456 | return $variable4; |
457 | 457 | } |
458 | - if (! empty($variable5)) { |
|
458 | + if (!empty($variable5)) { |
|
459 | 459 | return $variable5; |
460 | 460 | } |
461 | 461 | |
@@ -490,7 +490,7 @@ discard block |
||
490 | 490 | |
491 | 491 | $iTunes = $this->fetchItunesMovieProperties($this->currentTitle); |
492 | 492 | |
493 | - if (! $imdb && ! $tmdb && ! $trakt && ! $omdb && empty($iTunes)) { |
|
493 | + if (!$imdb && !$tmdb && !$trakt && !$omdb && empty($iTunes)) { |
|
494 | 494 | return false; |
495 | 495 | } |
496 | 496 | |
@@ -503,36 +503,36 @@ discard block |
||
503 | 503 | $mov['type'] = $mov['director'] = $mov['actors'] = $mov['language'] = ''; |
504 | 504 | |
505 | 505 | $mov['imdbid'] = $imdbId; |
506 | - $mov['tmdbid'] = (! isset($tmdb['tmdbid']) || $tmdb['tmdbid'] === '') ? 0 : $tmdb['tmdbid']; |
|
507 | - $mov['traktid'] = (! isset($trakt['id']) || $trakt['id'] === '') ? 0 : $trakt['id']; |
|
506 | + $mov['tmdbid'] = (!isset($tmdb['tmdbid']) || $tmdb['tmdbid'] === '') ? 0 : $tmdb['tmdbid']; |
|
507 | + $mov['traktid'] = (!isset($trakt['id']) || $trakt['id'] === '') ? 0 : $trakt['id']; |
|
508 | 508 | |
509 | 509 | // Prefer Fanart.tv cover over TMDB,TMDB over IMDB,IMDB over OMDB and OMDB over iTunes. |
510 | - if (! empty($fanart['cover'])) { |
|
510 | + if (!empty($fanart['cover'])) { |
|
511 | 511 | $mov['cover'] = $this->releaseImage->saveImage($imdbId.'-cover', $fanart['cover'], $this->imgSavePath); |
512 | - } elseif (! empty($tmdb['cover'])) { |
|
512 | + } elseif (!empty($tmdb['cover'])) { |
|
513 | 513 | $mov['cover'] = $this->releaseImage->saveImage($imdbId.'-cover', $tmdb['cover'], $this->imgSavePath); |
514 | - } elseif (! empty($imdb['cover'])) { |
|
514 | + } elseif (!empty($imdb['cover'])) { |
|
515 | 515 | $mov['cover'] = $this->releaseImage->saveImage($imdbId.'-cover', $imdb['cover'], $this->imgSavePath); |
516 | - } elseif (! empty($omdb['cover'])) { |
|
516 | + } elseif (!empty($omdb['cover'])) { |
|
517 | 517 | $mov['cover'] = $this->releaseImage->saveImage($imdbId.'-cover', $omdb['cover'], $this->imgSavePath); |
518 | - } elseif (! empty($iTunes['cover'])) { |
|
518 | + } elseif (!empty($iTunes['cover'])) { |
|
519 | 519 | $mov['cover'] = $this->releaseImage->saveImage($imdbId.'-cover', $iTunes['cover'], $this->imgSavePath); |
520 | 520 | } |
521 | 521 | |
522 | 522 | // Backdrops. |
523 | - if (! empty($fanart['backdrop'])) { |
|
523 | + if (!empty($fanart['backdrop'])) { |
|
524 | 524 | $mov['backdrop'] = $this->releaseImage->saveImage($imdbId.'-backdrop', $fanart['backdrop'], $this->imgSavePath, 1920, 1024); |
525 | - } elseif (! empty($tmdb['backdrop'])) { |
|
525 | + } elseif (!empty($tmdb['backdrop'])) { |
|
526 | 526 | $mov['backdrop'] = $this->releaseImage->saveImage($imdbId.'-backdrop', $tmdb['backdrop'], $this->imgSavePath, 1920, 1024); |
527 | 527 | } |
528 | 528 | |
529 | 529 | // Banner |
530 | - if (! empty($fanart['banner'])) { |
|
530 | + if (!empty($fanart['banner'])) { |
|
531 | 531 | $mov['banner'] = $this->releaseImage->saveImage($imdbId.'-banner', $fanart['banner'], $this->imgSavePath); |
532 | 532 | } |
533 | 533 | |
534 | 534 | // RottenTomatoes rating from OmdbAPI |
535 | - if ($omdb !== false && ! empty($omdb['rtRating'])) { |
|
535 | + if ($omdb !== false && !empty($omdb['rtRating'])) { |
|
536 | 536 | $mov['rtrating'] = $omdb['rtRating']; |
537 | 537 | } |
538 | 538 | |
@@ -543,29 +543,29 @@ discard block |
||
543 | 543 | $mov['year'] = $this->setVariables($imdb['year'] ?? '', $tmdb['year'] ?? '', $trakt['year'] ?? '', $omdb['year'] ?? '', $iTunes['year'] ?? ''); |
544 | 544 | $mov['genre'] = $this->setVariables($imdb['genre'] ?? '', $tmdb['genre'] ?? '', $trakt['genres'] ?? '', $omdb['genre'] ?? '', $iTunes['genre'] ?? ''); |
545 | 545 | |
546 | - if (! empty($imdb['type'])) { |
|
546 | + if (!empty($imdb['type'])) { |
|
547 | 547 | $mov['type'] = $imdb['type']; |
548 | 548 | } |
549 | 549 | |
550 | - if (! empty($imdb['director'])) { |
|
550 | + if (!empty($imdb['director'])) { |
|
551 | 551 | $mov['director'] = \is_array($imdb['director']) ? implode(', ', array_unique($imdb['director'])) : $imdb['director']; |
552 | - } elseif (! empty($omdb['director'])) { |
|
552 | + } elseif (!empty($omdb['director'])) { |
|
553 | 553 | $mov['director'] = \is_array($omdb['director']) ? implode(', ', array_unique($omdb['director'])) : $omdb['director']; |
554 | - } elseif (! empty($tmdb['director'])) { |
|
554 | + } elseif (!empty($tmdb['director'])) { |
|
555 | 555 | $mov['director'] = \is_array($tmdb['director']) ? implode(', ', array_unique($tmdb['director'])) : $tmdb['director']; |
556 | 556 | } |
557 | 557 | |
558 | - if (! empty($imdb['actors'])) { |
|
558 | + if (!empty($imdb['actors'])) { |
|
559 | 559 | $mov['actors'] = \is_array($imdb['actors']) ? implode(', ', array_unique($imdb['actors'])) : $imdb['actors']; |
560 | - } elseif (! empty($omdb['actors'])) { |
|
560 | + } elseif (!empty($omdb['actors'])) { |
|
561 | 561 | $mov['actors'] = \is_array($omdb['actors']) ? implode(', ', array_unique($omdb['actors'])) : $omdb['actors']; |
562 | - } elseif (! empty($tmdb['actors'])) { |
|
562 | + } elseif (!empty($tmdb['actors'])) { |
|
563 | 563 | $mov['actors'] = \is_array($tmdb['actors']) ? implode(', ', array_unique($tmdb['actors'])) : $tmdb['actors']; |
564 | 564 | } |
565 | 565 | |
566 | - if (! empty($imdb['language'])) { |
|
566 | + if (!empty($imdb['language'])) { |
|
567 | 567 | $mov['language'] = \is_array($imdb['language']) ? implode(', ', array_unique($imdb['language'])) : $imdb['language']; |
568 | - } elseif (! empty($omdb['language']) && ! is_bool($omdb['language'])) { |
|
568 | + } elseif (!empty($omdb['language']) && !is_bool($omdb['language'])) { |
|
569 | 569 | $mov['language'] = \is_array($omdb['language']) ? implode(', ', array_unique($omdb['language'])) : $omdb['language']; |
570 | 570 | } |
571 | 571 | |
@@ -623,20 +623,20 @@ discard block |
||
623 | 623 | if ($this->fanartapikey !== null) { |
624 | 624 | $art = $this->fanart->getMovieFanArt('tt'.$imdbId); |
625 | 625 | |
626 | - if (! empty($art)) { |
|
626 | + if (!empty($art)) { |
|
627 | 627 | if (isset($art['status']) && $art['status'] === 'error') { |
628 | 628 | return false; |
629 | 629 | } |
630 | 630 | $ret = []; |
631 | - if (! empty($art['moviebackground'][0]['url'])) { |
|
631 | + if (!empty($art['moviebackground'][0]['url'])) { |
|
632 | 632 | $ret['backdrop'] = $art['moviebackground'][0]['url']; |
633 | - } elseif (! empty($art['moviethumb'][0]['url'])) { |
|
633 | + } elseif (!empty($art['moviethumb'][0]['url'])) { |
|
634 | 634 | $ret['backdrop'] = $art['moviethumb'][0]['url']; |
635 | 635 | } |
636 | - if (! empty($art['movieposter'][0]['url'])) { |
|
636 | + if (!empty($art['movieposter'][0]['url'])) { |
|
637 | 637 | $ret['cover'] = $art['movieposter'][0]['url']; |
638 | 638 | } |
639 | - if (! empty($art['moviebanner'][0]['url'])) { |
|
639 | + if (!empty($art['moviebanner'][0]['url'])) { |
|
640 | 640 | $ret['banner'] = $art['moviebanner'][0]['url']; |
641 | 641 | } |
642 | 642 | |
@@ -673,7 +673,7 @@ discard block |
||
673 | 673 | return false; |
674 | 674 | } |
675 | 675 | |
676 | - if (! empty($tmdbLookup)) { |
|
676 | + if (!empty($tmdbLookup)) { |
|
677 | 677 | if ($this->currentTitle !== '') { |
678 | 678 | // Check the similarity. |
679 | 679 | similar_text($this->currentTitle, $tmdbLookup['title'], $percent); |
@@ -702,7 +702,7 @@ discard block |
||
702 | 702 | $ret['rating'] = ''; |
703 | 703 | } |
704 | 704 | $actors = Arr::pluck($tmdbLookup['credits']['cast'], 'name'); |
705 | - if (! empty($actors)) { |
|
705 | + if (!empty($actors)) { |
|
706 | 706 | $ret['actors'] = $actors; |
707 | 707 | } else { |
708 | 708 | $ret['actors'] = ''; |
@@ -713,7 +713,7 @@ discard block |
||
713 | 713 | } |
714 | 714 | } |
715 | 715 | $overview = $tmdbLookup['overview']; |
716 | - if (! empty($overview)) { |
|
716 | + if (!empty($overview)) { |
|
717 | 717 | $ret['plot'] = $overview; |
718 | 718 | } else { |
719 | 719 | $ret['plot'] = ''; |
@@ -723,13 +723,13 @@ discard block |
||
723 | 723 | $ret['tagline'] = $tagline ?? ''; |
724 | 724 | |
725 | 725 | $released = $tmdbLookup['release_date']; |
726 | - if (! empty($released)) { |
|
726 | + if (!empty($released)) { |
|
727 | 727 | $ret['year'] = Carbon::parse($released)->year; |
728 | 728 | } else { |
729 | 729 | $ret['year'] = ''; |
730 | 730 | } |
731 | 731 | $genresa = $tmdbLookup['genres']; |
732 | - if (! empty($genresa) && \count($genresa) > 0) { |
|
732 | + if (!empty($genresa) && \count($genresa) > 0) { |
|
733 | 733 | $genres = []; |
734 | 734 | foreach ($genresa as $genre) { |
735 | 735 | $genres[] = $genre['name']; |
@@ -739,13 +739,13 @@ discard block |
||
739 | 739 | $ret['genre'] = ''; |
740 | 740 | } |
741 | 741 | $posterp = $tmdbLookup['poster_path']; |
742 | - if (! empty($posterp)) { |
|
742 | + if (!empty($posterp)) { |
|
743 | 743 | $ret['cover'] = 'https://image.tmdb.org/t/p/original'.$posterp; |
744 | 744 | } else { |
745 | 745 | $ret['cover'] = ''; |
746 | 746 | } |
747 | 747 | $backdrop = $tmdbLookup['backdrop_path']; |
748 | - if (! empty($backdrop)) { |
|
748 | + if (!empty($backdrop)) { |
|
749 | 749 | $ret['backdrop'] = 'https://image.tmdb.org/t/p/original'.$backdrop; |
750 | 750 | } else { |
751 | 751 | $ret['backdrop'] = ''; |
@@ -767,9 +767,9 @@ discard block |
||
767 | 767 | { |
768 | 768 | $realId = (new Title($imdbId, $this->config))->real_id(); |
769 | 769 | $result = new Title($realId, $this->config); |
770 | - $title = ! empty($result->orig_title()) ? $result->orig_title() : $result->title(); |
|
771 | - if (! empty($title)) { |
|
772 | - if (! empty($this->currentTitle)) { |
|
770 | + $title = !empty($result->orig_title()) ? $result->orig_title() : $result->title(); |
|
771 | + if (!empty($title)) { |
|
772 | + if (!empty($this->currentTitle)) { |
|
773 | 773 | similar_text($this->currentTitle, $title, $percent); |
774 | 774 | if ($percent >= self::MATCH_PERCENT) { |
775 | 775 | similar_text($this->currentYear, $result->year(), $percent); |
@@ -778,7 +778,7 @@ discard block |
||
778 | 778 | 'title' => $title, |
779 | 779 | 'tagline' => $result->tagline() ?? '', |
780 | 780 | 'plot' => Arr::get($result->plot_split(), '0.plot'), |
781 | - 'rating' => ! empty($result->rating()) ? $result->rating() : '', |
|
781 | + 'rating' => !empty($result->rating()) ? $result->rating() : '', |
|
782 | 782 | 'year' => $result->year() ?? '', |
783 | 783 | 'cover' => $result->photo() ?? '', |
784 | 784 | 'genre' => $result->genre() ?? '', |
@@ -803,7 +803,7 @@ discard block |
||
803 | 803 | 'title' => $title, |
804 | 804 | 'tagline' => $result->tagline() ?? '', |
805 | 805 | 'plot' => Arr::get($result->plot_split(), '0.plot'), |
806 | - 'rating' => ! empty($result->rating()) ? $result->rating() : '', |
|
806 | + 'rating' => !empty($result->rating()) ? $result->rating() : '', |
|
807 | 807 | 'year' => $result->year() ?? '', |
808 | 808 | 'cover' => $result->photo() ?? '', |
809 | 809 | 'genre' => $result->genre() ?? '', |
@@ -877,7 +877,7 @@ discard block |
||
877 | 877 | if ($this->omdbapikey !== null) { |
878 | 878 | $resp = $this->omdbApi->fetch('i', 'tt'.$imdbId); |
879 | 879 | |
880 | - if (\is_object($resp) && $resp->message === 'OK' && ! Str::contains($resp->data->Response, 'Error:') && $resp->data->Response !== 'False') { |
|
880 | + if (\is_object($resp) && $resp->message === 'OK' && !Str::contains($resp->data->Response, 'Error:') && $resp->data->Response !== 'False') { |
|
881 | 881 | similar_text($this->currentTitle, $resp->data->Title, $percent); |
882 | 882 | if ($percent >= self::MATCH_PERCENT) { |
883 | 883 | similar_text($this->currentYear, $resp->data->Year, $percent); |
@@ -1043,7 +1043,7 @@ discard block |
||
1043 | 1043 | // Loop over releases. |
1044 | 1044 | foreach ($res as $arr) { |
1045 | 1045 | // Try to get a name/year. |
1046 | - if (! $this->parseMovieSearchName($arr['searchname'])) { |
|
1046 | + if (!$this->parseMovieSearchName($arr['searchname'])) { |
|
1047 | 1047 | //We didn't find a name, so set to all 0's so we don't parse again. |
1048 | 1048 | Release::query()->where('id', $arr['id'])->update(['imdbid' => 0000000]); |
1049 | 1049 | |
@@ -1077,7 +1077,7 @@ discard block |
||
1077 | 1077 | try { |
1078 | 1078 | $imdbSearch = new TitleSearch($this->config); |
1079 | 1079 | foreach ($imdbSearch->search($this->currentTitle, [TitleSearch::MOVIE]) as $imdbTitle) { |
1080 | - if (! empty($imdbTitle->title())) { |
|
1080 | + if (!empty($imdbTitle->title())) { |
|
1081 | 1081 | similar_text($imdbTitle->title(), $this->currentTitle, $percent); |
1082 | 1082 | if ($percent >= self::MATCH_PERCENT) { |
1083 | 1083 | similar_text($this->currentYear, $imdbTitle->year(), $percent); |
@@ -1107,10 +1107,10 @@ discard block |
||
1107 | 1107 | $buffer = $this->omdbApi->search($omdbTitle, 'movie'); |
1108 | 1108 | } |
1109 | 1109 | |
1110 | - if (\is_object($buffer) && $buffer->message === 'OK' && ! Str::contains($buffer->data->Response, 'Error:') && $buffer->data->Response === 'True') { |
|
1110 | + if (\is_object($buffer) && $buffer->message === 'OK' && !Str::contains($buffer->data->Response, 'Error:') && $buffer->data->Response === 'True') { |
|
1111 | 1111 | $getIMDBid = $buffer->data->Search[0]->imdbID; |
1112 | 1112 | |
1113 | - if (! empty($getIMDBid)) { |
|
1113 | + if (!empty($getIMDBid)) { |
|
1114 | 1114 | $imdbId = $this->doMovieUpdate($getIMDBid, 'OMDbAPI', $arr['id']); |
1115 | 1115 | if ($imdbId !== false) { |
1116 | 1116 | $movieUpdated = true; |
@@ -1125,7 +1125,7 @@ discard block |
||
1125 | 1125 | $data = $this->traktTv->client->movieSummary($movieName, 'full'); |
1126 | 1126 | if ($data !== false) { |
1127 | 1127 | $this->parseTraktTv($data); |
1128 | - if (! empty($data['ids']['imdb'])) { |
|
1128 | + if (!empty($data['ids']['imdb'])) { |
|
1129 | 1129 | $imdbId = $this->doMovieUpdate($data['ids']['imdb'], 'Trakt', $arr['id']); |
1130 | 1130 | if ($imdbId !== false) { |
1131 | 1131 | $movieUpdated = true; |
@@ -1138,13 +1138,13 @@ discard block |
||
1138 | 1138 | if ($movieUpdated === false) { |
1139 | 1139 | try { |
1140 | 1140 | $data = Tmdb::getSearchApi()->searchMovies($this->currentTitle); |
1141 | - if (($data['total_results'] > 0) && ! empty($data['results'])) { |
|
1141 | + if (($data['total_results'] > 0) && !empty($data['results'])) { |
|
1142 | 1142 | foreach ($data['results'] as $result) { |
1143 | - if (! empty($result['id']) && ! empty($result['release_date'])) { |
|
1143 | + if (!empty($result['id']) && !empty($result['release_date'])) { |
|
1144 | 1144 | similar_text($this->currentYear, Carbon::parse($result['release_date'])->year, $percent); |
1145 | 1145 | if ($percent >= self::YEAR_MATCH_PERCENT) { |
1146 | 1146 | $ret = $this->fetchTMDBProperties($result['id'], true); |
1147 | - if ($ret !== false && ! empty($ret['imdbid'])) { |
|
1147 | + if ($ret !== false && !empty($ret['imdbid'])) { |
|
1148 | 1148 | $imdbId = $this->doMovieUpdate('tt'.$ret['imdbid'], 'TMDB', $arr['id']); |
1149 | 1149 | if ($imdbId !== false) { |
1150 | 1150 | $movieUpdated = true; |
@@ -1245,7 +1245,7 @@ discard block |
||
1245 | 1245 | // Finally remove multiple spaces and trim leading spaces. |
1246 | 1246 | $name = trim(preg_replace('/\s{2,}/', ' ', $name)); |
1247 | 1247 | // Check if the name is long enough and not just numbers. |
1248 | - if (\strlen($name) > 4 && ! preg_match('/^\d+$/', $name)) { |
|
1248 | + if (\strlen($name) > 4 && !preg_match('/^\d+$/', $name)) { |
|
1249 | 1249 | $this->currentTitle = $name; |
1250 | 1250 | $this->currentYear = $year; |
1251 | 1251 |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | $this->setPreferences(); |
17 | 17 | $movie = new Movie(['Settings' => $this->settings]); |
18 | 18 | |
19 | - $moviecats = Category::getChildren(Category::MOVIE_ROOT)->map(function ($mcat) { |
|
19 | + $moviecats = Category::getChildren(Category::MOVIE_ROOT)->map(function($mcat) { |
|
20 | 20 | return ['id' => $mcat->id, 'title' => $mcat->title]; |
21 | 21 | }); |
22 | 22 | |
@@ -40,14 +40,14 @@ discard block |
||
40 | 40 | |
41 | 41 | $orderby = $request->input('ob', ''); |
42 | 42 | $ordering = $movie->getMovieOrdering(); |
43 | - if (! in_array($orderby, $ordering, false)) { |
|
43 | + if (!in_array($orderby, $ordering, false)) { |
|
44 | 44 | $orderby = ''; |
45 | 45 | } |
46 | 46 | |
47 | 47 | $rslt = $movie->getMovieRange($page, $catarray, $offset, config('nntmux.items_per_cover_page'), $orderby, -1, $this->userdata->categoryexclusions); |
48 | 48 | $results = $this->paginate($rslt ?? [], $rslt[0]->_totalcount ?? 0, config('nntmux.items_per_cover_page'), $page, $request->url(), $request->query()); |
49 | 49 | |
50 | - $movies = $results->map(function ($result) { |
|
50 | + $movies = $results->map(function($result) { |
|
51 | 51 | $result->genre = makeFieldLinks($result, 'genre', 'movies'); |
52 | 52 | $result->actors = makeFieldLinks($result, 'actors', 'movies'); |
53 | 53 | $result->director = makeFieldLinks($result, 'director', 'movies'); |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | if ($request->has('id') && ctype_digit($request->input('id'))) { |
97 | 97 | $mov = $movie->getMovieInfo($request->input('id')); |
98 | 98 | |
99 | - if (! $mov) { |
|
99 | + if (!$mov) { |
|
100 | 100 | return response()->json(['message' => 'There is no trailer for this movie.'], 404); |
101 | 101 | } |
102 | 102 |