@@ -37,7 +37,7 @@ discard block |
||
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 |
||
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 |
||
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 | } |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | GROUP BY r.id |
276 | 276 | ORDER BY %s %s %s", |
277 | 277 | $this->uSQL($userShows, 'videos_id'), |
278 | - (! empty($excludedCats) ? ' AND r.categories_id NOT IN ('.implode(',', $excludedCats).')' : ''), |
|
278 | + (!empty($excludedCats) ? ' AND r.categories_id NOT IN ('.implode(',', $excludedCats).')' : ''), |
|
279 | 279 | NZB::NZB_ADDED, |
280 | 280 | Category::TV_ROOT, |
281 | 281 | Category::TV_OTHER, |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | { |
346 | 346 | // Delete NZB from disk. |
347 | 347 | $nzbPath = $nzb->NZBPath($identifiers['g']); |
348 | - if (! empty($nzbPath)) { |
|
348 | + if (!empty($nzbPath)) { |
|
349 | 349 | File::delete($nzbPath); |
350 | 350 | } |
351 | 351 | |
@@ -385,7 +385,7 @@ discard block |
||
385 | 385 | */ |
386 | 386 | public function updateMulti($guids, $category, $grabs, $videoId, $episodeId, $anidbId, $imdbId) |
387 | 387 | { |
388 | - if (! \is_array($guids) || \count($guids) < 1) { |
|
388 | + if (!\is_array($guids) || \count($guids) < 1) { |
|
389 | 389 | return false; |
390 | 390 | } |
391 | 391 | |
@@ -409,7 +409,7 @@ discard block |
||
409 | 409 | $sql = '(1=2 '; |
410 | 410 | foreach ($userQuery as $query) { |
411 | 411 | $sql .= sprintf('OR (r.%s = %d', $type, $query->$type); |
412 | - if (! empty($query->categories)) { |
|
412 | + if (!empty($query->categories)) { |
|
413 | 413 | $catsArr = explode('|', $query->categories); |
414 | 414 | if (\count($catsArr) > 1) { |
415 | 415 | $sql .= sprintf(' AND r.categories_id IN (%s)', implode(',', $catsArr)); |
@@ -453,7 +453,7 @@ discard block |
||
453 | 453 | $orderBy = $this->getBrowseOrder($orderBy); |
454 | 454 | } |
455 | 455 | |
456 | - $searchFields = Arr::where($searchArr, static function ($value) { |
|
456 | + $searchFields = Arr::where($searchArr, static function($value) { |
|
457 | 457 | return $value !== -1; |
458 | 458 | }); |
459 | 459 | |
@@ -463,7 +463,7 @@ discard block |
||
463 | 463 | $searchResult = $this->elasticSearch->indexSearch($phrases, $limit); |
464 | 464 | } else { |
465 | 465 | $searchResult = $this->manticoreSearch->searchIndexes('releases_rt', '', [], $searchFields); |
466 | - if (! empty($searchResult)) { |
|
466 | + if (!empty($searchResult)) { |
|
467 | 467 | $searchResult = Arr::wrap(Arr::get($searchResult, 'id')); |
468 | 468 | } |
469 | 469 | } |
@@ -554,7 +554,7 @@ discard block |
||
554 | 554 | $searchResult = $this->elasticSearch->indexSearchApi($searchName, $limit); |
555 | 555 | } else { |
556 | 556 | $searchResult = $this->manticoreSearch->searchIndexes('releases_rt', $searchName, ['searchname']); |
557 | - if (! empty($searchResult)) { |
|
557 | + if (!empty($searchResult)) { |
|
558 | 558 | $searchResult = Arr::wrap(Arr::get($searchResult, 'id')); |
559 | 559 | } |
560 | 560 | } |
@@ -570,7 +570,7 @@ discard block |
||
570 | 570 | ((int) $groupName !== -1 ? sprintf(' AND r.groups_id = %d ', UsenetGroup::getIDByName($groupName)) : ''), |
571 | 571 | $catQuery, |
572 | 572 | (\count($excludedCats) > 0 ? ' AND r.categories_id NOT IN ('.implode(',', $excludedCats).')' : ''), |
573 | - (! empty($searchResult) ? 'AND r.id IN ('.implode(',', $searchResult).')' : ''), |
|
573 | + (!empty($searchResult) ? 'AND r.id IN ('.implode(',', $searchResult).')' : ''), |
|
574 | 574 | ($minSize > 0 ? sprintf('AND r.size >= %d', $minSize) : '') |
575 | 575 | ); |
576 | 576 | $baseSql = sprintf( |
@@ -604,7 +604,7 @@ discard block |
||
604 | 604 | if ($releases !== null) { |
605 | 605 | return $releases; |
606 | 606 | } |
607 | - if ($searchName !== -1 && ! empty($searchResult)) { |
|
607 | + if ($searchName !== -1 && !empty($searchResult)) { |
|
608 | 608 | $releases = self::fromQuery($sql); |
609 | 609 | } elseif ($searchName !== -1 && empty($searchResult)) { |
610 | 610 | $releases = collect(); |
@@ -658,11 +658,11 @@ discard block |
||
658 | 658 | $show = self::fromQuery($showQry); |
659 | 659 | |
660 | 660 | if ($show->isNotEmpty()) { |
661 | - if ((! empty($episode) && ! empty($series)) && $show[0]->episodes !== '') { |
|
661 | + if ((!empty($episode) && !empty($series)) && $show[0]->episodes !== '') { |
|
662 | 662 | $showSql .= ' AND r.tv_episodes_id IN ('.$show[0]->episodes.') AND tve.series = '.$series; |
663 | - } elseif (! empty($episode) && $show[0]->episodes !== '') { |
|
663 | + } elseif (!empty($episode) && $show[0]->episodes !== '') { |
|
664 | 664 | $showSql = sprintf('AND r.tv_episodes_id IN (%s)', $show[0]->episodes); |
665 | - } elseif (! empty($series) && empty($episode)) { |
|
665 | + } elseif (!empty($series) && empty($episode)) { |
|
666 | 666 | // If $series is set but episode is not, return Season Packs and Episodes |
667 | 667 | $showSql .= ' AND r.tv_episodes_id IN ('.$show[0]->episodes.') AND tve.series = '.$series; |
668 | 668 | } |
@@ -676,26 +676,26 @@ discard block |
||
676 | 676 | } |
677 | 677 | |
678 | 678 | // If $name is set it is a fallback search, add available SxxExx/airdate info to the query |
679 | - if (! empty($name) && $showSql === '') { |
|
680 | - if (! empty($series) && (int) $series < 1900) { |
|
679 | + if (!empty($name) && $showSql === '') { |
|
680 | + if (!empty($series) && (int) $series < 1900) { |
|
681 | 681 | $name .= sprintf(' S%s', str_pad($series, 2, '0', STR_PAD_LEFT)); |
682 | - if (! empty($episode) && ! str_contains($episode, '/')) { |
|
682 | + if (!empty($episode) && !str_contains($episode, '/')) { |
|
683 | 683 | $name .= sprintf('E%s', str_pad($episode, 2, '0', STR_PAD_LEFT)); |
684 | 684 | } |
685 | 685 | // If season is not empty but episode is, add a wildcard to the search |
686 | 686 | if (empty($episode)) { |
687 | 687 | $name .= '*'; |
688 | 688 | } |
689 | - } elseif (! empty($airDate)) { |
|
689 | + } elseif (!empty($airDate)) { |
|
690 | 690 | $name .= sprintf(' %s', str_replace(['/', '-', '.', '_'], ' ', $airDate)); |
691 | 691 | } |
692 | 692 | } |
693 | - if (! empty($name)) { |
|
693 | + if (!empty($name)) { |
|
694 | 694 | if (config('nntmux.elasticsearch_enabled') === true) { |
695 | 695 | $searchResult = $this->elasticSearch->indexSearchTMA($name, $limit); |
696 | 696 | } else { |
697 | 697 | $searchResult = $this->manticoreSearch->searchIndexes('releases_rt', $name, ['searchname']); |
698 | - if (! empty($searchResult)) { |
|
698 | + if (!empty($searchResult)) { |
|
699 | 699 | $searchResult = Arr::wrap(Arr::get($searchResult, 'id')); |
700 | 700 | } |
701 | 701 | } |
@@ -711,11 +711,11 @@ discard block |
||
711 | 711 | NZB::NZB_ADDED, |
712 | 712 | $this->showPasswords(), |
713 | 713 | $showSql, |
714 | - (! empty($name) && ! empty($searchResult)) ? 'AND r.id IN ('.implode(',', $searchResult).')' : '', |
|
714 | + (!empty($name) && !empty($searchResult)) ? 'AND r.id IN ('.implode(',', $searchResult).')' : '', |
|
715 | 715 | Category::getCategorySearch($cat), |
716 | 716 | $maxAge > 0 ? sprintf('AND r.postdate > NOW() - INTERVAL %d DAY', $maxAge) : '', |
717 | 717 | $minSize > 0 ? sprintf('AND r.size >= %d', $minSize) : '', |
718 | - ! empty($excludedCategories) ? sprintf('AND r.categories_id NOT IN('.implode(',', $excludedCategories).')') : '' |
|
718 | + !empty($excludedCategories) ? sprintf('AND r.categories_id NOT IN('.implode(',', $excludedCategories).')') : '' |
|
719 | 719 | ); |
720 | 720 | $baseSql = sprintf( |
721 | 721 | "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, |
@@ -751,7 +751,7 @@ discard block |
||
751 | 751 | if ($releases !== null) { |
752 | 752 | return $releases; |
753 | 753 | } |
754 | - $releases = ((! empty($name) && ! empty($searchResult)) || empty($name)) ? self::fromQuery($sql) : []; |
|
754 | + $releases = ((!empty($name) && !empty($searchResult)) || empty($name)) ? self::fromQuery($sql) : []; |
|
755 | 755 | if (count($releases) !== 0 && $releases->isNotEmpty()) { |
756 | 756 | $releases[0]->_totalrows = $this->getPagerCount( |
757 | 757 | preg_replace('#LEFT(\s+OUTER)?\s+JOIN\s+(?!tv_episodes)\s+.*ON.*=.*\n#i', ' ', $baseSql) |
@@ -799,11 +799,11 @@ discard block |
||
799 | 799 | |
800 | 800 | $show = self::fromQuery($showQry); |
801 | 801 | if ($show->isNotEmpty()) { |
802 | - if ((! empty($episode) && ! empty($series)) && $show[0]->episodes !== '') { |
|
802 | + if ((!empty($episode) && !empty($series)) && $show[0]->episodes !== '') { |
|
803 | 803 | $showSql .= ' AND r.tv_episodes_id IN ('.$show[0]->episodes.') AND tve.series = '.$series; |
804 | - } elseif (! empty($episode) && $show[0]->episodes !== '') { |
|
804 | + } elseif (!empty($episode) && $show[0]->episodes !== '') { |
|
805 | 805 | $showSql = sprintf('AND r.tv_episodes_id IN (%s)', $show[0]->episodes); |
806 | - } elseif (! empty($series) && empty($episode)) { |
|
806 | + } elseif (!empty($series) && empty($episode)) { |
|
807 | 807 | // If $series is set but episode is not, return Season Packs and Episodes |
808 | 808 | $showSql .= ' AND r.tv_episodes_id IN ('.$show[0]->episodes.') AND tve.series = '.$series; |
809 | 809 | } |
@@ -816,26 +816,26 @@ discard block |
||
816 | 816 | } |
817 | 817 | } |
818 | 818 | // If $name is set it is a fallback search, add available SxxExx/airdate info to the query |
819 | - if (! empty($name) && $showSql === '') { |
|
820 | - if (! empty($series) && (int) $series < 1900) { |
|
819 | + if (!empty($name) && $showSql === '') { |
|
820 | + if (!empty($series) && (int) $series < 1900) { |
|
821 | 821 | $name .= sprintf(' S%s', str_pad($series, 2, '0', STR_PAD_LEFT)); |
822 | - if (! empty($episode) && ! str_contains($episode, '/')) { |
|
822 | + if (!empty($episode) && !str_contains($episode, '/')) { |
|
823 | 823 | $name .= sprintf('E%s', str_pad($episode, 2, '0', STR_PAD_LEFT)); |
824 | 824 | } |
825 | 825 | // If season is not empty but episode is, add a wildcard to the search |
826 | 826 | if (empty($episode)) { |
827 | 827 | $name .= '*'; |
828 | 828 | } |
829 | - } elseif (! empty($airDate)) { |
|
829 | + } elseif (!empty($airDate)) { |
|
830 | 830 | $name .= sprintf(' %s', str_replace(['/', '-', '.', '_'], ' ', $airDate)); |
831 | 831 | } |
832 | 832 | } |
833 | - if (! empty($name)) { |
|
833 | + if (!empty($name)) { |
|
834 | 834 | if (config('nntmux.elasticsearch_enabled') === true) { |
835 | 835 | $searchResult = $this->elasticSearch->indexSearchTMA($name, $limit); |
836 | 836 | } else { |
837 | 837 | $searchResult = $this->manticoreSearch->searchIndexes('releases_rt', $name, ['searchname']); |
838 | - if (! empty($searchResult)) { |
|
838 | + if (!empty($searchResult)) { |
|
839 | 839 | $searchResult = Arr::wrap(Arr::get($searchResult, 'id')); |
840 | 840 | } |
841 | 841 | } |
@@ -851,11 +851,11 @@ discard block |
||
851 | 851 | NZB::NZB_ADDED, |
852 | 852 | $this->showPasswords(), |
853 | 853 | $showSql, |
854 | - (! empty($searchResult) ? 'AND r.id IN ('.implode(',', $searchResult).')' : ''), |
|
854 | + (!empty($searchResult) ? 'AND r.id IN ('.implode(',', $searchResult).')' : ''), |
|
855 | 855 | Category::getCategorySearch($cat), |
856 | 856 | ($maxAge > 0 ? sprintf('AND r.postdate > NOW() - INTERVAL %d DAY', $maxAge) : ''), |
857 | 857 | ($minSize > 0 ? sprintf('AND r.size >= %d', $minSize) : ''), |
858 | - ! empty($excludedCategories) ? sprintf('AND r.categories_id NOT IN('.implode(',', $excludedCategories).')') : '' |
|
858 | + !empty($excludedCategories) ? sprintf('AND r.categories_id NOT IN('.implode(',', $excludedCategories).')') : '' |
|
859 | 859 | ); |
860 | 860 | $baseSql = sprintf( |
861 | 861 | "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, |
@@ -905,12 +905,12 @@ discard block |
||
905 | 905 | */ |
906 | 906 | public function animeSearch($aniDbID, int $offset = 0, int $limit = 100, string $name = '', array $cat = [-1], int $maxAge = -1, array $excludedCategories = []): mixed |
907 | 907 | { |
908 | - if (! empty($name)) { |
|
908 | + if (!empty($name)) { |
|
909 | 909 | if (config('nntmux.elasticsearch_enabled') === true) { |
910 | 910 | $searchResult = $this->elasticSearch->indexSearchTMA($name, $limit); |
911 | 911 | } else { |
912 | 912 | $searchResult = $this->manticoreSearch->searchIndexes('releases_rt', $name, ['searchname']); |
913 | - if (! empty($searchResult)) { |
|
913 | + if (!empty($searchResult)) { |
|
914 | 914 | $searchResult = Arr::wrap(Arr::get($searchResult, 'id')); |
915 | 915 | } |
916 | 916 | } |
@@ -927,8 +927,8 @@ discard block |
||
927 | 927 | $this->showPasswords(), |
928 | 928 | NZB::NZB_ADDED, |
929 | 929 | ($aniDbID > -1 ? sprintf(' AND r.anidbid = %d ', $aniDbID) : ''), |
930 | - (! empty($searchResult) ? 'AND r.id IN ('.implode(',', $searchResult).')' : ''), |
|
931 | - ! empty($excludedCategories) ? sprintf('AND r.categories_id NOT IN('.implode(',', $excludedCategories).')') : '', |
|
930 | + (!empty($searchResult) ? 'AND r.id IN ('.implode(',', $searchResult).')' : ''), |
|
931 | + !empty($excludedCategories) ? sprintf('AND r.categories_id NOT IN('.implode(',', $excludedCategories).')') : '', |
|
932 | 932 | Category::getCategorySearch($cat), |
933 | 933 | ($maxAge > 0 ? sprintf(' AND r.postdate > NOW() - INTERVAL %d DAY ', $maxAge) : '') |
934 | 934 | ); |
@@ -975,12 +975,12 @@ discard block |
||
975 | 975 | */ |
976 | 976 | 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 = []): mixed |
977 | 977 | { |
978 | - if (! empty($name)) { |
|
978 | + if (!empty($name)) { |
|
979 | 979 | if (config('nntmux.elasticsearch_enabled') === true) { |
980 | 980 | $searchResult = $this->elasticSearch->indexSearchTMA($name, $limit); |
981 | 981 | } else { |
982 | 982 | $searchResult = $this->manticoreSearch->searchIndexes('releases_rt', $name, ['searchname']); |
983 | - if (! empty($searchResult)) { |
|
983 | + if (!empty($searchResult)) { |
|
984 | 984 | $searchResult = Arr::wrap(Arr::get($searchResult, 'id')); |
985 | 985 | } |
986 | 986 | } |
@@ -997,11 +997,11 @@ discard block |
||
997 | 997 | %s %s %s %s %s %s %s', |
998 | 998 | NZB::NZB_ADDED, |
999 | 999 | $this->showPasswords(), |
1000 | - (! empty($searchResult) ? 'AND r.id IN ('.implode(',', $searchResult).')' : ''), |
|
1000 | + (!empty($searchResult) ? 'AND r.id IN ('.implode(',', $searchResult).')' : ''), |
|
1001 | 1001 | ($imDbId !== -1 && is_numeric($imDbId)) ? sprintf(' AND m.imdbid = \'%s\' ', $imDbId) : '', |
1002 | 1002 | ($tmDbId !== -1 && is_numeric($tmDbId)) ? sprintf(' AND m.tmdbid = %d ', $tmDbId) : '', |
1003 | 1003 | ($traktId !== -1 && is_numeric($traktId)) ? sprintf(' AND m.traktid = %d ', $traktId) : '', |
1004 | - ! empty($excludedCategories) ? sprintf('AND r.categories_id NOT IN('.implode(',', $excludedCategories).')') : '', |
|
1004 | + !empty($excludedCategories) ? sprintf('AND r.categories_id NOT IN('.implode(',', $excludedCategories).')') : '', |
|
1005 | 1005 | Category::getCategorySearch($cat), |
1006 | 1006 | $maxAge > 0 ? sprintf(' AND r.postdate > NOW() - INTERVAL %d DAY ', $maxAge) : '', |
1007 | 1007 | $minSize > 0 ? sprintf('AND r.size >= %d', $minSize) : '' |
@@ -1057,7 +1057,7 @@ discard block |
||
1057 | 1057 | } |
1058 | 1058 | |
1059 | 1059 | $results = $this->search(['searchname' => getSimilarName($name)], -1, '', '', -1, -1, 0, config('nntmux.items_per_page'), '', -1, $excludedCats, 'basic', [$parentCat]); |
1060 | - if (! $results) { |
|
1060 | + if (!$results) { |
|
1061 | 1061 | return $ret; |
1062 | 1062 | } |
1063 | 1063 |
@@ -34,7 +34,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -83,18 +83,18 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | $transport = ($tls === true ? 'tls' : 'tcp'); |
193 | 193 | |
194 | 194 | $socket_string = $transport.'://'.$hostname.':'.$port; |
195 | - if ($socket_string !== $this->_remote_socket_string || ! $this->_connected()) { |
|
195 | + if ($socket_string !== $this->_remote_socket_string || !$this->_connected()) { |
|
196 | 196 | if ($hostname === '') { |
197 | 197 | echo 'ERROR: IRC host name must not be empty!'.PHP_EOL; |
198 | 198 | |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | */ |
238 | 238 | public function login(string $nickName, string $userName, string $realName, $password = null): bool |
239 | 239 | { |
240 | - if (! $this->_connected()) { |
|
240 | + if (!$this->_connected()) { |
|
241 | 241 | echo 'ERROR: You must connect to IRC first!'.PHP_EOL; |
242 | 242 | |
243 | 243 | return false; |
@@ -254,15 +254,15 @@ discard block |
||
254 | 254 | $this->_realName = $realName; |
255 | 255 | $this->_password = $password; |
256 | 256 | |
257 | - if (empty($password) && ! $this->_writeSocket('PASSWORD '.$password)) { |
|
257 | + if (empty($password) && !$this->_writeSocket('PASSWORD '.$password)) { |
|
258 | 258 | return false; |
259 | 259 | } |
260 | 260 | |
261 | - if (! $this->_writeSocket('NICK '.$nickName)) { |
|
261 | + if (!$this->_writeSocket('NICK '.$nickName)) { |
|
262 | 262 | return false; |
263 | 263 | } |
264 | 264 | |
265 | - if (! $this->_writeSocket('USER '.$userName.' 0 * :'.$realName)) { |
|
265 | + if (!$this->_writeSocket('USER '.$userName.' 0 * :'.$realName)) { |
|
266 | 266 | return false; |
267 | 267 | } |
268 | 268 | |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | $tempPass = $password; |
292 | 292 | } |
293 | 293 | |
294 | - if ($password !== null && ! $this->_writeSocket('PASS '.$tempPass)) { |
|
294 | + if ($password !== null && !$this->_writeSocket('PASS '.$tempPass)) { |
|
295 | 295 | return false; |
296 | 296 | } |
297 | 297 | |
@@ -370,13 +370,13 @@ discard block |
||
370 | 370 | { |
371 | 371 | $this->_channels = $channels; |
372 | 372 | |
373 | - if (! $this->_connected()) { |
|
373 | + if (!$this->_connected()) { |
|
374 | 374 | echo 'ERROR: You must connect to IRC first!'.PHP_EOL; |
375 | 375 | |
376 | 376 | return false; |
377 | 377 | } |
378 | 378 | |
379 | - if (! empty($channels)) { |
|
379 | + if (!empty($channels)) { |
|
380 | 380 | foreach ($channels as $channel => $password) { |
381 | 381 | $this->_joinChannel($channel, $password ?? ''); |
382 | 382 | } |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | */ |
405 | 405 | protected function _pong(string $host) |
406 | 406 | { |
407 | - if (! $this->_writeSocket('PONG '.$host)) { |
|
407 | + if (!$this->_writeSocket('PONG '.$host)) { |
|
408 | 408 | $this->_reconnect(); |
409 | 409 | } |
410 | 410 | |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | $pong = $this->_writeSocket('PING '.$host); |
423 | 423 | |
424 | 424 | // Check if there's a connection error. |
425 | - if ($pong === false || ((time() - $this->_lastPing) > ($this->_socket_timeout / 2) && ! 0 === strpos($this->_buffer, 'PONG'))) { |
|
425 | + if ($pong === false || ((time() - $this->_lastPing) > ($this->_socket_timeout / 2) && !0 === strpos($this->_buffer, 'PONG'))) { |
|
426 | 426 | $this->_reconnect(); |
427 | 427 | } |
428 | 428 | |
@@ -437,12 +437,12 @@ discard block |
||
437 | 437 | */ |
438 | 438 | protected function _reconnect(): void |
439 | 439 | { |
440 | - if (! $this->connect($this->_remote_host, $this->_remote_port, $this->_remote_tls)) { |
|
440 | + if (!$this->connect($this->_remote_host, $this->_remote_port, $this->_remote_tls)) { |
|
441 | 441 | exit('FATAL: Could not reconnect to ('.$this->_remote_host.') after ('.$this->_reconnectRetries.') tries.'.PHP_EOL); |
442 | 442 | } |
443 | 443 | |
444 | - if (! $this->_alreadyLoggedIn) { |
|
445 | - if (! $this->login($this->_nickName, $this->_userName, $this->_realName, $this->_password)) { |
|
444 | + if (!$this->_alreadyLoggedIn) { |
|
445 | + if (!$this->login($this->_nickName, $this->_userName, $this->_realName, $this->_password)) { |
|
446 | 446 | exit('FATAL: Could not log in to ('.$this->_remote_host.')!'.PHP_EOL); |
447 | 447 | } |
448 | 448 | |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | do { |
460 | 460 | stream_set_timeout($this->_socket, $this->_socket_timeout); |
461 | 461 | $buffer .= fgets($this->_socket, 1024); |
462 | - } while (! empty($buffer) && ! preg_match('/\v+$/', $buffer)); |
|
462 | + } while (!empty($buffer) && !preg_match('/\v+$/', $buffer)); |
|
463 | 463 | $this->_buffer = trim($buffer); |
464 | 464 | |
465 | 465 | if ($this->_debug && $this->_buffer !== '') { |
@@ -545,7 +545,7 @@ discard block |
||
545 | 545 | */ |
546 | 546 | protected function _connected(): bool |
547 | 547 | { |
548 | - return \is_resource($this->_socket) && ! feof($this->_socket); |
|
548 | + return \is_resource($this->_socket) && !feof($this->_socket); |
|
549 | 549 | } |
550 | 550 | |
551 | 551 | /** |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | { |
299 | 299 | $browseBy = ' '; |
300 | 300 | foreach ($this->getBrowseByOptions() as $bbk => $bbv) { |
301 | - if (! empty($_REQUEST[$bbk])) { |
|
301 | + if (!empty($_REQUEST[$bbk])) { |
|
302 | 302 | $bbs = stripslashes($_REQUEST[$bbk]); |
303 | 303 | if ($bbk === 'year') { |
304 | 304 | $browseBy .= ' AND YEAR (gi.releasedate) '.'LIKE '.escapeString('%'.$bbs.'%'); |
@@ -362,11 +362,11 @@ discard block |
||
362 | 362 | if (empty($this->_gameResults['title'])) { |
363 | 363 | return false; |
364 | 364 | } |
365 | - if (! empty($this->_gameResults['cover'])) { |
|
365 | + if (!empty($this->_gameResults['cover'])) { |
|
366 | 366 | $game['coverurl'] = (string) $this->_gameResults['cover']; |
367 | 367 | } |
368 | 368 | |
369 | - if (! empty($this->_gameResults['backdrop'])) { |
|
369 | + if (!empty($this->_gameResults['backdrop'])) { |
|
370 | 370 | $game['backdropurl'] = (string) $this->_gameResults['backdrop']; |
371 | 371 | } |
372 | 372 | |
@@ -374,41 +374,41 @@ discard block |
||
374 | 374 | $game['asin'] = $this->_gameResults['steamid']; |
375 | 375 | $game['url'] = (string) $this->_gameResults['directurl']; |
376 | 376 | |
377 | - if (! empty($this->_gameResults['publisher'])) { |
|
377 | + if (!empty($this->_gameResults['publisher'])) { |
|
378 | 378 | $game['publisher'] = (string) $this->_gameResults['publisher']; |
379 | 379 | } else { |
380 | 380 | $game['publisher'] = 'Unknown'; |
381 | 381 | } |
382 | 382 | |
383 | - if (! empty($this->_gameResults['rating'])) { |
|
383 | + if (!empty($this->_gameResults['rating'])) { |
|
384 | 384 | $game['esrb'] = (string) $this->_gameResults['rating']; |
385 | 385 | } else { |
386 | 386 | $game['esrb'] = 'Not Rated'; |
387 | 387 | } |
388 | 388 | |
389 | - if (! empty($this->_gameResults['releasedate'])) { |
|
389 | + if (!empty($this->_gameResults['releasedate'])) { |
|
390 | 390 | $dateReleased = strtotime($this->_gameResults['releasedate']) === false ? '' : $this->_gameResults['releasedate']; |
391 | 391 | $game['releasedate'] = ($this->_gameResults['releasedate'] === '' || strtotime($this->_gameResults['releasedate']) === false) ? null : Carbon::createFromFormat('M j, Y', Carbon::parse($dateReleased)->toFormattedDateString())->format('Y-m-d'); |
392 | 392 | } |
393 | 393 | |
394 | - if (! empty($this->_gameResults['description'])) { |
|
394 | + if (!empty($this->_gameResults['description'])) { |
|
395 | 395 | $game['review'] = (string) $this->_gameResults['description']; |
396 | 396 | } |
397 | 397 | |
398 | - if (! empty($this->_gameResults['genres'])) { |
|
398 | + if (!empty($this->_gameResults['genres'])) { |
|
399 | 399 | $genres = $this->_gameResults['genres']; |
400 | 400 | $genreName = $this->_matchGenre($genres); |
401 | 401 | } |
402 | 402 | } |
403 | 403 | } |
404 | 404 | |
405 | - if (! empty($this->publicKey)) { |
|
405 | + if (!empty($this->publicKey)) { |
|
406 | 406 | if ($steamGameID === false || $this->_gameResults === false) { |
407 | 407 | $bestMatch = false; |
408 | 408 | $this->_classUsed = 'GiantBomb'; |
409 | 409 | try { |
410 | 410 | $result = $this->giantBomb->search($gameInfo['title'], 'Game'); |
411 | - if (! \is_object($result)) { |
|
411 | + if (!\is_object($result)) { |
|
412 | 412 | $bestMatchPct = 0; |
413 | 413 | foreach ($result as $res) { |
414 | 414 | similar_text(strtolower($gameInfo['title']), strtolower($res->name), $percent1); |
@@ -421,17 +421,17 @@ discard block |
||
421 | 421 | if ($bestMatch !== false) { |
422 | 422 | $this->_gameResults = $this->giantBomb->findWithResourceID('Game', '3030-'.$bestMatch); |
423 | 423 | |
424 | - if (! empty($this->_gameResults->image['medium_url'])) { |
|
424 | + if (!empty($this->_gameResults->image['medium_url'])) { |
|
425 | 425 | $game['coverurl'] = (string) $this->_gameResults->image['medium_url']; |
426 | 426 | } |
427 | 427 | |
428 | - if (! empty($this->_gameResults->image['screen_url'])) { |
|
428 | + if (!empty($this->_gameResults->image['screen_url'])) { |
|
429 | 429 | $game['backdropurl'] = (string) $this->_gameResults->image['screen_url']; |
430 | 430 | } |
431 | 431 | |
432 | 432 | $game['title'] = (string) $this->_gameResults->get('name'); |
433 | 433 | $game['asin'] = $this->_gameResults->get('id'); |
434 | - if (! empty($this->_gameResults->get('site_detail_url'))) { |
|
434 | + if (!empty($this->_gameResults->get('site_detail_url'))) { |
|
435 | 435 | $game['url'] = (string) $this->_gameResults->get('site_detail_url'); |
436 | 436 | } else { |
437 | 437 | $game['url'] = ''; |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | $game['publisher'] = 'Unknown'; |
444 | 444 | } |
445 | 445 | |
446 | - if (! empty($this->_gameResults->original_game_rating[0]['name'])) { |
|
446 | + if (!empty($this->_gameResults->original_game_rating[0]['name'])) { |
|
447 | 447 | $game['esrb'] = $this->_gameResults->original_game_rating[0]['name'] ?? 'Not Rated'; |
448 | 448 | } else { |
449 | 449 | $game['esrb'] = 'Not Rated'; |
@@ -480,7 +480,7 @@ discard block |
||
480 | 480 | $bestMatch = false; |
481 | 481 | $this->_classUsed = 'IGDB'; |
482 | 482 | $result = Game::where('name', $gameInfo['title'])->get(); |
483 | - if (! empty($result)) { |
|
483 | + if (!empty($result)) { |
|
484 | 484 | $bestMatchPct = 0; |
485 | 485 | foreach ($result as $res) { |
486 | 486 | similar_text(strtolower($gameInfo['title']), strtolower($res->name), $percent1); |
@@ -498,7 +498,7 @@ discard block |
||
498 | 498 | ])->where('id', $bestMatch)->first(); |
499 | 499 | |
500 | 500 | $publishers = []; |
501 | - if (! empty($this->_gameResults->involved_companies)) { |
|
501 | + if (!empty($this->_gameResults->involved_companies)) { |
|
502 | 502 | foreach ($this->_gameResults->involved_companies as $publisher) { |
503 | 503 | if ($publisher['publisher'] === true) { |
504 | 504 | $company = Company::find($publisher['company']); |
@@ -509,7 +509,7 @@ discard block |
||
509 | 509 | |
510 | 510 | $genres = []; |
511 | 511 | |
512 | - if (! empty($this->_gameResults->themes)) { |
|
512 | + if (!empty($this->_gameResults->themes)) { |
|
513 | 513 | foreach ($this->_gameResults->themes as $theme) { |
514 | 514 | $genres[] = $theme['name']; |
515 | 515 | } |
@@ -531,7 +531,7 @@ discard block |
||
531 | 531 | 'esrb' => isset($this->_gameResults->aggregated_rating) ? round($this->_gameResults->aggregated_rating).'%' : 'Not Rated', |
532 | 532 | 'url' => $this->_gameResults->url ?? '', |
533 | 533 | 'backdropurl' => isset($this->_gameResults->screenshots) ? 'https:'.str_replace('t_thumb', 't_cover_big', $this->_gameResults->screenshots[0]['url']) : '', |
534 | - 'publisher' => ! empty($publishers) ? implode(',', $publishers) : 'Unknown', |
|
534 | + 'publisher' => !empty($publishers) ? implode(',', $publishers) : 'Unknown', |
|
535 | 535 | ]; |
536 | 536 | } else { |
537 | 537 | $this->colorCli->notice('IGDB returned no valid results'); |
@@ -565,20 +565,20 @@ discard block |
||
565 | 565 | } else { |
566 | 566 | $game['backdrop'] = 0; |
567 | 567 | } |
568 | - if (! isset($game['trailer'])) { |
|
568 | + if (!isset($game['trailer'])) { |
|
569 | 569 | $game['trailer'] = 0; |
570 | 570 | } |
571 | 571 | if (empty($game['title'])) { |
572 | 572 | $game['title'] = $gameInfo['title']; |
573 | 573 | } |
574 | - if (! isset($game['releasedate'])) { |
|
574 | + if (!isset($game['releasedate'])) { |
|
575 | 575 | $game['releasedate'] = ''; |
576 | 576 | } |
577 | 577 | |
578 | 578 | if ($game['releasedate'] === '') { |
579 | 579 | $game['releasedate'] = ''; |
580 | 580 | } |
581 | - if (! isset($game['review'])) { |
|
581 | + if (!isset($game['review'])) { |
|
582 | 582 | $game['review'] = 'No Review'; |
583 | 583 | } |
584 | 584 | $game['classused'] = $this->_classUsed; |
@@ -596,7 +596,7 @@ discard block |
||
596 | 596 | $game['gamesgenre'] = $genreName; |
597 | 597 | $game['gamesgenreID'] = $genreKey; |
598 | 598 | |
599 | - if (! empty($game['asin'])) { |
|
599 | + if (!empty($game['asin'])) { |
|
600 | 600 | $check = GamesInfo::query()->where('asin', $game['asin'])->first(); |
601 | 601 | if ($check === null) { |
602 | 602 | $gamesId = GamesInfo::query() |
@@ -641,7 +641,7 @@ discard block |
||
641 | 641 | } |
642 | 642 | } |
643 | 643 | |
644 | - if (! empty($gamesId)) { |
|
644 | + if (!empty($gamesId)) { |
|
645 | 645 | if ($this->echoOutput) { |
646 | 646 | $this->colorCli->header('Added/updated game: '). |
647 | 647 | $this->colorCli->alternateOver(' Title: '). |
@@ -660,7 +660,7 @@ discard block |
||
660 | 660 | $this->colorCli->primary($game['title'].' (PC)'); |
661 | 661 | } |
662 | 662 | |
663 | - return ! empty($gamesId) ? $gamesId : false; |
|
663 | + return !empty($gamesId) ? $gamesId : false; |
|
664 | 664 | } |
665 | 665 | |
666 | 666 | /** |
@@ -82,7 +82,7 @@ |
||
82 | 82 | return $movie; |
83 | 83 | } |
84 | 84 | $sql = self::query()->select('*'); |
85 | - if (! empty($search)) { |
|
85 | + if (!empty($search)) { |
|
86 | 86 | $sql->whereLike('title', '%'.$search.'%'); |
87 | 87 | } |
88 | 88 |
@@ -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 |