@@ -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; |
@@ -186,8 +186,8 @@ discard block |
||
186 | 186 | ->where('movieinfo.title', '!=', '') |
187 | 187 | ->where('movieinfo.imdbid', '!=', '0000000') |
188 | 188 | ->when($maxAge > 0, fn ($query) => $query->whereRaw('r.postdate > NOW() - INTERVAL ? DAY', [$maxAge])) |
189 | - ->when(! empty($excludedCats), fn ($query) => $query->whereNotIn('r.categories_id', $excludedCats)) |
|
190 | - ->when(! empty($categorySearch), fn ($query) => $query->whereRaw( |
|
189 | + ->when(!empty($excludedCats), fn ($query) => $query->whereNotIn('r.categories_id', $excludedCats)) |
|
190 | + ->when(!empty($categorySearch), fn ($query) => $query->whereRaw( |
|
191 | 191 | // Check if $categorySearch starts with AND or OR and clean it up |
192 | 192 | preg_match('/^\s*(AND|OR)\s+/i', $categorySearch) ? preg_replace('/^\s*(AND|OR)\s+/i', '', $categorySearch) : $categorySearch |
193 | 193 | )) |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | $movieIDs = $movies->pluck('imdbid')->toArray(); |
203 | 203 | $releaseIDs = $movies->pluck('grp_release_id')->toArray(); |
204 | 204 | |
205 | - if (! empty($movieIDs)) { |
|
205 | + if (!empty($movieIDs)) { |
|
206 | 206 | $moviesDetailQuery = Release::query() |
207 | 207 | ->selectRaw(' |
208 | 208 | GROUP_CONCAT(r.id ORDER BY r.postdate DESC SEPARATOR ",") AS grp_release_id, |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | ->join('movieinfo as m', 'm.imdbid', '=', 'r.imdbid') |
233 | 233 | ->whereIn('m.imdbid', $movieIDs) |
234 | 234 | ->whereIn('r.id', $releaseIDs) |
235 | - ->when(! empty($categorySearch), fn ($query) => $query->whereRaw($categorySearch)) |
|
235 | + ->when(!empty($categorySearch), fn ($query) => $query->whereRaw($categorySearch)) |
|
236 | 236 | ->groupBy('m.imdbid') |
237 | 237 | ->orderBy($order[0], $order[1]) |
238 | 238 | ->get(); |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | $browseBy = ' '; |
290 | 290 | $browseByArr = ['title', 'director', 'actors', 'genre', 'rating', 'year', 'imdb']; |
291 | 291 | foreach ($browseByArr as $bb) { |
292 | - if (request()->has($bb) && ! empty(request()->input($bb))) { |
|
292 | + if (request()->has($bb) && !empty(request()->input($bb))) { |
|
293 | 293 | $bbv = stripslashes(request()->input($bb)); |
294 | 294 | if ($bb === 'rating') { |
295 | 295 | $bbv .= '.'; |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | |
323 | 323 | if ($this->traktcheck !== null) { |
324 | 324 | $data = $this->traktTv->client->movieSummary('tt'.$imdbId, 'full'); |
325 | - if (($data !== false) && ! empty($data['trailer'])) { |
|
325 | + if (($data !== false) && !empty($data['trailer'])) { |
|
326 | 326 | return $data['trailer']; |
327 | 327 | } |
328 | 328 | } |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | return false; |
349 | 349 | } |
350 | 350 | |
351 | - if (! empty($data['trailer'])) { |
|
351 | + if (!empty($data['trailer'])) { |
|
352 | 352 | $data['trailer'] = str_ireplace( |
353 | 353 | ['watch?v=', 'http://'], |
354 | 354 | ['embed/', 'https://'], |
@@ -382,17 +382,17 @@ discard block |
||
382 | 382 | */ |
383 | 383 | private function checkTraktValue($value) |
384 | 384 | { |
385 | - if (\is_array($value) && ! empty($value)) { |
|
385 | + if (\is_array($value) && !empty($value)) { |
|
386 | 386 | $temp = ''; |
387 | 387 | foreach ($value as $val) { |
388 | - if (! \is_array($val) && ! \is_object($val)) { |
|
388 | + if (!\is_array($val) && !\is_object($val)) { |
|
389 | 389 | $temp .= $val; |
390 | 390 | } |
391 | 391 | } |
392 | 392 | $value = $temp; |
393 | 393 | } |
394 | 394 | |
395 | - return ! empty($value) ? $value : ''; |
|
395 | + return !empty($value) ? $value : ''; |
|
396 | 396 | } |
397 | 397 | |
398 | 398 | /** |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | */ |
414 | 414 | public function update(array $values): bool |
415 | 415 | { |
416 | - if (! \count($values)) { |
|
416 | + if (!\count($values)) { |
|
417 | 417 | return false; |
418 | 418 | } |
419 | 419 | |
@@ -421,7 +421,7 @@ discard block |
||
421 | 421 | $onDuplicateKey = ['created_at' => now()]; |
422 | 422 | $found = 0; |
423 | 423 | foreach ($values as $key => $value) { |
424 | - if (! empty($value)) { |
|
424 | + if (!empty($value)) { |
|
425 | 425 | $found++; |
426 | 426 | if (\in_array($key, ['genre', 'language'], false)) { |
427 | 427 | $value = substr($value, 0, 64); |
@@ -430,7 +430,7 @@ discard block |
||
430 | 430 | $onDuplicateKey += [$key => $value]; |
431 | 431 | } |
432 | 432 | } |
433 | - if (! $found) { |
|
433 | + if (!$found) { |
|
434 | 434 | return false; |
435 | 435 | } |
436 | 436 | foreach ($query as $key => $value) { |
@@ -447,19 +447,19 @@ discard block |
||
447 | 447 | */ |
448 | 448 | protected function setVariables(string|array $variable1, string|array $variable2, string|array $variable3, string|array $variable4, string|array $variable5) |
449 | 449 | { |
450 | - if (! empty($variable1)) { |
|
450 | + if (!empty($variable1)) { |
|
451 | 451 | return $variable1; |
452 | 452 | } |
453 | - if (! empty($variable2)) { |
|
453 | + if (!empty($variable2)) { |
|
454 | 454 | return $variable2; |
455 | 455 | } |
456 | - if (! empty($variable3)) { |
|
456 | + if (!empty($variable3)) { |
|
457 | 457 | return $variable3; |
458 | 458 | } |
459 | - if (! empty($variable4)) { |
|
459 | + if (!empty($variable4)) { |
|
460 | 460 | return $variable4; |
461 | 461 | } |
462 | - if (! empty($variable5)) { |
|
462 | + if (!empty($variable5)) { |
|
463 | 463 | return $variable5; |
464 | 464 | } |
465 | 465 | |
@@ -494,7 +494,7 @@ discard block |
||
494 | 494 | |
495 | 495 | $iTunes = $this->fetchItunesMovieProperties($this->currentTitle); |
496 | 496 | |
497 | - if (! $imdb && ! $tmdb && ! $trakt && ! $omdb && empty($iTunes)) { |
|
497 | + if (!$imdb && !$tmdb && !$trakt && !$omdb && empty($iTunes)) { |
|
498 | 498 | return false; |
499 | 499 | } |
500 | 500 | |
@@ -507,36 +507,36 @@ discard block |
||
507 | 507 | $mov['type'] = $mov['director'] = $mov['actors'] = $mov['language'] = ''; |
508 | 508 | |
509 | 509 | $mov['imdbid'] = $imdbId; |
510 | - $mov['tmdbid'] = (! isset($tmdb['tmdbid']) || $tmdb['tmdbid'] === '') ? 0 : $tmdb['tmdbid']; |
|
511 | - $mov['traktid'] = (! isset($trakt['id']) || $trakt['id'] === '') ? 0 : $trakt['id']; |
|
510 | + $mov['tmdbid'] = (!isset($tmdb['tmdbid']) || $tmdb['tmdbid'] === '') ? 0 : $tmdb['tmdbid']; |
|
511 | + $mov['traktid'] = (!isset($trakt['id']) || $trakt['id'] === '') ? 0 : $trakt['id']; |
|
512 | 512 | |
513 | 513 | // Prefer Fanart.tv cover over TMDB,TMDB over IMDB,IMDB over OMDB and OMDB over iTunes. |
514 | - if (! empty($fanart['cover'])) { |
|
514 | + if (!empty($fanart['cover'])) { |
|
515 | 515 | $mov['cover'] = $this->releaseImage->saveImage($imdbId.'-cover', $fanart['cover'], $this->imgSavePath); |
516 | - } elseif (! empty($tmdb['cover'])) { |
|
516 | + } elseif (!empty($tmdb['cover'])) { |
|
517 | 517 | $mov['cover'] = $this->releaseImage->saveImage($imdbId.'-cover', $tmdb['cover'], $this->imgSavePath); |
518 | - } elseif (! empty($imdb['cover'])) { |
|
518 | + } elseif (!empty($imdb['cover'])) { |
|
519 | 519 | $mov['cover'] = $this->releaseImage->saveImage($imdbId.'-cover', $imdb['cover'], $this->imgSavePath); |
520 | - } elseif (! empty($omdb['cover'])) { |
|
520 | + } elseif (!empty($omdb['cover'])) { |
|
521 | 521 | $mov['cover'] = $this->releaseImage->saveImage($imdbId.'-cover', $omdb['cover'], $this->imgSavePath); |
522 | - } elseif (! empty($iTunes['cover'])) { |
|
522 | + } elseif (!empty($iTunes['cover'])) { |
|
523 | 523 | $mov['cover'] = $this->releaseImage->saveImage($imdbId.'-cover', $iTunes['cover'], $this->imgSavePath); |
524 | 524 | } |
525 | 525 | |
526 | 526 | // Backdrops. |
527 | - if (! empty($fanart['backdrop'])) { |
|
527 | + if (!empty($fanart['backdrop'])) { |
|
528 | 528 | $mov['backdrop'] = $this->releaseImage->saveImage($imdbId.'-backdrop', $fanart['backdrop'], $this->imgSavePath, 1920, 1024); |
529 | - } elseif (! empty($tmdb['backdrop'])) { |
|
529 | + } elseif (!empty($tmdb['backdrop'])) { |
|
530 | 530 | $mov['backdrop'] = $this->releaseImage->saveImage($imdbId.'-backdrop', $tmdb['backdrop'], $this->imgSavePath, 1920, 1024); |
531 | 531 | } |
532 | 532 | |
533 | 533 | // Banner |
534 | - if (! empty($fanart['banner'])) { |
|
534 | + if (!empty($fanart['banner'])) { |
|
535 | 535 | $mov['banner'] = $this->releaseImage->saveImage($imdbId.'-banner', $fanart['banner'], $this->imgSavePath); |
536 | 536 | } |
537 | 537 | |
538 | 538 | // RottenTomatoes rating from OmdbAPI |
539 | - if ($omdb !== false && ! empty($omdb['rtRating'])) { |
|
539 | + if ($omdb !== false && !empty($omdb['rtRating'])) { |
|
540 | 540 | $mov['rtrating'] = $omdb['rtRating']; |
541 | 541 | } |
542 | 542 | |
@@ -547,29 +547,29 @@ discard block |
||
547 | 547 | $mov['year'] = $this->setVariables($imdb['year'] ?? '', $tmdb['year'] ?? '', $trakt['year'] ?? '', $omdb['year'] ?? '', $iTunes['year'] ?? ''); |
548 | 548 | $mov['genre'] = $this->setVariables($imdb['genre'] ?? '', $tmdb['genre'] ?? '', $trakt['genres'] ?? '', $omdb['genre'] ?? '', $iTunes['genre'] ?? ''); |
549 | 549 | |
550 | - if (! empty($imdb['type'])) { |
|
550 | + if (!empty($imdb['type'])) { |
|
551 | 551 | $mov['type'] = $imdb['type']; |
552 | 552 | } |
553 | 553 | |
554 | - if (! empty($imdb['director'])) { |
|
554 | + if (!empty($imdb['director'])) { |
|
555 | 555 | $mov['director'] = \is_array($imdb['director']) ? implode(', ', array_unique($imdb['director'])) : $imdb['director']; |
556 | - } elseif (! empty($omdb['director'])) { |
|
556 | + } elseif (!empty($omdb['director'])) { |
|
557 | 557 | $mov['director'] = \is_array($omdb['director']) ? implode(', ', array_unique($omdb['director'])) : $omdb['director']; |
558 | - } elseif (! empty($tmdb['director'])) { |
|
558 | + } elseif (!empty($tmdb['director'])) { |
|
559 | 559 | $mov['director'] = \is_array($tmdb['director']) ? implode(', ', array_unique($tmdb['director'])) : $tmdb['director']; |
560 | 560 | } |
561 | 561 | |
562 | - if (! empty($imdb['actors'])) { |
|
562 | + if (!empty($imdb['actors'])) { |
|
563 | 563 | $mov['actors'] = \is_array($imdb['actors']) ? implode(', ', array_unique($imdb['actors'])) : $imdb['actors']; |
564 | - } elseif (! empty($omdb['actors'])) { |
|
564 | + } elseif (!empty($omdb['actors'])) { |
|
565 | 565 | $mov['actors'] = \is_array($omdb['actors']) ? implode(', ', array_unique($omdb['actors'])) : $omdb['actors']; |
566 | - } elseif (! empty($tmdb['actors'])) { |
|
566 | + } elseif (!empty($tmdb['actors'])) { |
|
567 | 567 | $mov['actors'] = \is_array($tmdb['actors']) ? implode(', ', array_unique($tmdb['actors'])) : $tmdb['actors']; |
568 | 568 | } |
569 | 569 | |
570 | - if (! empty($imdb['language'])) { |
|
570 | + if (!empty($imdb['language'])) { |
|
571 | 571 | $mov['language'] = \is_array($imdb['language']) ? implode(', ', array_unique($imdb['language'])) : $imdb['language']; |
572 | - } elseif (! empty($omdb['language']) && ! is_bool($omdb['language'])) { |
|
572 | + } elseif (!empty($omdb['language']) && !is_bool($omdb['language'])) { |
|
573 | 573 | $mov['language'] = \is_array($omdb['language']) ? implode(', ', array_unique($omdb['language'])) : $omdb['language']; |
574 | 574 | } |
575 | 575 | |
@@ -627,20 +627,20 @@ discard block |
||
627 | 627 | if ($this->fanartapikey !== null) { |
628 | 628 | $art = $this->fanart->getMovieFanArt('tt'.$imdbId); |
629 | 629 | |
630 | - if (! empty($art)) { |
|
630 | + if (!empty($art)) { |
|
631 | 631 | if (isset($art['status']) && $art['status'] === 'error') { |
632 | 632 | return false; |
633 | 633 | } |
634 | 634 | $ret = []; |
635 | - if (! empty($art['moviebackground'][0]['url'])) { |
|
635 | + if (!empty($art['moviebackground'][0]['url'])) { |
|
636 | 636 | $ret['backdrop'] = $art['moviebackground'][0]['url']; |
637 | - } elseif (! empty($art['moviethumb'][0]['url'])) { |
|
637 | + } elseif (!empty($art['moviethumb'][0]['url'])) { |
|
638 | 638 | $ret['backdrop'] = $art['moviethumb'][0]['url']; |
639 | 639 | } |
640 | - if (! empty($art['movieposter'][0]['url'])) { |
|
640 | + if (!empty($art['movieposter'][0]['url'])) { |
|
641 | 641 | $ret['cover'] = $art['movieposter'][0]['url']; |
642 | 642 | } |
643 | - if (! empty($art['moviebanner'][0]['url'])) { |
|
643 | + if (!empty($art['moviebanner'][0]['url'])) { |
|
644 | 644 | $ret['banner'] = $art['moviebanner'][0]['url']; |
645 | 645 | } |
646 | 646 | |
@@ -677,7 +677,7 @@ discard block |
||
677 | 677 | return false; |
678 | 678 | } |
679 | 679 | |
680 | - if (! empty($tmdbLookup)) { |
|
680 | + if (!empty($tmdbLookup)) { |
|
681 | 681 | if ($this->currentTitle !== '') { |
682 | 682 | // Check the similarity. |
683 | 683 | similar_text($this->currentTitle, $tmdbLookup['title'], $percent); |
@@ -706,7 +706,7 @@ discard block |
||
706 | 706 | $ret['rating'] = ''; |
707 | 707 | } |
708 | 708 | $actors = Arr::pluck($tmdbLookup['credits']['cast'], 'name'); |
709 | - if (! empty($actors)) { |
|
709 | + if (!empty($actors)) { |
|
710 | 710 | $ret['actors'] = $actors; |
711 | 711 | } else { |
712 | 712 | $ret['actors'] = ''; |
@@ -717,7 +717,7 @@ discard block |
||
717 | 717 | } |
718 | 718 | } |
719 | 719 | $overview = $tmdbLookup['overview']; |
720 | - if (! empty($overview)) { |
|
720 | + if (!empty($overview)) { |
|
721 | 721 | $ret['plot'] = $overview; |
722 | 722 | } else { |
723 | 723 | $ret['plot'] = ''; |
@@ -727,13 +727,13 @@ discard block |
||
727 | 727 | $ret['tagline'] = $tagline ?? ''; |
728 | 728 | |
729 | 729 | $released = $tmdbLookup['release_date']; |
730 | - if (! empty($released)) { |
|
730 | + if (!empty($released)) { |
|
731 | 731 | $ret['year'] = Carbon::parse($released)->year; |
732 | 732 | } else { |
733 | 733 | $ret['year'] = ''; |
734 | 734 | } |
735 | 735 | $genresa = $tmdbLookup['genres']; |
736 | - if (! empty($genresa) && \count($genresa) > 0) { |
|
736 | + if (!empty($genresa) && \count($genresa) > 0) { |
|
737 | 737 | $genres = []; |
738 | 738 | foreach ($genresa as $genre) { |
739 | 739 | $genres[] = $genre['name']; |
@@ -743,13 +743,13 @@ discard block |
||
743 | 743 | $ret['genre'] = ''; |
744 | 744 | } |
745 | 745 | $posterp = $tmdbLookup['poster_path']; |
746 | - if (! empty($posterp)) { |
|
746 | + if (!empty($posterp)) { |
|
747 | 747 | $ret['cover'] = 'https://image.tmdb.org/t/p/original'.$posterp; |
748 | 748 | } else { |
749 | 749 | $ret['cover'] = ''; |
750 | 750 | } |
751 | 751 | $backdrop = $tmdbLookup['backdrop_path']; |
752 | - if (! empty($backdrop)) { |
|
752 | + if (!empty($backdrop)) { |
|
753 | 753 | $ret['backdrop'] = 'https://image.tmdb.org/t/p/original'.$backdrop; |
754 | 754 | } else { |
755 | 755 | $ret['backdrop'] = ''; |
@@ -771,9 +771,9 @@ discard block |
||
771 | 771 | { |
772 | 772 | $realId = (new Title($imdbId, $this->config))->real_id(); |
773 | 773 | $result = new Title($realId, $this->config); |
774 | - $title = ! empty($result->orig_title()) ? $result->orig_title() : $result->title(); |
|
775 | - if (! empty($title)) { |
|
776 | - if (! empty($this->currentTitle)) { |
|
774 | + $title = !empty($result->orig_title()) ? $result->orig_title() : $result->title(); |
|
775 | + if (!empty($title)) { |
|
776 | + if (!empty($this->currentTitle)) { |
|
777 | 777 | similar_text($this->currentTitle, $title, $percent); |
778 | 778 | if ($percent >= self::MATCH_PERCENT) { |
779 | 779 | similar_text($this->currentYear, $result->year(), $percent); |
@@ -782,7 +782,7 @@ discard block |
||
782 | 782 | 'title' => $title, |
783 | 783 | 'tagline' => $result->tagline() ?? '', |
784 | 784 | 'plot' => Arr::get($result->plot_split(), '0.plot'), |
785 | - 'rating' => ! empty($result->rating()) ? $result->rating() : '', |
|
785 | + 'rating' => !empty($result->rating()) ? $result->rating() : '', |
|
786 | 786 | 'year' => $result->year() ?? '', |
787 | 787 | 'cover' => $result->photo() ?? '', |
788 | 788 | 'genre' => $result->genre() ?? '', |
@@ -807,7 +807,7 @@ discard block |
||
807 | 807 | 'title' => $title, |
808 | 808 | 'tagline' => $result->tagline() ?? '', |
809 | 809 | 'plot' => Arr::get($result->plot_split(), '0.plot'), |
810 | - 'rating' => ! empty($result->rating()) ? $result->rating() : '', |
|
810 | + 'rating' => !empty($result->rating()) ? $result->rating() : '', |
|
811 | 811 | 'year' => $result->year() ?? '', |
812 | 812 | 'cover' => $result->photo() ?? '', |
813 | 813 | 'genre' => $result->genre() ?? '', |
@@ -881,7 +881,7 @@ discard block |
||
881 | 881 | if ($this->omdbapikey !== null) { |
882 | 882 | $resp = $this->omdbApi->fetch('i', 'tt'.$imdbId); |
883 | 883 | |
884 | - if (\is_object($resp) && $resp->message === 'OK' && ! Str::contains($resp->data->Response, 'Error:') && $resp->data->Response !== 'False') { |
|
884 | + if (\is_object($resp) && $resp->message === 'OK' && !Str::contains($resp->data->Response, 'Error:') && $resp->data->Response !== 'False') { |
|
885 | 885 | similar_text($this->currentTitle, $resp->data->Title, $percent); |
886 | 886 | if ($percent >= self::MATCH_PERCENT) { |
887 | 887 | similar_text($this->currentYear, $resp->data->Year, $percent); |
@@ -1047,7 +1047,7 @@ discard block |
||
1047 | 1047 | // Loop over releases. |
1048 | 1048 | foreach ($res as $arr) { |
1049 | 1049 | // Try to get a name/year. |
1050 | - if (! $this->parseMovieSearchName($arr['searchname'])) { |
|
1050 | + if (!$this->parseMovieSearchName($arr['searchname'])) { |
|
1051 | 1051 | //We didn't find a name, so set to all 0's so we don't parse again. |
1052 | 1052 | Release::query()->where('id', $arr['id'])->update(['imdbid' => 0000000]); |
1053 | 1053 | |
@@ -1081,7 +1081,7 @@ discard block |
||
1081 | 1081 | try { |
1082 | 1082 | $imdbSearch = new TitleSearch($this->config); |
1083 | 1083 | foreach ($imdbSearch->search($this->currentTitle, [TitleSearch::MOVIE]) as $imdbTitle) { |
1084 | - if (! empty($imdbTitle->title())) { |
|
1084 | + if (!empty($imdbTitle->title())) { |
|
1085 | 1085 | similar_text($imdbTitle->title(), $this->currentTitle, $percent); |
1086 | 1086 | if ($percent >= self::MATCH_PERCENT) { |
1087 | 1087 | similar_text($this->currentYear, $imdbTitle->year(), $percent); |
@@ -1111,10 +1111,10 @@ discard block |
||
1111 | 1111 | $buffer = $this->omdbApi->search($omdbTitle, 'movie'); |
1112 | 1112 | } |
1113 | 1113 | |
1114 | - if (\is_object($buffer) && $buffer->message === 'OK' && ! Str::contains($buffer->data->Response, 'Error:') && $buffer->data->Response === 'True') { |
|
1114 | + if (\is_object($buffer) && $buffer->message === 'OK' && !Str::contains($buffer->data->Response, 'Error:') && $buffer->data->Response === 'True') { |
|
1115 | 1115 | $getIMDBid = $buffer->data->Search[0]->imdbID; |
1116 | 1116 | |
1117 | - if (! empty($getIMDBid)) { |
|
1117 | + if (!empty($getIMDBid)) { |
|
1118 | 1118 | $imdbId = $this->doMovieUpdate($getIMDBid, 'OMDbAPI', $arr['id']); |
1119 | 1119 | if ($imdbId !== false) { |
1120 | 1120 | $movieUpdated = true; |
@@ -1129,7 +1129,7 @@ discard block |
||
1129 | 1129 | $data = $this->traktTv->client->movieSummary($movieName, 'full'); |
1130 | 1130 | if ($data !== false) { |
1131 | 1131 | $this->parseTraktTv($data); |
1132 | - if (! empty($data['ids']['imdb'])) { |
|
1132 | + if (!empty($data['ids']['imdb'])) { |
|
1133 | 1133 | $imdbId = $this->doMovieUpdate($data['ids']['imdb'], 'Trakt', $arr['id']); |
1134 | 1134 | if ($imdbId !== false) { |
1135 | 1135 | $movieUpdated = true; |
@@ -1142,13 +1142,13 @@ discard block |
||
1142 | 1142 | if ($movieUpdated === false) { |
1143 | 1143 | try { |
1144 | 1144 | $data = Tmdb::getSearchApi()->searchMovies($this->currentTitle); |
1145 | - if (($data['total_results'] > 0) && ! empty($data['results'])) { |
|
1145 | + if (($data['total_results'] > 0) && !empty($data['results'])) { |
|
1146 | 1146 | foreach ($data['results'] as $result) { |
1147 | - if (! empty($result['id']) && ! empty($result['release_date'])) { |
|
1147 | + if (!empty($result['id']) && !empty($result['release_date'])) { |
|
1148 | 1148 | similar_text($this->currentYear, Carbon::parse($result['release_date'])->year, $percent); |
1149 | 1149 | if ($percent >= self::YEAR_MATCH_PERCENT) { |
1150 | 1150 | $ret = $this->fetchTMDBProperties($result['id'], true); |
1151 | - if ($ret !== false && ! empty($ret['imdbid'])) { |
|
1151 | + if ($ret !== false && !empty($ret['imdbid'])) { |
|
1152 | 1152 | $imdbId = $this->doMovieUpdate('tt'.$ret['imdbid'], 'TMDB', $arr['id']); |
1153 | 1153 | if ($imdbId !== false) { |
1154 | 1154 | $movieUpdated = true; |
@@ -1249,7 +1249,7 @@ discard block |
||
1249 | 1249 | // Finally remove multiple spaces and trim leading spaces. |
1250 | 1250 | $name = trim(preg_replace('/\s{2,}/', ' ', $name)); |
1251 | 1251 | // Check if the name is long enough and not just numbers. |
1252 | - if (\strlen($name) > 4 && ! preg_match('/^\d+$/', $name)) { |
|
1252 | + if (\strlen($name) > 4 && !preg_match('/^\d+$/', $name)) { |
|
1253 | 1253 | $this->currentTitle = $name; |
1254 | 1254 | $this->currentYear = $year; |
1255 | 1255 |