@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | { |
| 31 | 31 | $this->ensureIsNotRateLimited(); |
| 32 | 32 | |
| 33 | - if (! Auth::attempt($this->only(['email', 'password']), $this->remember)) { |
|
| 33 | + if (!Auth::attempt($this->only(['email', 'password']), $this->remember)) { |
|
| 34 | 34 | RateLimiter::hit($this->throttleKey()); |
| 35 | 35 | |
| 36 | 36 | throw ValidationException::withMessages([ |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | */ |
| 47 | 47 | protected function ensureIsNotRateLimited(): void |
| 48 | 48 | { |
| 49 | - if (! RateLimiter::tooManyAttempts($this->throttleKey(), 5)) { |
|
| 49 | + if (!RateLimiter::tooManyAttempts($this->throttleKey(), 5)) { |
|
| 50 | 50 | return; |
| 51 | 51 | } |
| 52 | 52 | |
@@ -74,7 +74,7 @@ |
||
| 74 | 74 | if ($user !== null) { |
| 75 | 75 | $rememberMe = $request->has('rememberme') && $request->input('rememberme') === 'on'; |
| 76 | 76 | |
| 77 | - if (! $user->isVerified() || $user->isPendingVerification()) { |
|
| 77 | + if (!$user->isVerified() || $user->isPendingVerification()) { |
|
| 78 | 78 | $request->session()->flash('message', 'You have not verified your email address!'); |
| 79 | 79 | |
| 80 | 80 | return redirect('login'); |
@@ -277,8 +277,8 @@ |
||
| 277 | 277 | |
| 278 | 278 | // Execute a Scroll request and repeat |
| 279 | 279 | $results = Elasticsearch::scroll([ |
| 280 | - 'scroll_id' => $scroll_id, //...using our previously obtained _scroll_id |
|
| 281 | - 'scroll' => '30s', // and the same timeout window |
|
| 280 | + 'scroll_id' => $scroll_id, //...using our previously obtained _scroll_id |
|
| 281 | + 'scroll' => '30s', // and the same timeout window |
|
| 282 | 282 | ] |
| 283 | 283 | ); |
| 284 | 284 | } |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | foreach ($releases->getBrowseOrdering() as $orderType) { |
| 66 | 66 | $this->smarty->assign( |
| 67 | 67 | 'orderby'.$orderType, |
| 68 | - url('/search?search='.htmlentities($searchString['searchname'], ENT_QUOTES | ENT_HTML5).'&t='.implode(',', $categoryID).'&ob='.$orderType)); |
|
| 68 | + url('/search?search='.htmlentities($searchString['searchname'], ENT_QUOTES|ENT_HTML5).'&t='.implode(',', $categoryID).'&ob='.$orderType)); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | $rslt = $releases->search( |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | if ($searchType !== 'basic' && $request->missing('id') && $request->missing('subject') && $request->anyFilled(['searchadvr', 'searchadvsubject', 'searchadvfilename', 'searchadvposter'])) { |
| 124 | 124 | $orderByString = ''; |
| 125 | 125 | foreach ($searchVars as $searchVarKey => $searchVar) { |
| 126 | - $orderByString .= "&$searchVarKey=".htmlentities($searchVar, ENT_QUOTES | ENT_HTML5); |
|
| 126 | + $orderByString .= "&$searchVarKey=".htmlentities($searchVar, ENT_QUOTES|ENT_HTML5); |
|
| 127 | 127 | } |
| 128 | 128 | $orderByString = ltrim($orderByString, '&'); |
| 129 | 129 | |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | switch ($action) { |
| 32 | 32 | case 'delete': |
| 33 | 33 | $show = UserSerie::getShow($this->userdata->id, $videoId); |
| 34 | - if (! $show) { |
|
| 34 | + if (!$show) { |
|
| 35 | 35 | return redirect()->back(); |
| 36 | 36 | } |
| 37 | 37 | |
@@ -51,12 +51,12 @@ discard block |
||
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | $show = Video::getByVideoID($videoId); |
| 54 | - if (! $show) { |
|
| 54 | + if (!$show) { |
|
| 55 | 55 | return redirect()->to('myshows'); |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | if ($action === 'doadd') { |
| 59 | - $category = ($request->has('category') && \is_array($request->input('category')) && ! empty($request->input('category'))) ? $request->input('category') : []; |
|
| 59 | + $category = ($request->has('category') && \is_array($request->input('category')) && !empty($request->input('category'))) ? $request->input('category') : []; |
|
| 60 | 60 | UserSerie::addShow($this->userdata->id, $videoId, $category); |
| 61 | 61 | if ($request->has('from')) { |
| 62 | 62 | return redirect()->to($request->input('from')); |
@@ -90,12 +90,12 @@ discard block |
||
| 90 | 90 | case 'doedit': |
| 91 | 91 | $show = UserSerie::getShow($this->userdata->id, $videoId); |
| 92 | 92 | |
| 93 | - if (! $show) { |
|
| 93 | + if (!$show) { |
|
| 94 | 94 | return redirect()->to('myshows'); |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | if ($action === 'doedit') { |
| 98 | - $category = ($request->has('category') && \is_array($request->input('category')) && ! empty($request->input('category'))) ? $request->input('category') : []; |
|
| 98 | + $category = ($request->has('category') && \is_array($request->input('category')) && !empty($request->input('category'))) ? $request->input('category') : []; |
|
| 99 | 99 | UserSerie::updateShow($this->userdata->id, $videoId, $category); |
| 100 | 100 | if ($request->has('from')) { |
| 101 | 101 | return redirect()->to($request->input('from')); |
@@ -140,9 +140,9 @@ discard block |
||
| 140 | 140 | $catArr = []; |
| 141 | 141 | foreach ($shows as $showk => $show) { |
| 142 | 142 | $showcats = explode('|', $show['categories']); |
| 143 | - if (\is_array($showcats) && ! empty($showcats)) { |
|
| 143 | + if (\is_array($showcats) && !empty($showcats)) { |
|
| 144 | 144 | foreach ($showcats as $scat) { |
| 145 | - if (! empty($scat)) { |
|
| 145 | + if (!empty($scat)) { |
|
| 146 | 146 | $catArr[] = $categories[$scat]; |
| 147 | 147 | } |
| 148 | 148 | } |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | $episodeArray[$i]['episode_no'] = (int) $episode->epno; |
| 133 | 133 | $episodeArray[$i]['airdate'] = (string) $episode->airdate; |
| 134 | 134 | |
| 135 | - if (! empty($episode->title)) { |
|
| 135 | + if (!empty($episode->title)) { |
|
| 136 | 136 | foreach ($episode->title as $title) { |
| 137 | 137 | $xmlAttribs = $title->attributes('xml', true); |
| 138 | 138 | // only english, x-jat imploded episode titles for now |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | 'updated' => now(), |
| 253 | 253 | ] |
| 254 | 254 | ); |
| 255 | - if (! empty($AniDBInfoArray['epsarr'])) { |
|
| 255 | + if (!empty($AniDBInfoArray['epsarr'])) { |
|
| 256 | 256 | $this->insertAniDBEpisodes($aniDbId, $AniDBInfoArray['epsarr']); |
| 257 | 257 | } |
| 258 | 258 | |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | |
| 262 | 262 | private function insertAniDBEpisodes($aniDbId, array $episodeArr = []): void |
| 263 | 263 | { |
| 264 | - if (! empty($episodeArr)) { |
|
| 264 | + if (!empty($episodeArr)) { |
|
| 265 | 265 | foreach ($episodeArr as $episode) { |
| 266 | 266 | AnidbEpisode::insertOrIgnore( |
| 267 | 267 | [ |
@@ -420,7 +420,7 @@ discard block |
||
| 420 | 420 | 'updated' => now(), |
| 421 | 421 | ] |
| 422 | 422 | ); |
| 423 | - if (! empty($AniDBInfoArray['epsarr'])) { |
|
| 423 | + if (!empty($AniDBInfoArray['epsarr'])) { |
|
| 424 | 424 | $this->insertAniDBEpisodes($aniDbId, $AniDBInfoArray['epsarr']); |
| 425 | 425 | } |
| 426 | 426 | |
@@ -437,7 +437,7 @@ discard block |
||
| 437 | 437 | $picture = $this->updateAniDBInfoEps($aniDbId, $AniDBInfoArray); |
| 438 | 438 | } |
| 439 | 439 | |
| 440 | - if (! empty($picture) && ! file_exists($this->imgSavePath.$aniDbId.'.jpg')) { |
|
| 440 | + if (!empty($picture) && !file_exists($this->imgSavePath.$aniDbId.'.jpg')) { |
|
| 441 | 441 | (new ReleaseImage())->saveImage( |
| 442 | 442 | $aniDbId, |
| 443 | 443 | 'http://img7.anidb.net/pics/anime/'.$picture, |
@@ -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(); |
@@ -654,13 +654,13 @@ discard block |
||
| 654 | 654 | ($airDate !== '' ? sprintf('AND DATE(tve.firstaired) = %s', escapeString($airDate)) : '') |
| 655 | 655 | ); |
| 656 | 656 | $show = self::fromQuery($showQry); |
| 657 | - if (! empty($show[0]) && $show->isNotEmpty()) { |
|
| 658 | - if ((! empty($series) || ! empty($episode) || ! empty($airDate)) && $show[0]->episodes !== '') { |
|
| 657 | + if (!empty($show[0]) && $show->isNotEmpty()) { |
|
| 658 | + if ((!empty($series) || !empty($episode) || !empty($airDate)) && $show[0]->episodes !== '') { |
|
| 659 | 659 | $showSql = sprintf('AND r.tv_episodes_id IN (%s)', $show[0]->episodes); |
| 660 | 660 | } elseif ((int) $show[0]->video > 0) { |
| 661 | 661 | $showSql = 'AND r.videos_id = '.$show[0]->video; |
| 662 | 662 | // If $series is set but episode is not, return Season Packs only |
| 663 | - if (! empty($series) && empty($episode)) { |
|
| 663 | + if (!empty($series) && empty($episode)) { |
|
| 664 | 664 | $showSql .= ' AND r.tv_episodes_id = 0'; |
| 665 | 665 | } |
| 666 | 666 | } else { |
@@ -673,22 +673,22 @@ discard block |
||
| 673 | 673 | } |
| 674 | 674 | } |
| 675 | 675 | // If $name is set it is a fallback search, add available SxxExx/airdate info to the query |
| 676 | - if (! empty($name) && $showSql === '') { |
|
| 677 | - if (! empty($series) && (int) $series < 1900) { |
|
| 676 | + if (!empty($name) && $showSql === '') { |
|
| 677 | + if (!empty($series) && (int) $series < 1900) { |
|
| 678 | 678 | $name .= sprintf(' S%s', str_pad($series, 2, '0', STR_PAD_LEFT)); |
| 679 | - if (! empty($episode) && ! str_contains($episode, '/')) { |
|
| 679 | + if (!empty($episode) && !str_contains($episode, '/')) { |
|
| 680 | 680 | $name .= sprintf('E%s', str_pad($episode, 2, '0', STR_PAD_LEFT)); |
| 681 | 681 | } |
| 682 | - } elseif (! empty($airDate)) { |
|
| 682 | + } elseif (!empty($airDate)) { |
|
| 683 | 683 | $name .= sprintf(' %s', str_replace(['/', '-', '.', '_'], ' ', $airDate)); |
| 684 | 684 | } |
| 685 | 685 | } |
| 686 | - if (! empty($name)) { |
|
| 686 | + if (!empty($name)) { |
|
| 687 | 687 | if (config('nntmux.elasticsearch_enabled') === true) { |
| 688 | 688 | $searchResult = $this->elasticSearch->indexSearchTMA($name, $limit); |
| 689 | 689 | } else { |
| 690 | 690 | $searchResult = $this->manticoreSearch->searchIndexes('releases_rt', $name, ['searchname']); |
| 691 | - if (! empty($searchResult)) { |
|
| 691 | + if (!empty($searchResult)) { |
|
| 692 | 692 | $searchResult = Arr::wrap(Arr::get($searchResult, 'id')); |
| 693 | 693 | } |
| 694 | 694 | } |
@@ -704,11 +704,11 @@ discard block |
||
| 704 | 704 | NZB::NZB_ADDED, |
| 705 | 705 | $this->showPasswords(), |
| 706 | 706 | $showSql, |
| 707 | - (! empty($name) && ! empty($searchResult)) ? 'AND r.id IN ('.implode(',', $searchResult).')' : '', |
|
| 707 | + (!empty($name) && !empty($searchResult)) ? 'AND r.id IN ('.implode(',', $searchResult).')' : '', |
|
| 708 | 708 | Category::getCategorySearch($cat), |
| 709 | 709 | $maxAge > 0 ? sprintf('AND r.postdate > NOW() - INTERVAL %d DAY', $maxAge) : '', |
| 710 | 710 | $minSize > 0 ? sprintf('AND r.size >= %d', $minSize) : '', |
| 711 | - ! empty($excludedCategories) ? sprintf('AND r.categories_id NOT IN('.implode(',', $excludedCategories).')') : '' |
|
| 711 | + !empty($excludedCategories) ? sprintf('AND r.categories_id NOT IN('.implode(',', $excludedCategories).')') : '' |
|
| 712 | 712 | ); |
| 713 | 713 | $baseSql = sprintf( |
| 714 | 714 | "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, |
@@ -744,7 +744,7 @@ discard block |
||
| 744 | 744 | if ($releases !== null) { |
| 745 | 745 | return $releases; |
| 746 | 746 | } |
| 747 | - $releases = ((! empty($name) && ! empty($searchResult)) || empty($name)) ? self::fromQuery($sql) : []; |
|
| 747 | + $releases = ((!empty($name) && !empty($searchResult)) || empty($name)) ? self::fromQuery($sql) : []; |
|
| 748 | 748 | if (count($releases) !== 0 && $releases->isNotEmpty()) { |
| 749 | 749 | $releases[0]->_totalrows = $this->getPagerCount( |
| 750 | 750 | preg_replace('#LEFT(\s+OUTER)?\s+JOIN\s+(?!tv_episodes)\s+.*ON.*=.*\n#i', ' ', $baseSql) |
@@ -790,12 +790,12 @@ discard block |
||
| 790 | 790 | ); |
| 791 | 791 | $show = self::fromQuery($showQry); |
| 792 | 792 | if ($show->isNotEmpty()) { |
| 793 | - if ((! empty($series) || ! empty($episode) || ! empty($airDate)) && $show[0]->episodes !== '') { |
|
| 793 | + if ((!empty($series) || !empty($episode) || !empty($airDate)) && $show[0]->episodes !== '') { |
|
| 794 | 794 | $showSql = sprintf('AND r.tv_episodes_id IN (%s)', $show[0]->episodes); |
| 795 | 795 | } elseif ((int) $show[0]->video > 0) { |
| 796 | 796 | $showSql = 'AND r.videos_id = '.$show[0]->video; |
| 797 | 797 | // If $series is set but episode is not, return Season Packs only |
| 798 | - if (! empty($series) && empty($episode)) { |
|
| 798 | + if (!empty($series) && empty($episode)) { |
|
| 799 | 799 | $showSql .= ' AND r.tv_episodes_id = 0'; |
| 800 | 800 | } |
| 801 | 801 | } else { |
@@ -808,22 +808,22 @@ discard block |
||
| 808 | 808 | } |
| 809 | 809 | } |
| 810 | 810 | // If $name is set it is a fallback search, add available SxxExx/airdate info to the query |
| 811 | - if (! empty($name) && $showSql === '') { |
|
| 812 | - if (! empty($series) && (int) $series < 1900) { |
|
| 811 | + if (!empty($name) && $showSql === '') { |
|
| 812 | + if (!empty($series) && (int) $series < 1900) { |
|
| 813 | 813 | $name .= sprintf(' S%s', str_pad($series, 2, '0', STR_PAD_LEFT)); |
| 814 | - if (! empty($episode) && ! str_contains($episode, '/')) { |
|
| 814 | + if (!empty($episode) && !str_contains($episode, '/')) { |
|
| 815 | 815 | $name .= sprintf('E%s', str_pad($episode, 2, '0', STR_PAD_LEFT)); |
| 816 | 816 | } |
| 817 | - } elseif (! empty($airDate)) { |
|
| 817 | + } elseif (!empty($airDate)) { |
|
| 818 | 818 | $name .= sprintf(' %s', str_replace(['/', '-', '.', '_'], ' ', $airDate)); |
| 819 | 819 | } |
| 820 | 820 | } |
| 821 | - if (! empty($name)) { |
|
| 821 | + if (!empty($name)) { |
|
| 822 | 822 | if (config('nntmux.elasticsearch_enabled') === true) { |
| 823 | 823 | $searchResult = $this->elasticSearch->indexSearchTMA($name, $limit); |
| 824 | 824 | } else { |
| 825 | 825 | $searchResult = $this->manticoreSearch->searchIndexes('releases_rt', $name, ['searchname']); |
| 826 | - if (! empty($searchResult)) { |
|
| 826 | + if (!empty($searchResult)) { |
|
| 827 | 827 | $searchResult = Arr::wrap(Arr::get($searchResult, 'id')); |
| 828 | 828 | } |
| 829 | 829 | } |
@@ -839,11 +839,11 @@ discard block |
||
| 839 | 839 | NZB::NZB_ADDED, |
| 840 | 840 | $this->showPasswords(), |
| 841 | 841 | $showSql, |
| 842 | - (! empty($searchResult) ? 'AND r.id IN ('.implode(',', $searchResult).')' : ''), |
|
| 842 | + (!empty($searchResult) ? 'AND r.id IN ('.implode(',', $searchResult).')' : ''), |
|
| 843 | 843 | Category::getCategorySearch($cat), |
| 844 | 844 | ($maxAge > 0 ? sprintf('AND r.postdate > NOW() - INTERVAL %d DAY', $maxAge) : ''), |
| 845 | 845 | ($minSize > 0 ? sprintf('AND r.size >= %d', $minSize) : ''), |
| 846 | - ! empty($excludedCategories) ? sprintf('AND r.categories_id NOT IN('.implode(',', $excludedCategories).')') : '' |
|
| 846 | + !empty($excludedCategories) ? sprintf('AND r.categories_id NOT IN('.implode(',', $excludedCategories).')') : '' |
|
| 847 | 847 | ); |
| 848 | 848 | $baseSql = sprintf( |
| 849 | 849 | "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, |
@@ -893,12 +893,12 @@ discard block |
||
| 893 | 893 | */ |
| 894 | 894 | public function animeSearch($aniDbID, int $offset = 0, int $limit = 100, string $name = '', array $cat = [-1], int $maxAge = -1, array $excludedCategories = []): mixed |
| 895 | 895 | { |
| 896 | - if (! empty($name)) { |
|
| 896 | + if (!empty($name)) { |
|
| 897 | 897 | if (config('nntmux.elasticsearch_enabled') === true) { |
| 898 | 898 | $searchResult = $this->elasticSearch->indexSearchTMA($name, $limit); |
| 899 | 899 | } else { |
| 900 | 900 | $searchResult = $this->manticoreSearch->searchIndexes('releases_rt', $name, ['searchname']); |
| 901 | - if (! empty($searchResult)) { |
|
| 901 | + if (!empty($searchResult)) { |
|
| 902 | 902 | $searchResult = Arr::wrap(Arr::get($searchResult, 'id')); |
| 903 | 903 | } |
| 904 | 904 | } |
@@ -915,8 +915,8 @@ discard block |
||
| 915 | 915 | $this->showPasswords(), |
| 916 | 916 | NZB::NZB_ADDED, |
| 917 | 917 | ($aniDbID > -1 ? sprintf(' AND r.anidbid = %d ', $aniDbID) : ''), |
| 918 | - (! empty($searchResult) ? 'AND r.id IN ('.implode(',', $searchResult).')' : ''), |
|
| 919 | - ! empty($excludedCategories) ? sprintf('AND r.categories_id NOT IN('.implode(',', $excludedCategories).')') : '', |
|
| 918 | + (!empty($searchResult) ? 'AND r.id IN ('.implode(',', $searchResult).')' : ''), |
|
| 919 | + !empty($excludedCategories) ? sprintf('AND r.categories_id NOT IN('.implode(',', $excludedCategories).')') : '', |
|
| 920 | 920 | Category::getCategorySearch($cat), |
| 921 | 921 | ($maxAge > 0 ? sprintf(' AND r.postdate > NOW() - INTERVAL %d DAY ', $maxAge) : '') |
| 922 | 922 | ); |
@@ -963,12 +963,12 @@ discard block |
||
| 963 | 963 | */ |
| 964 | 964 | 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 |
| 965 | 965 | { |
| 966 | - if (! empty($name)) { |
|
| 966 | + if (!empty($name)) { |
|
| 967 | 967 | if (config('nntmux.elasticsearch_enabled') === true) { |
| 968 | 968 | $searchResult = $this->elasticSearch->indexSearchTMA($name, $limit); |
| 969 | 969 | } else { |
| 970 | 970 | $searchResult = $this->manticoreSearch->searchIndexes('releases_rt', $name, ['searchname']); |
| 971 | - if (! empty($searchResult)) { |
|
| 971 | + if (!empty($searchResult)) { |
|
| 972 | 972 | $searchResult = Arr::wrap(Arr::get($searchResult, 'id')); |
| 973 | 973 | } |
| 974 | 974 | } |
@@ -985,11 +985,11 @@ discard block |
||
| 985 | 985 | %s %s %s %s %s %s %s', |
| 986 | 986 | NZB::NZB_ADDED, |
| 987 | 987 | $this->showPasswords(), |
| 988 | - (! empty($searchResult) ? 'AND r.id IN ('.implode(',', $searchResult).')' : ''), |
|
| 988 | + (!empty($searchResult) ? 'AND r.id IN ('.implode(',', $searchResult).')' : ''), |
|
| 989 | 989 | ($imDbId !== -1 && is_numeric($imDbId)) ? sprintf(' AND m.imdbid = \'%s\' ', $imDbId) : '', |
| 990 | 990 | ($tmDbId !== -1 && is_numeric($tmDbId)) ? sprintf(' AND m.tmdbid = %d ', $tmDbId) : '', |
| 991 | 991 | ($traktId !== -1 && is_numeric($traktId)) ? sprintf(' AND m.traktid = %d ', $traktId) : '', |
| 992 | - ! empty($excludedCategories) ? sprintf('AND r.categories_id NOT IN('.implode(',', $excludedCategories).')') : '', |
|
| 992 | + !empty($excludedCategories) ? sprintf('AND r.categories_id NOT IN('.implode(',', $excludedCategories).')') : '', |
|
| 993 | 993 | Category::getCategorySearch($cat), |
| 994 | 994 | $maxAge > 0 ? sprintf(' AND r.postdate > NOW() - INTERVAL %d DAY ', $maxAge) : '', |
| 995 | 995 | $minSize > 0 ? sprintf('AND r.size >= %d', $minSize) : '' |
@@ -1041,7 +1041,7 @@ discard block |
||
| 1041 | 1041 | $parentCat = $catRow['root_categories_id']; |
| 1042 | 1042 | |
| 1043 | 1043 | $results = $this->search(['searchname' => getSimilarName($name)], -1, '', '', -1, -1, 0, config('nntmux.items_per_page'), '', -1, $excludedCats, 'basic', [$parentCat]); |
| 1044 | - if (! $results) { |
|
| 1044 | + if (!$results) { |
|
| 1045 | 1045 | return $ret; |
| 1046 | 1046 | } |
| 1047 | 1047 | |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | if ((int) $videoId > 0 && (int) $tvDbId > 0) { |
| 132 | - if (! empty($tvdbShow['poster'])) { // Use TVDB poster if available |
|
| 132 | + if (!empty($tvdbShow['poster'])) { // Use TVDB poster if available |
|
| 133 | 133 | $this->getPoster($videoId); |
| 134 | 134 | } else { // Check Fanart.tv for poster |
| 135 | 135 | $poster = $this->fanart->getTVFanArt($tvDbId); |
@@ -139,8 +139,8 @@ discard block |
||
| 139 | 139 | } |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | - $seasonNo = (! empty($release['season']) ? preg_replace('/^S0*/i', '', $release['season']) : ''); |
|
| 143 | - $episodeNo = (! empty($release['episode']) ? preg_replace('/^E0*/i', '', $release['episode']) : ''); |
|
| 142 | + $seasonNo = (!empty($release['season']) ? preg_replace('/^S0*/i', '', $release['season']) : ''); |
|
| 143 | + $episodeNo = (!empty($release['episode']) ? preg_replace('/^E0*/i', '', $release['episode']) : ''); |
|
| 144 | 144 | |
| 145 | 145 | if ($episodeNo === 'all') { |
| 146 | 146 | // Set the video ID and leave episode 0 |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | // Download all episodes if new show to reduce API/bandwidth usage |
| 154 | - if (! $this->countEpsByVideoID($videoId)) { |
|
| 154 | + if (!$this->countEpsByVideoID($videoId)) { |
|
| 155 | 155 | $this->getEpisodeInfo($tvDbId, -1, -1, $videoId); |
| 156 | 156 | } |
| 157 | 157 | |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | // Check for show aliases and try match those too |
| 254 | - if (! empty($show->aliases)) { |
|
| 254 | + if (!empty($show->aliases)) { |
|
| 255 | 255 | foreach ($show->aliases as $key => $name) { |
| 256 | 256 | $matchPercent = $this->checkMatch(strtolower($name), strtolower($name), $matchPercent); |
| 257 | 257 | if ($matchPercent > $highestMatch) { |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | } |
| 263 | 263 | } |
| 264 | 264 | } |
| 265 | - if (! empty($highest)) { |
|
| 265 | + if (!empty($highest)) { |
|
| 266 | 266 | $return = $this->formatShowInfo($highest); |
| 267 | 267 | } |
| 268 | 268 | } |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | { |
| 299 | 299 | $return = $response = false; |
| 300 | 300 | |
| 301 | - if (! $this->local) { |
|
| 301 | + if (!$this->local) { |
|
| 302 | 302 | if ($videoId > 0) { |
| 303 | 303 | try { |
| 304 | 304 | $response = $this->client->series()->allEpisodes($tvDbId); |
@@ -356,7 +356,7 @@ discard block |
||
| 356 | 356 | $poster = $this->client->series()->artworks($show->tvdb_id); |
| 357 | 357 | // Grab the image with the highest score where type == 2 |
| 358 | 358 | $poster = collect($poster)->where('type', 2)->sortByDesc('score')->first(); |
| 359 | - $this->posterUrl = ! empty($poster->image) ? $poster->image : ''; |
|
| 359 | + $this->posterUrl = !empty($poster->image) ? $poster->image : ''; |
|
| 360 | 360 | } catch (ResourceNotFoundException $e) { |
| 361 | 361 | $this->colorCli->climate()->error('Poster image not found on TVDB'); |
| 362 | 362 | } catch (UnauthorizedException $error) { |
@@ -396,7 +396,7 @@ discard block |
||
| 396 | 396 | 'tvrage' => 0, |
| 397 | 397 | 'tvmaze' => 0, |
| 398 | 398 | 'tmdb' => 0, |
| 399 | - 'aliases' => ! empty($show->aliases) ? $show->aliases : '', |
|
| 399 | + 'aliases' => !empty($show->aliases) ? $show->aliases : '', |
|
| 400 | 400 | 'localzone' => "''", |
| 401 | 401 | ]; |
| 402 | 402 | } |