@@ -196,7 +196,7 @@ |
||
196 | 196 | return $predb; |
197 | 197 | } |
198 | 198 | $sql = self::query()->leftJoin('releases', 'releases.predb_id', '=', 'predb.id')->orderByDesc('predb.predate'); |
199 | - if (! empty($search)) { |
|
199 | + if (!empty($search)) { |
|
200 | 200 | if (config('nntmux.elasticsearch_enabled') === true) { |
201 | 201 | $ids = (new ElasticSearchSiteSearch)->predbIndexSearch($search); |
202 | 202 | } else { |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | $manticore->truncateRTIndex(Arr::wrap('releases_rt')); |
65 | 65 | $data = []; |
66 | 66 | $total = Release::count(); |
67 | - if (! $total) { |
|
67 | + if (!$total) { |
|
68 | 68 | $this->warn('Releases table is empty. Nothing to do.'); |
69 | 69 | exit(); |
70 | 70 | } |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | ->select(['releases.id', 'releases.name', 'releases.searchname', 'releases.fromname', 'releases.categories_id']) |
85 | 85 | ->selectRaw('IFNULL(GROUP_CONCAT(release_files.name SEPARATOR " "),"") filename') |
86 | 86 | ->groupBy('id') |
87 | - ->chunk($max, function ($releases) use ($manticore, $bar, $data) { |
|
87 | + ->chunk($max, function($releases) use ($manticore, $bar, $data) { |
|
88 | 88 | foreach ($releases as $r) { |
89 | 89 | $data[] = [ |
90 | 90 | 'id' => $r->id, |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | $data = []; |
113 | 113 | |
114 | 114 | $total = Predb::count(); |
115 | - if (! $total) { |
|
115 | + if (!$total) { |
|
116 | 116 | $this->warn('PreDB table is empty. Nothing to do.'); |
117 | 117 | exit(); |
118 | 118 | } |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | ->select(['id', 'title', 'filename', 'source']) |
130 | 130 | ->groupBy('id') |
131 | 131 | ->orderBy('id') |
132 | - ->chunk($max, function ($pre) use ($manticore, $bar, $data) { |
|
132 | + ->chunk($max, function($pre) use ($manticore, $bar, $data) { |
|
133 | 133 | foreach ($pre as $p) { |
134 | 134 | $data[] = [ |
135 | 135 | 'id' => $p->id, |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | $data = ['body' => []]; |
152 | 152 | $elastic = new ElasticSearchSiteSearch; |
153 | 153 | $total = Release::count(); |
154 | - if (! $total) { |
|
154 | + if (!$total) { |
|
155 | 155 | $this->warn('Could not get database information for releases table.'); |
156 | 156 | exit(); |
157 | 157 | } |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | ->select(['releases.id', 'releases.name', 'releases.searchname', 'releases.fromname', 'releases.categories_id', 'releases.postdate']) |
170 | 170 | ->selectRaw('IFNULL(GROUP_CONCAT(release_files.name SEPARATOR " "),"") filename') |
171 | 171 | ->groupBy('id') |
172 | - ->chunk($max, function ($releases) use ($bar, $data) { |
|
172 | + ->chunk($max, function($releases) use ($bar, $data) { |
|
173 | 173 | foreach ($releases as $r) { |
174 | 174 | $searchName = str_replace(['.', '-'], ' ', $r->searchname); |
175 | 175 | $data['body'][] = [ |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | $data = ['body' => []]; |
203 | 203 | $elastic = new ElasticSearchSiteSearch; |
204 | 204 | $total = Predb::count(); |
205 | - if (! $total) { |
|
205 | + if (!$total) { |
|
206 | 206 | $this->warn('Could not get database information for predb table.'); |
207 | 207 | exit(); |
208 | 208 | } |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | ->select(['id', 'title', 'filename', 'source']) |
220 | 220 | ->groupBy('id') |
221 | 221 | ->orderBy('id') |
222 | - ->chunk($max, function ($pre) use ($bar, $data) { |
|
222 | + ->chunk($max, function($pre) use ($bar, $data) { |
|
223 | 223 | foreach ($pre as $p) { |
224 | 224 | $data['body'][] = [ |
225 | 225 | 'index' => [ |
@@ -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 | } |
@@ -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 |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | ($start === 0 ? ' LIMIT '.$num : ' LIMIT '.$num.' OFFSET '.$start) |
90 | 90 | ); |
91 | 91 | |
92 | - return Cache::flexible(md5($qry.$page), [config('nntmux.cache_expiry_medium'), config('nntmux.cache_expiry_long')], function () use ($qry, $cat, $maxAge, $excludedCats, $groupName) { |
|
92 | + return Cache::flexible(md5($qry.$page), [config('nntmux.cache_expiry_medium'), config('nntmux.cache_expiry_long')], function() use ($qry, $cat, $maxAge, $excludedCats, $groupName) { |
|
93 | 93 | $sql = self::fromQuery($qry); |
94 | 94 | if (\count($sql) > 0) { |
95 | 95 | $possibleRows = $this->getBrowseCount($cat, $maxAge, $excludedCats, $groupName); |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | GROUP BY r.id |
266 | 266 | ORDER BY %s %s %s", |
267 | 267 | $this->uSQL($userShows, 'videos_id'), |
268 | - (! empty($excludedCats) ? ' AND r.categories_id NOT IN ('.implode(',', $excludedCats).')' : ''), |
|
268 | + (!empty($excludedCats) ? ' AND r.categories_id NOT IN ('.implode(',', $excludedCats).')' : ''), |
|
269 | 269 | NZB::NZB_ADDED, |
270 | 270 | Category::TV_ROOT, |
271 | 271 | Category::TV_OTHER, |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | ($offset === false ? '' : (' LIMIT '.$limit.' OFFSET '.$offset)) |
277 | 277 | ); |
278 | 278 | |
279 | - return Cache::flexible(md5($sql), [config('nntmux.cache_expiry_medium'), config('nntmux.cache_expiry_long')], function () use ($sql) { |
|
279 | + return Cache::flexible(md5($sql), [config('nntmux.cache_expiry_medium'), config('nntmux.cache_expiry_long')], function() use ($sql) { |
|
280 | 280 | return self::fromQuery($sql); |
281 | 281 | }); |
282 | 282 | } |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | { |
331 | 331 | // Delete NZB from disk. |
332 | 332 | $nzbPath = $nzb->NZBPath($identifiers['g']); |
333 | - if (! empty($nzbPath)) { |
|
333 | + if (!empty($nzbPath)) { |
|
334 | 334 | File::delete($nzbPath); |
335 | 335 | } |
336 | 336 | |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | */ |
371 | 371 | public function updateMulti($guids, $category, $grabs, $videoId, $episodeId, $anidbId, $imdbId) |
372 | 372 | { |
373 | - if (! \is_array($guids) || \count($guids) < 1) { |
|
373 | + if (!\is_array($guids) || \count($guids) < 1) { |
|
374 | 374 | return false; |
375 | 375 | } |
376 | 376 | |
@@ -394,7 +394,7 @@ discard block |
||
394 | 394 | $sql = '(1=2 '; |
395 | 395 | foreach ($userQuery as $query) { |
396 | 396 | $sql .= sprintf('OR (r.%s = %d', $type, $query->$type); |
397 | - if (! empty($query->categories)) { |
|
397 | + if (!empty($query->categories)) { |
|
398 | 398 | $catsArr = explode('|', $query->categories); |
399 | 399 | if (\count($catsArr) > 1) { |
400 | 400 | $sql .= sprintf(' AND r.categories_id IN (%s)', implode(',', $catsArr)); |
@@ -435,7 +435,7 @@ discard block |
||
435 | 435 | $orderBy = $this->getBrowseOrder($orderBy); |
436 | 436 | } |
437 | 437 | |
438 | - $searchFields = Arr::where($searchArr, static function ($value) { |
|
438 | + $searchFields = Arr::where($searchArr, static function($value) { |
|
439 | 439 | return $value !== -1; |
440 | 440 | }); |
441 | 441 | |
@@ -445,7 +445,7 @@ discard block |
||
445 | 445 | $searchResult = $this->elasticSearch->indexSearch($phrases, $limit); |
446 | 446 | } else { |
447 | 447 | $searchResult = $this->manticoreSearch->searchIndexes('releases_rt', '', [], $searchFields); |
448 | - if (! empty($searchResult)) { |
|
448 | + if (!empty($searchResult)) { |
|
449 | 449 | $searchResult = Arr::wrap(Arr::get($searchResult, 'id')); |
450 | 450 | } |
451 | 451 | } |
@@ -510,7 +510,7 @@ discard block |
||
510 | 510 | $offset |
511 | 511 | ); |
512 | 512 | |
513 | - return Cache::flexible(md5($sql), [config('nntmux.cache_expiry_medium'), config('nntmux.cache_expiry_long')], function () use ($sql, $baseSql) { |
|
513 | + return Cache::flexible(md5($sql), [config('nntmux.cache_expiry_medium'), config('nntmux.cache_expiry_long')], function() use ($sql, $baseSql) { |
|
514 | 514 | $releases = self::fromQuery($sql); |
515 | 515 | if ($releases->isNotEmpty()) { |
516 | 516 | $releases[0]->_totalrows = $this->getPagerCount($baseSql); |
@@ -527,7 +527,7 @@ discard block |
||
527 | 527 | $searchResult = $this->elasticSearch->indexSearchApi($searchName, $limit); |
528 | 528 | } else { |
529 | 529 | $searchResult = $this->manticoreSearch->searchIndexes('releases_rt', $searchName, ['searchname']); |
530 | - if (! empty($searchResult)) { |
|
530 | + if (!empty($searchResult)) { |
|
531 | 531 | $searchResult = Arr::wrap(Arr::get($searchResult, 'id')); |
532 | 532 | } |
533 | 533 | } |
@@ -543,7 +543,7 @@ discard block |
||
543 | 543 | ((int) $groupName !== -1 ? sprintf(' AND r.groups_id = %d ', UsenetGroup::getIDByName($groupName)) : ''), |
544 | 544 | $catQuery, |
545 | 545 | (\count($excludedCats) > 0 ? ' AND r.categories_id NOT IN ('.implode(',', $excludedCats).')' : ''), |
546 | - (! empty($searchResult) ? 'AND r.id IN ('.implode(',', $searchResult).')' : ''), |
|
546 | + (!empty($searchResult) ? 'AND r.id IN ('.implode(',', $searchResult).')' : ''), |
|
547 | 547 | ($minSize > 0 ? sprintf('AND r.size >= %d', $minSize) : '') |
548 | 548 | ); |
549 | 549 | $baseSql = sprintf( |
@@ -574,8 +574,8 @@ discard block |
||
574 | 574 | $offset |
575 | 575 | ); |
576 | 576 | |
577 | - return Cache::flexible(md5($sql), [config('nntmux.cache_expiry_medium'), config('nntmux.cache_expiry_long')], function () use ($sql, $baseSql, $searchName, $searchResult) { |
|
578 | - if ($searchName !== -1 && ! empty($searchResult)) { |
|
577 | + return Cache::flexible(md5($sql), [config('nntmux.cache_expiry_medium'), config('nntmux.cache_expiry_long')], function() use ($sql, $baseSql, $searchName, $searchResult) { |
|
578 | + if ($searchName !== -1 && !empty($searchResult)) { |
|
579 | 579 | $releases = self::fromQuery($sql); |
580 | 580 | } elseif ($searchName !== -1 && empty($searchResult)) { |
581 | 581 | $releases = collect(); |
@@ -626,11 +626,11 @@ discard block |
||
626 | 626 | $show = self::fromQuery($showQry); |
627 | 627 | |
628 | 628 | if ($show->isNotEmpty()) { |
629 | - if ((! empty($episode) && ! empty($series)) && $show[0]->episodes !== '') { |
|
629 | + if ((!empty($episode) && !empty($series)) && $show[0]->episodes !== '') { |
|
630 | 630 | $showSql .= ' AND r.tv_episodes_id IN ('.$show[0]->episodes.') AND tve.series = '.$series; |
631 | - } elseif (! empty($episode) && $show[0]->episodes !== '') { |
|
631 | + } elseif (!empty($episode) && $show[0]->episodes !== '') { |
|
632 | 632 | $showSql = sprintf('AND r.tv_episodes_id IN (%s)', $show[0]->episodes); |
633 | - } elseif (! empty($series) && empty($episode)) { |
|
633 | + } elseif (!empty($series) && empty($episode)) { |
|
634 | 634 | // If $series is set but episode is not, return Season Packs and Episodes |
635 | 635 | $showSql .= ' AND r.tv_episodes_id IN ('.$show[0]->episodes.') AND tve.series = '.$series; |
636 | 636 | } |
@@ -644,26 +644,26 @@ discard block |
||
644 | 644 | } |
645 | 645 | |
646 | 646 | // If $name is set it is a fallback search, add available SxxExx/airdate info to the query |
647 | - if (! empty($name) && $showSql === '') { |
|
648 | - if (! empty($series) && (int) $series < 1900) { |
|
647 | + if (!empty($name) && $showSql === '') { |
|
648 | + if (!empty($series) && (int) $series < 1900) { |
|
649 | 649 | $name .= sprintf(' S%s', str_pad($series, 2, '0', STR_PAD_LEFT)); |
650 | - if (! empty($episode) && ! str_contains($episode, '/')) { |
|
650 | + if (!empty($episode) && !str_contains($episode, '/')) { |
|
651 | 651 | $name .= sprintf('E%s', str_pad($episode, 2, '0', STR_PAD_LEFT)); |
652 | 652 | } |
653 | 653 | // If season is not empty but episode is, add a wildcard to the search |
654 | 654 | if (empty($episode)) { |
655 | 655 | $name .= '*'; |
656 | 656 | } |
657 | - } elseif (! empty($airDate)) { |
|
657 | + } elseif (!empty($airDate)) { |
|
658 | 658 | $name .= sprintf(' %s', str_replace(['/', '-', '.', '_'], ' ', $airDate)); |
659 | 659 | } |
660 | 660 | } |
661 | - if (! empty($name)) { |
|
661 | + if (!empty($name)) { |
|
662 | 662 | if (config('nntmux.elasticsearch_enabled') === true) { |
663 | 663 | $searchResult = $this->elasticSearch->indexSearchTMA($name, $limit); |
664 | 664 | } else { |
665 | 665 | $searchResult = $this->manticoreSearch->searchIndexes('releases_rt', $name, ['searchname']); |
666 | - if (! empty($searchResult)) { |
|
666 | + if (!empty($searchResult)) { |
|
667 | 667 | $searchResult = Arr::wrap(Arr::get($searchResult, 'id')); |
668 | 668 | } |
669 | 669 | } |
@@ -679,11 +679,11 @@ discard block |
||
679 | 679 | NZB::NZB_ADDED, |
680 | 680 | $this->showPasswords(), |
681 | 681 | $showSql, |
682 | - (! empty($name) && ! empty($searchResult)) ? 'AND r.id IN ('.implode(',', $searchResult).')' : '', |
|
682 | + (!empty($name) && !empty($searchResult)) ? 'AND r.id IN ('.implode(',', $searchResult).')' : '', |
|
683 | 683 | Category::getCategorySearch($cat), |
684 | 684 | $maxAge > 0 ? sprintf('AND r.postdate > NOW() - INTERVAL %d DAY', $maxAge) : '', |
685 | 685 | $minSize > 0 ? sprintf('AND r.size >= %d', $minSize) : '', |
686 | - ! empty($excludedCategories) ? sprintf('AND r.categories_id NOT IN('.implode(',', $excludedCategories).')') : '' |
|
686 | + !empty($excludedCategories) ? sprintf('AND r.categories_id NOT IN('.implode(',', $excludedCategories).')') : '' |
|
687 | 687 | ); |
688 | 688 | $baseSql = sprintf( |
689 | 689 | "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, |
@@ -716,8 +716,8 @@ discard block |
||
716 | 716 | $offset |
717 | 717 | ); |
718 | 718 | |
719 | - return Cache::flexible(md5($sql), [config('nntmux.cache_expiry_medium'), config('nntmux.cache_expiry_long')], function () use ($sql, $baseSql, $name, $searchResult) { |
|
720 | - $releases = ((! empty($name) && ! empty($searchResult)) || empty($name)) ? self::fromQuery($sql) : []; |
|
719 | + return Cache::flexible(md5($sql), [config('nntmux.cache_expiry_medium'), config('nntmux.cache_expiry_long')], function() use ($sql, $baseSql, $name, $searchResult) { |
|
720 | + $releases = ((!empty($name) && !empty($searchResult)) || empty($name)) ? self::fromQuery($sql) : []; |
|
721 | 721 | if (count($releases) !== 0 && $releases->isNotEmpty()) { |
722 | 722 | $releases[0]->_totalrows = $this->getPagerCount( |
723 | 723 | preg_replace('#LEFT(\s+OUTER)?\s+JOIN\s+(?!tv_episodes)\s+.*ON.*=.*\n#i', ' ', $baseSql) |
@@ -761,11 +761,11 @@ discard block |
||
761 | 761 | |
762 | 762 | $show = self::fromQuery($showQry); |
763 | 763 | if ($show->isNotEmpty()) { |
764 | - if ((! empty($episode) && ! empty($series)) && $show[0]->episodes !== '') { |
|
764 | + if ((!empty($episode) && !empty($series)) && $show[0]->episodes !== '') { |
|
765 | 765 | $showSql .= ' AND r.tv_episodes_id IN ('.$show[0]->episodes.') AND tve.series = '.$series; |
766 | - } elseif (! empty($episode) && $show[0]->episodes !== '') { |
|
766 | + } elseif (!empty($episode) && $show[0]->episodes !== '') { |
|
767 | 767 | $showSql = sprintf('AND r.tv_episodes_id IN (%s)', $show[0]->episodes); |
768 | - } elseif (! empty($series) && empty($episode)) { |
|
768 | + } elseif (!empty($series) && empty($episode)) { |
|
769 | 769 | // If $series is set but episode is not, return Season Packs and Episodes |
770 | 770 | $showSql .= ' AND r.tv_episodes_id IN ('.$show[0]->episodes.') AND tve.series = '.$series; |
771 | 771 | } |
@@ -778,26 +778,26 @@ discard block |
||
778 | 778 | } |
779 | 779 | } |
780 | 780 | // If $name is set it is a fallback search, add available SxxExx/airdate info to the query |
781 | - if (! empty($name) && $showSql === '') { |
|
782 | - if (! empty($series) && (int) $series < 1900) { |
|
781 | + if (!empty($name) && $showSql === '') { |
|
782 | + if (!empty($series) && (int) $series < 1900) { |
|
783 | 783 | $name .= sprintf(' S%s', str_pad($series, 2, '0', STR_PAD_LEFT)); |
784 | - if (! empty($episode) && ! str_contains($episode, '/')) { |
|
784 | + if (!empty($episode) && !str_contains($episode, '/')) { |
|
785 | 785 | $name .= sprintf('E%s', str_pad($episode, 2, '0', STR_PAD_LEFT)); |
786 | 786 | } |
787 | 787 | // If season is not empty but episode is, add a wildcard to the search |
788 | 788 | if (empty($episode)) { |
789 | 789 | $name .= '*'; |
790 | 790 | } |
791 | - } elseif (! empty($airDate)) { |
|
791 | + } elseif (!empty($airDate)) { |
|
792 | 792 | $name .= sprintf(' %s', str_replace(['/', '-', '.', '_'], ' ', $airDate)); |
793 | 793 | } |
794 | 794 | } |
795 | - if (! empty($name)) { |
|
795 | + if (!empty($name)) { |
|
796 | 796 | if (config('nntmux.elasticsearch_enabled') === true) { |
797 | 797 | $searchResult = $this->elasticSearch->indexSearchTMA($name, $limit); |
798 | 798 | } else { |
799 | 799 | $searchResult = $this->manticoreSearch->searchIndexes('releases_rt', $name, ['searchname']); |
800 | - if (! empty($searchResult)) { |
|
800 | + if (!empty($searchResult)) { |
|
801 | 801 | $searchResult = Arr::wrap(Arr::get($searchResult, 'id')); |
802 | 802 | } |
803 | 803 | } |
@@ -813,11 +813,11 @@ discard block |
||
813 | 813 | NZB::NZB_ADDED, |
814 | 814 | $this->showPasswords(), |
815 | 815 | $showSql, |
816 | - (! empty($searchResult) ? 'AND r.id IN ('.implode(',', $searchResult).')' : ''), |
|
816 | + (!empty($searchResult) ? 'AND r.id IN ('.implode(',', $searchResult).')' : ''), |
|
817 | 817 | Category::getCategorySearch($cat), |
818 | 818 | ($maxAge > 0 ? sprintf('AND r.postdate > NOW() - INTERVAL %d DAY', $maxAge) : ''), |
819 | 819 | ($minSize > 0 ? sprintf('AND r.size >= %d', $minSize) : ''), |
820 | - ! empty($excludedCategories) ? sprintf('AND r.categories_id NOT IN('.implode(',', $excludedCategories).')') : '' |
|
820 | + !empty($excludedCategories) ? sprintf('AND r.categories_id NOT IN('.implode(',', $excludedCategories).')') : '' |
|
821 | 821 | ); |
822 | 822 | $baseSql = sprintf( |
823 | 823 | "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, |
@@ -844,7 +844,7 @@ discard block |
||
844 | 844 | $offset |
845 | 845 | ); |
846 | 846 | |
847 | - return Cache::flexible(md5($sql), [config('nntmux.cache_expiry_medium'), config('nntmux.cache_expiry_long')], function () use ($sql, $baseSql) { |
|
847 | + return Cache::flexible(md5($sql), [config('nntmux.cache_expiry_medium'), config('nntmux.cache_expiry_long')], function() use ($sql, $baseSql) { |
|
848 | 848 | $releases = self::fromQuery($sql); |
849 | 849 | if ($releases->isNotEmpty()) { |
850 | 850 | $releases[0]->_totalrows = $this->getPagerCount( |
@@ -861,12 +861,12 @@ discard block |
||
861 | 861 | */ |
862 | 862 | public function animeSearch($aniDbID, int $offset = 0, int $limit = 100, string $name = '', array $cat = [-1], int $maxAge = -1, array $excludedCategories = []): mixed |
863 | 863 | { |
864 | - if (! empty($name)) { |
|
864 | + if (!empty($name)) { |
|
865 | 865 | if (config('nntmux.elasticsearch_enabled') === true) { |
866 | 866 | $searchResult = $this->elasticSearch->indexSearchTMA($name, $limit); |
867 | 867 | } else { |
868 | 868 | $searchResult = $this->manticoreSearch->searchIndexes('releases_rt', $name, ['searchname']); |
869 | - if (! empty($searchResult)) { |
|
869 | + if (!empty($searchResult)) { |
|
870 | 870 | $searchResult = Arr::wrap(Arr::get($searchResult, 'id')); |
871 | 871 | } |
872 | 872 | } |
@@ -883,8 +883,8 @@ discard block |
||
883 | 883 | $this->showPasswords(), |
884 | 884 | NZB::NZB_ADDED, |
885 | 885 | ($aniDbID > -1 ? sprintf(' AND r.anidbid = %d ', $aniDbID) : ''), |
886 | - (! empty($searchResult) ? 'AND r.id IN ('.implode(',', $searchResult).')' : ''), |
|
887 | - ! empty($excludedCategories) ? sprintf('AND r.categories_id NOT IN('.implode(',', $excludedCategories).')') : '', |
|
886 | + (!empty($searchResult) ? 'AND r.id IN ('.implode(',', $searchResult).')' : ''), |
|
887 | + !empty($excludedCategories) ? sprintf('AND r.categories_id NOT IN('.implode(',', $excludedCategories).')') : '', |
|
888 | 888 | Category::getCategorySearch($cat), |
889 | 889 | ($maxAge > 0 ? sprintf(' AND r.postdate > NOW() - INTERVAL %d DAY ', $maxAge) : '') |
890 | 890 | ); |
@@ -910,7 +910,7 @@ discard block |
||
910 | 910 | $offset |
911 | 911 | ); |
912 | 912 | |
913 | - return Cache::flexible(md5($sql), [config('nntmux.cache_expiry_medium'), config('nntmux.cache_expiry_long')], function () use ($sql, $baseSql) { |
|
913 | + return Cache::flexible(md5($sql), [config('nntmux.cache_expiry_medium'), config('nntmux.cache_expiry_long')], function() use ($sql, $baseSql) { |
|
914 | 914 | $releases = self::fromQuery($sql); |
915 | 915 | if ($releases->isNotEmpty()) { |
916 | 916 | $releases[0]->_totalrows = $this->getPagerCount($baseSql); |
@@ -925,12 +925,12 @@ discard block |
||
925 | 925 | */ |
926 | 926 | 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 |
927 | 927 | { |
928 | - if (! empty($name)) { |
|
928 | + if (!empty($name)) { |
|
929 | 929 | if (config('nntmux.elasticsearch_enabled') === true) { |
930 | 930 | $searchResult = $this->elasticSearch->indexSearchTMA($name, $limit); |
931 | 931 | } else { |
932 | 932 | $searchResult = $this->manticoreSearch->searchIndexes('releases_rt', $name, ['searchname']); |
933 | - if (! empty($searchResult)) { |
|
933 | + if (!empty($searchResult)) { |
|
934 | 934 | $searchResult = Arr::wrap(Arr::get($searchResult, 'id')); |
935 | 935 | } |
936 | 936 | } |
@@ -947,11 +947,11 @@ discard block |
||
947 | 947 | %s %s %s %s %s %s %s', |
948 | 948 | NZB::NZB_ADDED, |
949 | 949 | $this->showPasswords(), |
950 | - (! empty($searchResult) ? 'AND r.id IN ('.implode(',', $searchResult).')' : ''), |
|
950 | + (!empty($searchResult) ? 'AND r.id IN ('.implode(',', $searchResult).')' : ''), |
|
951 | 951 | ($imDbId !== -1 && is_numeric($imDbId)) ? sprintf(' AND m.imdbid = \'%s\' ', $imDbId) : '', |
952 | 952 | ($tmDbId !== -1 && is_numeric($tmDbId)) ? sprintf(' AND m.tmdbid = %d ', $tmDbId) : '', |
953 | 953 | ($traktId !== -1 && is_numeric($traktId)) ? sprintf(' AND m.traktid = %d ', $traktId) : '', |
954 | - ! empty($excludedCategories) ? sprintf('AND r.categories_id NOT IN('.implode(',', $excludedCategories).')') : '', |
|
954 | + !empty($excludedCategories) ? sprintf('AND r.categories_id NOT IN('.implode(',', $excludedCategories).')') : '', |
|
955 | 955 | Category::getCategorySearch($cat), |
956 | 956 | $maxAge > 0 ? sprintf(' AND r.postdate > NOW() - INTERVAL %d DAY ', $maxAge) : '', |
957 | 957 | $minSize > 0 ? sprintf('AND r.size >= %d', $minSize) : '' |
@@ -979,7 +979,7 @@ discard block |
||
979 | 979 | $offset |
980 | 980 | ); |
981 | 981 | |
982 | - return Cache::flexible(md5($sql), [config('nntmux.cache_expiry_medium'), config('nntmux.cache_expiry_long')], function () use ($sql, $baseSql) { |
|
982 | + return Cache::flexible(md5($sql), [config('nntmux.cache_expiry_medium'), config('nntmux.cache_expiry_long')], function() use ($sql, $baseSql) { |
|
983 | 983 | $releases = self::fromQuery($sql); |
984 | 984 | if ($releases->isNotEmpty()) { |
985 | 985 | $releases[0]->_totalrows = $this->getPagerCount($baseSql); |
@@ -1003,7 +1003,7 @@ discard block |
||
1003 | 1003 | } |
1004 | 1004 | |
1005 | 1005 | $results = $this->search(['searchname' => getSimilarName($name)], -1, '', '', -1, -1, 0, config('nntmux.items_per_page'), '', -1, $excludedCats, 'basic', [$parentCat]); |
1006 | - if (! $results) { |
|
1006 | + if (!$results) { |
|
1007 | 1007 | return $ret; |
1008 | 1008 | } |
1009 | 1009 | |
@@ -1025,7 +1025,7 @@ discard block |
||
1025 | 1025 | preg_replace('/SELECT.+?FROM\s+releases/is', 'SELECT r.id FROM releases', $query) |
1026 | 1026 | ); |
1027 | 1027 | |
1028 | - return Cache::flexible(md5($sql), [config('nntmux.cache_expiry_short'), config('nntmux.cache_expiry_medium')], function () use ($sql) { |
|
1028 | + return Cache::flexible(md5($sql), [config('nntmux.cache_expiry_short'), config('nntmux.cache_expiry_medium')], function() use ($sql) { |
|
1029 | 1029 | $count = self::fromQuery($sql); |
1030 | 1030 | |
1031 | 1031 | return $count[0]->count ?? 0; |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | $this->config->language = $this->lookuplanguage; |
133 | 133 | $this->config->throwHttpExceptions = false; |
134 | 134 | $cacheDir = storage_path('framework/cache/imdb_cache'); |
135 | - if (! File::isDirectory($cacheDir)) { |
|
135 | + if (!File::isDirectory($cacheDir)) { |
|
136 | 136 | File::makeDirectory($cacheDir, 0777, false, true); |
137 | 137 | } |
138 | 138 | $this->config->cachedir = $cacheDir; |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | ORDER BY %s %s %s", |
177 | 177 | $this->showPasswords, |
178 | 178 | $this->getBrowseBy(), |
179 | - (! empty($catsrch) ? $catsrch : ''), |
|
179 | + (!empty($catsrch) ? $catsrch : ''), |
|
180 | 180 | ( |
181 | 181 | $maxAge > 0 |
182 | 182 | ? 'AND r.postdate > NOW() - INTERVAL '.$maxAge.'DAY ' |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | Cache::put(md5($moviesSql.$page), $movies, $expiresAt); |
197 | 197 | } |
198 | 198 | $movieIDs = $releaseIDs = []; |
199 | - if (! empty($movies['result'])) { |
|
199 | + if (!empty($movies['result'])) { |
|
200 | 200 | foreach ($movies['result'] as $movie => $id) { |
201 | 201 | $movieIDs[] = $id->imdbid; |
202 | 202 | $releaseIDs[] = $id->grp_release_id; |
@@ -235,14 +235,14 @@ discard block |
||
235 | 235 | AND r.id IN (%s) %s |
236 | 236 | GROUP BY m.imdbid |
237 | 237 | ORDER BY %s %s", |
238 | - (\is_array($movieIDs) && ! empty($movieIDs) ? implode(',', $movieIDs) : -1), |
|
239 | - (\is_array($releaseIDs) && ! empty($releaseIDs) ? implode(',', $releaseIDs) : -1), |
|
240 | - (! empty($catsrch) ? $catsrch : ''), |
|
238 | + (\is_array($movieIDs) && !empty($movieIDs) ? implode(',', $movieIDs) : -1), |
|
239 | + (\is_array($releaseIDs) && !empty($releaseIDs) ? implode(',', $releaseIDs) : -1), |
|
240 | + (!empty($catsrch) ? $catsrch : ''), |
|
241 | 241 | $order[0], |
242 | 242 | $order[1] |
243 | 243 | ); |
244 | 244 | |
245 | - return Cache::flexible(md5($sql.$page), [config('nntmux.cache_expiry_medium'), config('nntmux.cache_expiry_long')], function () use ($sql, $movies) { |
|
245 | + return Cache::flexible(md5($sql.$page), [config('nntmux.cache_expiry_medium'), config('nntmux.cache_expiry_long')], function() use ($sql, $movies) { |
|
246 | 246 | $return = Release::fromQuery($sql); |
247 | 247 | if (\count($return) > 0) { |
248 | 248 | $return[0]->_totalcount = $movies['total'][0]->total ?? 0; |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | $browseBy = ' '; |
283 | 283 | $browseByArr = ['title', 'director', 'actors', 'genre', 'rating', 'year', 'imdb']; |
284 | 284 | foreach ($browseByArr as $bb) { |
285 | - if (request()->has($bb) && ! empty(request()->input($bb))) { |
|
285 | + if (request()->has($bb) && !empty(request()->input($bb))) { |
|
286 | 286 | $bbv = stripslashes(request()->input($bb)); |
287 | 287 | if ($bb === 'rating') { |
288 | 288 | $bbv .= '.'; |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | |
316 | 316 | if ($this->traktcheck !== null) { |
317 | 317 | $data = $this->traktTv->client->movieSummary('tt'.$imdbId, 'full'); |
318 | - if (($data !== false) && ! empty($data['trailer'])) { |
|
318 | + if (($data !== false) && !empty($data['trailer'])) { |
|
319 | 319 | return $data['trailer']; |
320 | 320 | } |
321 | 321 | } |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | return false; |
342 | 342 | } |
343 | 343 | |
344 | - if (! empty($data['trailer'])) { |
|
344 | + if (!empty($data['trailer'])) { |
|
345 | 345 | $data['trailer'] = str_ireplace( |
346 | 346 | ['watch?v=', 'http://'], |
347 | 347 | ['embed/', 'https://'], |
@@ -375,17 +375,17 @@ discard block |
||
375 | 375 | */ |
376 | 376 | private function checkTraktValue($value) |
377 | 377 | { |
378 | - if (\is_array($value) && ! empty($value)) { |
|
378 | + if (\is_array($value) && !empty($value)) { |
|
379 | 379 | $temp = ''; |
380 | 380 | foreach ($value as $val) { |
381 | - if (! \is_array($val) && ! \is_object($val)) { |
|
381 | + if (!\is_array($val) && !\is_object($val)) { |
|
382 | 382 | $temp .= $val; |
383 | 383 | } |
384 | 384 | } |
385 | 385 | $value = $temp; |
386 | 386 | } |
387 | 387 | |
388 | - return ! empty($value) ? $value : ''; |
|
388 | + return !empty($value) ? $value : ''; |
|
389 | 389 | } |
390 | 390 | |
391 | 391 | /** |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | */ |
407 | 407 | public function update(array $values): bool |
408 | 408 | { |
409 | - if (! \count($values)) { |
|
409 | + if (!\count($values)) { |
|
410 | 410 | return false; |
411 | 411 | } |
412 | 412 | |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | $onDuplicateKey = ['created_at' => now()]; |
415 | 415 | $found = 0; |
416 | 416 | foreach ($values as $key => $value) { |
417 | - if (! empty($value)) { |
|
417 | + if (!empty($value)) { |
|
418 | 418 | $found++; |
419 | 419 | if (\in_array($key, ['genre', 'language'], false)) { |
420 | 420 | $value = substr($value, 0, 64); |
@@ -423,7 +423,7 @@ discard block |
||
423 | 423 | $onDuplicateKey += [$key => $value]; |
424 | 424 | } |
425 | 425 | } |
426 | - if (! $found) { |
|
426 | + if (!$found) { |
|
427 | 427 | return false; |
428 | 428 | } |
429 | 429 | foreach ($query as $key => $value) { |
@@ -440,19 +440,19 @@ discard block |
||
440 | 440 | */ |
441 | 441 | protected function setVariables(string|array $variable1, string|array $variable2, string|array $variable3, string|array $variable4, string|array $variable5) |
442 | 442 | { |
443 | - if (! empty($variable1)) { |
|
443 | + if (!empty($variable1)) { |
|
444 | 444 | return $variable1; |
445 | 445 | } |
446 | - if (! empty($variable2)) { |
|
446 | + if (!empty($variable2)) { |
|
447 | 447 | return $variable2; |
448 | 448 | } |
449 | - if (! empty($variable3)) { |
|
449 | + if (!empty($variable3)) { |
|
450 | 450 | return $variable3; |
451 | 451 | } |
452 | - if (! empty($variable4)) { |
|
452 | + if (!empty($variable4)) { |
|
453 | 453 | return $variable4; |
454 | 454 | } |
455 | - if (! empty($variable5)) { |
|
455 | + if (!empty($variable5)) { |
|
456 | 456 | return $variable5; |
457 | 457 | } |
458 | 458 | |
@@ -487,7 +487,7 @@ discard block |
||
487 | 487 | |
488 | 488 | $iTunes = $this->fetchItunesMovieProperties($this->currentTitle); |
489 | 489 | |
490 | - if (! $imdb && ! $tmdb && ! $trakt && ! $omdb && empty($iTunes)) { |
|
490 | + if (!$imdb && !$tmdb && !$trakt && !$omdb && empty($iTunes)) { |
|
491 | 491 | return false; |
492 | 492 | } |
493 | 493 | |
@@ -500,36 +500,36 @@ discard block |
||
500 | 500 | $mov['type'] = $mov['director'] = $mov['actors'] = $mov['language'] = ''; |
501 | 501 | |
502 | 502 | $mov['imdbid'] = $imdbId; |
503 | - $mov['tmdbid'] = (! isset($tmdb['tmdbid']) || $tmdb['tmdbid'] === '') ? 0 : $tmdb['tmdbid']; |
|
504 | - $mov['traktid'] = (! isset($trakt['id']) || $trakt['id'] === '') ? 0 : $trakt['id']; |
|
503 | + $mov['tmdbid'] = (!isset($tmdb['tmdbid']) || $tmdb['tmdbid'] === '') ? 0 : $tmdb['tmdbid']; |
|
504 | + $mov['traktid'] = (!isset($trakt['id']) || $trakt['id'] === '') ? 0 : $trakt['id']; |
|
505 | 505 | |
506 | 506 | // Prefer Fanart.tv cover over TMDB,TMDB over IMDB,IMDB over OMDB and OMDB over iTunes. |
507 | - if (! empty($fanart['cover'])) { |
|
507 | + if (!empty($fanart['cover'])) { |
|
508 | 508 | $mov['cover'] = $this->releaseImage->saveImage($imdbId.'-cover', $fanart['cover'], $this->imgSavePath); |
509 | - } elseif (! empty($tmdb['cover'])) { |
|
509 | + } elseif (!empty($tmdb['cover'])) { |
|
510 | 510 | $mov['cover'] = $this->releaseImage->saveImage($imdbId.'-cover', $tmdb['cover'], $this->imgSavePath); |
511 | - } elseif (! empty($imdb['cover'])) { |
|
511 | + } elseif (!empty($imdb['cover'])) { |
|
512 | 512 | $mov['cover'] = $this->releaseImage->saveImage($imdbId.'-cover', $imdb['cover'], $this->imgSavePath); |
513 | - } elseif (! empty($omdb['cover'])) { |
|
513 | + } elseif (!empty($omdb['cover'])) { |
|
514 | 514 | $mov['cover'] = $this->releaseImage->saveImage($imdbId.'-cover', $omdb['cover'], $this->imgSavePath); |
515 | - } elseif (! empty($iTunes['cover'])) { |
|
515 | + } elseif (!empty($iTunes['cover'])) { |
|
516 | 516 | $mov['cover'] = $this->releaseImage->saveImage($imdbId.'-cover', $iTunes['cover'], $this->imgSavePath); |
517 | 517 | } |
518 | 518 | |
519 | 519 | // Backdrops. |
520 | - if (! empty($fanart['backdrop'])) { |
|
520 | + if (!empty($fanart['backdrop'])) { |
|
521 | 521 | $mov['backdrop'] = $this->releaseImage->saveImage($imdbId.'-backdrop', $fanart['backdrop'], $this->imgSavePath, 1920, 1024); |
522 | - } elseif (! empty($tmdb['backdrop'])) { |
|
522 | + } elseif (!empty($tmdb['backdrop'])) { |
|
523 | 523 | $mov['backdrop'] = $this->releaseImage->saveImage($imdbId.'-backdrop', $tmdb['backdrop'], $this->imgSavePath, 1920, 1024); |
524 | 524 | } |
525 | 525 | |
526 | 526 | // Banner |
527 | - if (! empty($fanart['banner'])) { |
|
527 | + if (!empty($fanart['banner'])) { |
|
528 | 528 | $mov['banner'] = $this->releaseImage->saveImage($imdbId.'-banner', $fanart['banner'], $this->imgSavePath); |
529 | 529 | } |
530 | 530 | |
531 | 531 | // RottenTomatoes rating from OmdbAPI |
532 | - if ($omdb !== false && ! empty($omdb['rtRating'])) { |
|
532 | + if ($omdb !== false && !empty($omdb['rtRating'])) { |
|
533 | 533 | $mov['rtrating'] = $omdb['rtRating']; |
534 | 534 | } |
535 | 535 | |
@@ -540,29 +540,29 @@ discard block |
||
540 | 540 | $mov['year'] = $this->setVariables($imdb['year'] ?? '', $tmdb['year'] ?? '', $trakt['year'] ?? '', $omdb['year'] ?? '', $iTunes['year'] ?? ''); |
541 | 541 | $mov['genre'] = $this->setVariables($imdb['genre'] ?? '', $tmdb['genre'] ?? '', $trakt['genres'] ?? '', $omdb['genre'] ?? '', $iTunes['genre'] ?? ''); |
542 | 542 | |
543 | - if (! empty($imdb['type'])) { |
|
543 | + if (!empty($imdb['type'])) { |
|
544 | 544 | $mov['type'] = $imdb['type']; |
545 | 545 | } |
546 | 546 | |
547 | - if (! empty($imdb['director'])) { |
|
547 | + if (!empty($imdb['director'])) { |
|
548 | 548 | $mov['director'] = \is_array($imdb['director']) ? implode(', ', array_unique($imdb['director'])) : $imdb['director']; |
549 | - } elseif (! empty($omdb['director'])) { |
|
549 | + } elseif (!empty($omdb['director'])) { |
|
550 | 550 | $mov['director'] = \is_array($omdb['director']) ? implode(', ', array_unique($omdb['director'])) : $omdb['director']; |
551 | - } elseif (! empty($tmdb['director'])) { |
|
551 | + } elseif (!empty($tmdb['director'])) { |
|
552 | 552 | $mov['director'] = \is_array($tmdb['director']) ? implode(', ', array_unique($tmdb['director'])) : $tmdb['director']; |
553 | 553 | } |
554 | 554 | |
555 | - if (! empty($imdb['actors'])) { |
|
555 | + if (!empty($imdb['actors'])) { |
|
556 | 556 | $mov['actors'] = \is_array($imdb['actors']) ? implode(', ', array_unique($imdb['actors'])) : $imdb['actors']; |
557 | - } elseif (! empty($omdb['actors'])) { |
|
557 | + } elseif (!empty($omdb['actors'])) { |
|
558 | 558 | $mov['actors'] = \is_array($omdb['actors']) ? implode(', ', array_unique($omdb['actors'])) : $omdb['actors']; |
559 | - } elseif (! empty($tmdb['actors'])) { |
|
559 | + } elseif (!empty($tmdb['actors'])) { |
|
560 | 560 | $mov['actors'] = \is_array($tmdb['actors']) ? implode(', ', array_unique($tmdb['actors'])) : $tmdb['actors']; |
561 | 561 | } |
562 | 562 | |
563 | - if (! empty($imdb['language'])) { |
|
563 | + if (!empty($imdb['language'])) { |
|
564 | 564 | $mov['language'] = \is_array($imdb['language']) ? implode(', ', array_unique($imdb['language'])) : $imdb['language']; |
565 | - } elseif (! empty($omdb['language']) && ! is_bool($omdb['language'])) { |
|
565 | + } elseif (!empty($omdb['language']) && !is_bool($omdb['language'])) { |
|
566 | 566 | $mov['language'] = \is_array($omdb['language']) ? implode(', ', array_unique($omdb['language'])) : $omdb['language']; |
567 | 567 | } |
568 | 568 | |
@@ -620,20 +620,20 @@ discard block |
||
620 | 620 | if ($this->fanartapikey !== null) { |
621 | 621 | $art = $this->fanart->getMovieFanArt('tt'.$imdbId); |
622 | 622 | |
623 | - if (! empty($art)) { |
|
623 | + if (!empty($art)) { |
|
624 | 624 | if (isset($art['status']) && $art['status'] === 'error') { |
625 | 625 | return false; |
626 | 626 | } |
627 | 627 | $ret = []; |
628 | - if (! empty($art['moviebackground'][0]['url'])) { |
|
628 | + if (!empty($art['moviebackground'][0]['url'])) { |
|
629 | 629 | $ret['backdrop'] = $art['moviebackground'][0]['url']; |
630 | - } elseif (! empty($art['moviethumb'][0]['url'])) { |
|
630 | + } elseif (!empty($art['moviethumb'][0]['url'])) { |
|
631 | 631 | $ret['backdrop'] = $art['moviethumb'][0]['url']; |
632 | 632 | } |
633 | - if (! empty($art['movieposter'][0]['url'])) { |
|
633 | + if (!empty($art['movieposter'][0]['url'])) { |
|
634 | 634 | $ret['cover'] = $art['movieposter'][0]['url']; |
635 | 635 | } |
636 | - if (! empty($art['moviebanner'][0]['url'])) { |
|
636 | + if (!empty($art['moviebanner'][0]['url'])) { |
|
637 | 637 | $ret['banner'] = $art['moviebanner'][0]['url']; |
638 | 638 | } |
639 | 639 | |
@@ -670,7 +670,7 @@ discard block |
||
670 | 670 | return false; |
671 | 671 | } |
672 | 672 | |
673 | - if (! empty($tmdbLookup)) { |
|
673 | + if (!empty($tmdbLookup)) { |
|
674 | 674 | if ($this->currentTitle !== '') { |
675 | 675 | // Check the similarity. |
676 | 676 | similar_text($this->currentTitle, $tmdbLookup['title'], $percent); |
@@ -699,7 +699,7 @@ discard block |
||
699 | 699 | $ret['rating'] = ''; |
700 | 700 | } |
701 | 701 | $actors = Arr::pluck($tmdbLookup['credits']['cast'], 'name'); |
702 | - if (! empty($actors)) { |
|
702 | + if (!empty($actors)) { |
|
703 | 703 | $ret['actors'] = $actors; |
704 | 704 | } else { |
705 | 705 | $ret['actors'] = ''; |
@@ -710,7 +710,7 @@ discard block |
||
710 | 710 | } |
711 | 711 | } |
712 | 712 | $overview = $tmdbLookup['overview']; |
713 | - if (! empty($overview)) { |
|
713 | + if (!empty($overview)) { |
|
714 | 714 | $ret['plot'] = $overview; |
715 | 715 | } else { |
716 | 716 | $ret['plot'] = ''; |
@@ -720,13 +720,13 @@ discard block |
||
720 | 720 | $ret['tagline'] = $tagline ?? ''; |
721 | 721 | |
722 | 722 | $released = $tmdbLookup['release_date']; |
723 | - if (! empty($released)) { |
|
723 | + if (!empty($released)) { |
|
724 | 724 | $ret['year'] = Carbon::parse($released)->year; |
725 | 725 | } else { |
726 | 726 | $ret['year'] = ''; |
727 | 727 | } |
728 | 728 | $genresa = $tmdbLookup['genres']; |
729 | - if (! empty($genresa) && \count($genresa) > 0) { |
|
729 | + if (!empty($genresa) && \count($genresa) > 0) { |
|
730 | 730 | $genres = []; |
731 | 731 | foreach ($genresa as $genre) { |
732 | 732 | $genres[] = $genre['name']; |
@@ -736,13 +736,13 @@ discard block |
||
736 | 736 | $ret['genre'] = ''; |
737 | 737 | } |
738 | 738 | $posterp = $tmdbLookup['poster_path']; |
739 | - if (! empty($posterp)) { |
|
739 | + if (!empty($posterp)) { |
|
740 | 740 | $ret['cover'] = 'https://image.tmdb.org/t/p/original'.$posterp; |
741 | 741 | } else { |
742 | 742 | $ret['cover'] = ''; |
743 | 743 | } |
744 | 744 | $backdrop = $tmdbLookup['backdrop_path']; |
745 | - if (! empty($backdrop)) { |
|
745 | + if (!empty($backdrop)) { |
|
746 | 746 | $ret['backdrop'] = 'https://image.tmdb.org/t/p/original'.$backdrop; |
747 | 747 | } else { |
748 | 748 | $ret['backdrop'] = ''; |
@@ -764,9 +764,9 @@ discard block |
||
764 | 764 | { |
765 | 765 | $realId = (new Title($imdbId, $this->config))->real_id(); |
766 | 766 | $result = new Title($realId, $this->config); |
767 | - $title = ! empty($result->orig_title()) ? $result->orig_title() : $result->title(); |
|
768 | - if (! empty($title)) { |
|
769 | - if (! empty($this->currentTitle)) { |
|
767 | + $title = !empty($result->orig_title()) ? $result->orig_title() : $result->title(); |
|
768 | + if (!empty($title)) { |
|
769 | + if (!empty($this->currentTitle)) { |
|
770 | 770 | similar_text($this->currentTitle, $title, $percent); |
771 | 771 | if ($percent >= self::MATCH_PERCENT) { |
772 | 772 | similar_text($this->currentYear, $result->year(), $percent); |
@@ -775,7 +775,7 @@ discard block |
||
775 | 775 | 'title' => $title, |
776 | 776 | 'tagline' => $result->tagline() ?? '', |
777 | 777 | 'plot' => Arr::get($result->plot_split(), '0.plot'), |
778 | - 'rating' => ! empty($result->rating()) ? $result->rating() : '', |
|
778 | + 'rating' => !empty($result->rating()) ? $result->rating() : '', |
|
779 | 779 | 'year' => $result->year() ?? '', |
780 | 780 | 'cover' => $result->photo() ?? '', |
781 | 781 | 'genre' => $result->genre() ?? '', |
@@ -800,7 +800,7 @@ discard block |
||
800 | 800 | 'title' => $title, |
801 | 801 | 'tagline' => $result->tagline() ?? '', |
802 | 802 | 'plot' => Arr::get($result->plot_split(), '0.plot'), |
803 | - 'rating' => ! empty($result->rating()) ? $result->rating() : '', |
|
803 | + 'rating' => !empty($result->rating()) ? $result->rating() : '', |
|
804 | 804 | 'year' => $result->year() ?? '', |
805 | 805 | 'cover' => $result->photo() ?? '', |
806 | 806 | 'genre' => $result->genre() ?? '', |
@@ -874,7 +874,7 @@ discard block |
||
874 | 874 | if ($this->omdbapikey !== null) { |
875 | 875 | $resp = $this->omdbApi->fetch('i', 'tt'.$imdbId); |
876 | 876 | |
877 | - if (\is_object($resp) && $resp->message === 'OK' && ! Str::contains($resp->data->Response, 'Error:') && $resp->data->Response !== 'False') { |
|
877 | + if (\is_object($resp) && $resp->message === 'OK' && !Str::contains($resp->data->Response, 'Error:') && $resp->data->Response !== 'False') { |
|
878 | 878 | similar_text($this->currentTitle, $resp->data->Title, $percent); |
879 | 879 | if ($percent >= self::MATCH_PERCENT) { |
880 | 880 | similar_text($this->currentYear, $resp->data->Year, $percent); |
@@ -1040,7 +1040,7 @@ discard block |
||
1040 | 1040 | // Loop over releases. |
1041 | 1041 | foreach ($res as $arr) { |
1042 | 1042 | // Try to get a name/year. |
1043 | - if (! $this->parseMovieSearchName($arr['searchname'])) { |
|
1043 | + if (!$this->parseMovieSearchName($arr['searchname'])) { |
|
1044 | 1044 | //We didn't find a name, so set to all 0's so we don't parse again. |
1045 | 1045 | Release::query()->where('id', $arr['id'])->update(['imdbid' => 0000000]); |
1046 | 1046 | |
@@ -1074,7 +1074,7 @@ discard block |
||
1074 | 1074 | try { |
1075 | 1075 | $imdbSearch = new TitleSearch($this->config); |
1076 | 1076 | foreach ($imdbSearch->search($this->currentTitle, [TitleSearch::MOVIE]) as $imdbTitle) { |
1077 | - if (! empty($imdbTitle->title())) { |
|
1077 | + if (!empty($imdbTitle->title())) { |
|
1078 | 1078 | similar_text($imdbTitle->title(), $this->currentTitle, $percent); |
1079 | 1079 | if ($percent >= self::MATCH_PERCENT) { |
1080 | 1080 | similar_text($this->currentYear, $imdbTitle->year(), $percent); |
@@ -1104,10 +1104,10 @@ discard block |
||
1104 | 1104 | $buffer = $this->omdbApi->search($omdbTitle, 'movie'); |
1105 | 1105 | } |
1106 | 1106 | |
1107 | - if (\is_object($buffer) && $buffer->message === 'OK' && ! Str::contains($buffer->data->Response, 'Error:') && $buffer->data->Response === 'True') { |
|
1107 | + if (\is_object($buffer) && $buffer->message === 'OK' && !Str::contains($buffer->data->Response, 'Error:') && $buffer->data->Response === 'True') { |
|
1108 | 1108 | $getIMDBid = $buffer->data->Search[0]->imdbID; |
1109 | 1109 | |
1110 | - if (! empty($getIMDBid)) { |
|
1110 | + if (!empty($getIMDBid)) { |
|
1111 | 1111 | $imdbId = $this->doMovieUpdate($getIMDBid, 'OMDbAPI', $arr['id']); |
1112 | 1112 | if ($imdbId !== false) { |
1113 | 1113 | $movieUpdated = true; |
@@ -1122,7 +1122,7 @@ discard block |
||
1122 | 1122 | $data = $this->traktTv->client->movieSummary($movieName, 'full'); |
1123 | 1123 | if ($data !== false) { |
1124 | 1124 | $this->parseTraktTv($data); |
1125 | - if (! empty($data['ids']['imdb'])) { |
|
1125 | + if (!empty($data['ids']['imdb'])) { |
|
1126 | 1126 | $imdbId = $this->doMovieUpdate($data['ids']['imdb'], 'Trakt', $arr['id']); |
1127 | 1127 | if ($imdbId !== false) { |
1128 | 1128 | $movieUpdated = true; |
@@ -1135,13 +1135,13 @@ discard block |
||
1135 | 1135 | if ($movieUpdated === false) { |
1136 | 1136 | try { |
1137 | 1137 | $data = Tmdb::getSearchApi()->searchMovies($this->currentTitle); |
1138 | - if (($data['total_results'] > 0) && ! empty($data['results'])) { |
|
1138 | + if (($data['total_results'] > 0) && !empty($data['results'])) { |
|
1139 | 1139 | foreach ($data['results'] as $result) { |
1140 | - if (! empty($result['id']) && ! empty($result['release_date'])) { |
|
1140 | + if (!empty($result['id']) && !empty($result['release_date'])) { |
|
1141 | 1141 | similar_text($this->currentYear, Carbon::parse($result['release_date'])->year, $percent); |
1142 | 1142 | if ($percent >= self::YEAR_MATCH_PERCENT) { |
1143 | 1143 | $ret = $this->fetchTMDBProperties($result['id'], true); |
1144 | - if ($ret !== false && ! empty($ret['imdbid'])) { |
|
1144 | + if ($ret !== false && !empty($ret['imdbid'])) { |
|
1145 | 1145 | $imdbId = $this->doMovieUpdate('tt'.$ret['imdbid'], 'TMDB', $arr['id']); |
1146 | 1146 | if ($imdbId !== false) { |
1147 | 1147 | $movieUpdated = true; |
@@ -1242,7 +1242,7 @@ discard block |
||
1242 | 1242 | // Finally remove multiple spaces and trim leading spaces. |
1243 | 1243 | $name = trim(preg_replace('/\s{2,}/', ' ', $name)); |
1244 | 1244 | // Check if the name is long enough and not just numbers. |
1245 | - if (\strlen($name) > 4 && ! preg_match('/^\d+$/', $name)) { |
|
1245 | + if (\strlen($name) > 4 && !preg_match('/^\d+$/', $name)) { |
|
1246 | 1246 | $this->currentTitle = $name; |
1247 | 1247 | $this->currentYear = $year; |
1248 | 1248 |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | $order[1] |
242 | 242 | ); |
243 | 243 | |
244 | - return Cache::flexible($returnSql.$page, [config('nntmux.cache_expiry_medium'), config('nntmux.cache_expiry_long')], function () use ($returnSql, $games) { |
|
244 | + return Cache::flexible($returnSql.$page, [config('nntmux.cache_expiry_medium'), config('nntmux.cache_expiry_long')], function() use ($returnSql, $games) { |
|
245 | 245 | $return = DB::select($returnSql); |
246 | 246 | if (\count($return) > 0) { |
247 | 247 | $return[0]->_totalcount = $games['total'][0]->total ?? 0; |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | { |
294 | 294 | $browseBy = ' '; |
295 | 295 | foreach ($this->getBrowseByOptions() as $bbk => $bbv) { |
296 | - if (! empty($_REQUEST[$bbk])) { |
|
296 | + if (!empty($_REQUEST[$bbk])) { |
|
297 | 297 | $bbs = stripslashes($_REQUEST[$bbk]); |
298 | 298 | if ($bbk === 'year') { |
299 | 299 | $browseBy .= ' AND YEAR (gi.releasedate) '.'LIKE '.escapeString('%'.$bbs.'%'); |
@@ -357,11 +357,11 @@ discard block |
||
357 | 357 | if (empty($this->_gameResults['title'])) { |
358 | 358 | return false; |
359 | 359 | } |
360 | - if (! empty($this->_gameResults['cover'])) { |
|
360 | + if (!empty($this->_gameResults['cover'])) { |
|
361 | 361 | $game['coverurl'] = (string) $this->_gameResults['cover']; |
362 | 362 | } |
363 | 363 | |
364 | - if (! empty($this->_gameResults['backdrop'])) { |
|
364 | + if (!empty($this->_gameResults['backdrop'])) { |
|
365 | 365 | $game['backdropurl'] = (string) $this->_gameResults['backdrop']; |
366 | 366 | } |
367 | 367 | |
@@ -369,41 +369,41 @@ discard block |
||
369 | 369 | $game['asin'] = $this->_gameResults['steamid']; |
370 | 370 | $game['url'] = (string) $this->_gameResults['directurl']; |
371 | 371 | |
372 | - if (! empty($this->_gameResults['publisher'])) { |
|
372 | + if (!empty($this->_gameResults['publisher'])) { |
|
373 | 373 | $game['publisher'] = (string) $this->_gameResults['publisher']; |
374 | 374 | } else { |
375 | 375 | $game['publisher'] = 'Unknown'; |
376 | 376 | } |
377 | 377 | |
378 | - if (! empty($this->_gameResults['rating'])) { |
|
378 | + if (!empty($this->_gameResults['rating'])) { |
|
379 | 379 | $game['esrb'] = (string) $this->_gameResults['rating']; |
380 | 380 | } else { |
381 | 381 | $game['esrb'] = 'Not Rated'; |
382 | 382 | } |
383 | 383 | |
384 | - if (! empty($this->_gameResults['releasedate'])) { |
|
384 | + if (!empty($this->_gameResults['releasedate'])) { |
|
385 | 385 | $dateReleased = strtotime($this->_gameResults['releasedate']) === false ? '' : $this->_gameResults['releasedate']; |
386 | 386 | $game['releasedate'] = ($this->_gameResults['releasedate'] === '' || strtotime($this->_gameResults['releasedate']) === false) ? null : Carbon::createFromFormat('M j, Y', Carbon::parse($dateReleased)->toFormattedDateString())->format('Y-m-d'); |
387 | 387 | } |
388 | 388 | |
389 | - if (! empty($this->_gameResults['description'])) { |
|
389 | + if (!empty($this->_gameResults['description'])) { |
|
390 | 390 | $game['review'] = (string) $this->_gameResults['description']; |
391 | 391 | } |
392 | 392 | |
393 | - if (! empty($this->_gameResults['genres'])) { |
|
393 | + if (!empty($this->_gameResults['genres'])) { |
|
394 | 394 | $genres = $this->_gameResults['genres']; |
395 | 395 | $genreName = $this->_matchGenre($genres); |
396 | 396 | } |
397 | 397 | } |
398 | 398 | } |
399 | 399 | |
400 | - if (! empty($this->publicKey)) { |
|
400 | + if (!empty($this->publicKey)) { |
|
401 | 401 | if ($steamGameID === false || $this->_gameResults === false) { |
402 | 402 | $bestMatch = false; |
403 | 403 | $this->_classUsed = 'GiantBomb'; |
404 | 404 | try { |
405 | 405 | $result = $this->giantBomb->search($gameInfo['title'], 'Game'); |
406 | - if (! \is_object($result)) { |
|
406 | + if (!\is_object($result)) { |
|
407 | 407 | $bestMatchPct = 0; |
408 | 408 | foreach ($result as $res) { |
409 | 409 | similar_text(strtolower($gameInfo['title']), strtolower($res->name), $percent1); |
@@ -416,17 +416,17 @@ discard block |
||
416 | 416 | if ($bestMatch !== false) { |
417 | 417 | $this->_gameResults = $this->giantBomb->findWithResourceID('Game', '3030-'.$bestMatch); |
418 | 418 | |
419 | - if (! empty($this->_gameResults->image['medium_url'])) { |
|
419 | + if (!empty($this->_gameResults->image['medium_url'])) { |
|
420 | 420 | $game['coverurl'] = (string) $this->_gameResults->image['medium_url']; |
421 | 421 | } |
422 | 422 | |
423 | - if (! empty($this->_gameResults->image['screen_url'])) { |
|
423 | + if (!empty($this->_gameResults->image['screen_url'])) { |
|
424 | 424 | $game['backdropurl'] = (string) $this->_gameResults->image['screen_url']; |
425 | 425 | } |
426 | 426 | |
427 | 427 | $game['title'] = (string) $this->_gameResults->get('name'); |
428 | 428 | $game['asin'] = $this->_gameResults->get('id'); |
429 | - if (! empty($this->_gameResults->get('site_detail_url'))) { |
|
429 | + if (!empty($this->_gameResults->get('site_detail_url'))) { |
|
430 | 430 | $game['url'] = (string) $this->_gameResults->get('site_detail_url'); |
431 | 431 | } else { |
432 | 432 | $game['url'] = ''; |
@@ -438,7 +438,7 @@ discard block |
||
438 | 438 | $game['publisher'] = 'Unknown'; |
439 | 439 | } |
440 | 440 | |
441 | - if (! empty($this->_gameResults->original_game_rating[0]['name'])) { |
|
441 | + if (!empty($this->_gameResults->original_game_rating[0]['name'])) { |
|
442 | 442 | $game['esrb'] = $this->_gameResults->original_game_rating[0]['name'] ?? 'Not Rated'; |
443 | 443 | } else { |
444 | 444 | $game['esrb'] = 'Not Rated'; |
@@ -475,7 +475,7 @@ discard block |
||
475 | 475 | $bestMatch = false; |
476 | 476 | $this->_classUsed = 'IGDB'; |
477 | 477 | $result = Game::where('name', $gameInfo['title'])->get(); |
478 | - if (! empty($result)) { |
|
478 | + if (!empty($result)) { |
|
479 | 479 | $bestMatchPct = 0; |
480 | 480 | foreach ($result as $res) { |
481 | 481 | similar_text(strtolower($gameInfo['title']), strtolower($res->name), $percent1); |
@@ -493,7 +493,7 @@ discard block |
||
493 | 493 | ])->where('id', $bestMatch)->first(); |
494 | 494 | |
495 | 495 | $publishers = []; |
496 | - if (! empty($this->_gameResults->involved_companies)) { |
|
496 | + if (!empty($this->_gameResults->involved_companies)) { |
|
497 | 497 | foreach ($this->_gameResults->involved_companies as $publisher) { |
498 | 498 | if ($publisher['publisher'] === true) { |
499 | 499 | $company = Company::find($publisher['company']); |
@@ -504,7 +504,7 @@ discard block |
||
504 | 504 | |
505 | 505 | $genres = []; |
506 | 506 | |
507 | - if (! empty($this->_gameResults->themes)) { |
|
507 | + if (!empty($this->_gameResults->themes)) { |
|
508 | 508 | foreach ($this->_gameResults->themes as $theme) { |
509 | 509 | $genres[] = $theme['name']; |
510 | 510 | } |
@@ -526,7 +526,7 @@ discard block |
||
526 | 526 | 'esrb' => isset($this->_gameResults->aggregated_rating) ? round($this->_gameResults->aggregated_rating).'%' : 'Not Rated', |
527 | 527 | 'url' => $this->_gameResults->url ?? '', |
528 | 528 | 'backdropurl' => isset($this->_gameResults->screenshots) ? 'https:'.str_replace('t_thumb', 't_cover_big', $this->_gameResults->screenshots[0]['url']) : '', |
529 | - 'publisher' => ! empty($publishers) ? implode(',', $publishers) : 'Unknown', |
|
529 | + 'publisher' => !empty($publishers) ? implode(',', $publishers) : 'Unknown', |
|
530 | 530 | ]; |
531 | 531 | } else { |
532 | 532 | $this->colorCli->notice('IGDB returned no valid results'); |
@@ -560,20 +560,20 @@ discard block |
||
560 | 560 | } else { |
561 | 561 | $game['backdrop'] = 0; |
562 | 562 | } |
563 | - if (! isset($game['trailer'])) { |
|
563 | + if (!isset($game['trailer'])) { |
|
564 | 564 | $game['trailer'] = 0; |
565 | 565 | } |
566 | 566 | if (empty($game['title'])) { |
567 | 567 | $game['title'] = $gameInfo['title']; |
568 | 568 | } |
569 | - if (! isset($game['releasedate'])) { |
|
569 | + if (!isset($game['releasedate'])) { |
|
570 | 570 | $game['releasedate'] = ''; |
571 | 571 | } |
572 | 572 | |
573 | 573 | if ($game['releasedate'] === '') { |
574 | 574 | $game['releasedate'] = ''; |
575 | 575 | } |
576 | - if (! isset($game['review'])) { |
|
576 | + if (!isset($game['review'])) { |
|
577 | 577 | $game['review'] = 'No Review'; |
578 | 578 | } |
579 | 579 | $game['classused'] = $this->_classUsed; |
@@ -591,7 +591,7 @@ discard block |
||
591 | 591 | $game['gamesgenre'] = $genreName; |
592 | 592 | $game['gamesgenreID'] = $genreKey; |
593 | 593 | |
594 | - if (! empty($game['asin'])) { |
|
594 | + if (!empty($game['asin'])) { |
|
595 | 595 | $check = GamesInfo::query()->where('asin', $game['asin'])->first(); |
596 | 596 | if ($check === null) { |
597 | 597 | $gamesId = GamesInfo::query() |
@@ -636,7 +636,7 @@ discard block |
||
636 | 636 | } |
637 | 637 | } |
638 | 638 | |
639 | - if (! empty($gamesId)) { |
|
639 | + if (!empty($gamesId)) { |
|
640 | 640 | if ($this->echoOutput) { |
641 | 641 | $this->colorCli->header('Added/updated game: '). |
642 | 642 | $this->colorCli->alternateOver(' Title: '). |
@@ -655,7 +655,7 @@ discard block |
||
655 | 655 | $this->colorCli->primary($game['title'].' (PC)'); |
656 | 656 | } |
657 | 657 | |
658 | - return ! empty($gamesId) ? $gamesId : false; |
|
658 | + return !empty($gamesId) ? $gamesId : false; |
|
659 | 659 | } |
660 | 660 | |
661 | 661 | /** |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | %s %s %s %s |
154 | 154 | GROUP BY xxx.id |
155 | 155 | ORDER BY %s %s", |
156 | - (! empty($xxxIDs) ? implode(',', $xxxIDs) : -1), |
|
156 | + (!empty($xxxIDs) ? implode(',', $xxxIDs) : -1), |
|
157 | 157 | $this->showPasswords, |
158 | 158 | $this->getBrowseBy(), |
159 | 159 | $catSrch, |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | $order[1] |
168 | 168 | ); |
169 | 169 | |
170 | - return Cache::flexible($sql.$page, [config('nntmux.cache_expiry_medium'), config('nntmux.cache_expiry_long')], function () use ($sql, $xxxmovies) { |
|
170 | + return Cache::flexible($sql.$page, [config('nntmux.cache_expiry_medium'), config('nntmux.cache_expiry_long')], function() use ($sql, $xxxmovies) { |
|
171 | 171 | $return = DB::select($sql); |
172 | 172 | if (\count($return) > 0) { |
173 | 173 | $return[0]->_totalcount = $xxxmovies['total'][0]->total ?? 0; |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | { |
204 | 204 | $browseBy = ' '; |
205 | 205 | foreach (['title', 'director', 'actors', 'genre', 'id'] as $bb) { |
206 | - if (! empty($_REQUEST[$bb])) { |
|
206 | + if (!empty($_REQUEST[$bb])) { |
|
207 | 207 | $bbv = stripslashes($_REQUEST[$bb]); |
208 | 208 | if ($bb === 'genre') { |
209 | 209 | $bbv = $this->getGenreID($bbv); |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | string $cover = '', |
239 | 239 | string $backdrop = '' |
240 | 240 | ): void { |
241 | - if (! empty($id)) { |
|
241 | + if (!empty($id)) { |
|
242 | 242 | XxxInfo::query()->where('id', $id)->update( |
243 | 243 | [ |
244 | 244 | 'title' => $title, |
@@ -277,12 +277,12 @@ discard block |
||
277 | 277 | public function getGenres(bool $activeOnly = false, $gid = null): mixed |
278 | 278 | { |
279 | 279 | if ($activeOnly) { |
280 | - return Genre::query()->where(['disabled' => 0, 'type' => Category::XXX_ROOT])->when($gid !== null, function ($query) use ($gid) { |
|
280 | + return Genre::query()->where(['disabled' => 0, 'type' => Category::XXX_ROOT])->when($gid !== null, function($query) use ($gid) { |
|
281 | 281 | return $query->where('id', $gid); |
282 | 282 | })->orderBy('title')->first(['title']); |
283 | 283 | } |
284 | 284 | |
285 | - return Genre::query()->where(['type' => Category::XXX_ROOT])->when($gid !== null, function ($query) use ($gid) { |
|
285 | + return Genre::query()->where(['type' => Category::XXX_ROOT])->when($gid !== null, function($query) use ($gid) { |
|
286 | 286 | return $query->where('id', $gid); |
287 | 287 | })->orderBy('title')->first(['title']); |
288 | 288 | } |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | { |
298 | 298 | $ret = null; |
299 | 299 | |
300 | - if (! \is_array($arr)) { |
|
300 | + if (!\is_array($arr)) { |
|
301 | 301 | $res = Genre::query()->where('title', $arr)->first(['id']); |
302 | 302 | if ($res !== null) { |
303 | 303 | return $res['id']; |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | public function insertSwf($whichClass, $res): string |
338 | 338 | { |
339 | 339 | $ret = ''; |
340 | - if (($whichClass === 'ade') && ! empty($res)) { |
|
340 | + if (($whichClass === 'ade') && !empty($res)) { |
|
341 | 341 | $trailers = unserialize($res, 'ade'); |
342 | 342 | $ret .= "<object width='360' height='240' type='application/x-shockwave-flash' id='EmpireFlashPlayer' name='EmpireFlashPlayer' data='".$trailers['url']."'>"; |
343 | 343 | $ret .= "<param name='flashvars' value= 'streamID=".$trailers['streamid'].'&autoPlay=false&BaseStreamingUrl='.$trailers['baseurl']."'>"; |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | |
346 | 346 | return $ret; |
347 | 347 | } |
348 | - if (($whichClass === 'pop') && ! empty($res)) { |
|
348 | + if (($whichClass === 'pop') && !empty($res)) { |
|
349 | 349 | $trailers = unserialize($res, 'pop'); |
350 | 350 | $ret .= "<embed id='trailer' width='480' height='360'"; |
351 | 351 | $ret .= "flashvars='".$trailers['flashvars']."' allowfullscreen='true' allowscriptaccess='always' quality='high' name='trailer' style='undefined'"; |
@@ -422,22 +422,22 @@ discard block |
||
422 | 422 | return -2; |
423 | 423 | } |
424 | 424 | |
425 | - $res['cast'] = ! empty($res['cast']) ? implode(',', $res['cast']) : ''; |
|
426 | - $res['genres'] = ! empty($res['genres']) ? $this->getGenreID($res['genres']) : ''; |
|
425 | + $res['cast'] = !empty($res['cast']) ? implode(',', $res['cast']) : ''; |
|
426 | + $res['genres'] = !empty($res['genres']) ? $this->getGenreID($res['genres']) : ''; |
|
427 | 427 | |
428 | 428 | $mov = [ |
429 | - 'trailers' => ! empty($res['trailers']) ? serialize($res['trailers']) : '', |
|
430 | - 'extras' => ! empty($res['extras']) ? serialize($res['extras']) : '', |
|
431 | - 'productinfo' => ! empty($res['productinfo']) ? serialize($res['productinfo']) : '', |
|
432 | - 'backdrop' => ! empty($res['backcover']) ? $res['backcover'] : 0, |
|
433 | - 'cover' => ! empty($res['boxcover']) ? $res['boxcover'] : 0, |
|
434 | - 'title' => ! empty($res['title']) ? html_entity_decode($res['title'], ENT_QUOTES, 'UTF-8') : '', |
|
435 | - 'plot' => ! empty($res['synopsis']) ? html_entity_decode($res['synopsis'], ENT_QUOTES, 'UTF-8') : '', |
|
436 | - 'tagline' => ! empty($res['tagline']) ? html_entity_decode($res['tagline'], ENT_QUOTES, 'UTF-8') : '', |
|
437 | - 'genre' => ! empty($res['genres']) ? html_entity_decode($res['genres'], ENT_QUOTES, 'UTF-8') : '', |
|
438 | - 'director' => ! empty($res['director']) ? html_entity_decode($res['director'], ENT_QUOTES, 'UTF-8') : '', |
|
439 | - 'actors' => ! empty($res['cast']) ? html_entity_decode($res['cast'], ENT_QUOTES, 'UTF-8') : '', |
|
440 | - 'directurl' => ! empty($res['directurl']) ? html_entity_decode($res['directurl'], ENT_QUOTES, 'UTF-8') : '', |
|
429 | + 'trailers' => !empty($res['trailers']) ? serialize($res['trailers']) : '', |
|
430 | + 'extras' => !empty($res['extras']) ? serialize($res['extras']) : '', |
|
431 | + 'productinfo' => !empty($res['productinfo']) ? serialize($res['productinfo']) : '', |
|
432 | + 'backdrop' => !empty($res['backcover']) ? $res['backcover'] : 0, |
|
433 | + 'cover' => !empty($res['boxcover']) ? $res['boxcover'] : 0, |
|
434 | + 'title' => !empty($res['title']) ? html_entity_decode($res['title'], ENT_QUOTES, 'UTF-8') : '', |
|
435 | + 'plot' => !empty($res['synopsis']) ? html_entity_decode($res['synopsis'], ENT_QUOTES, 'UTF-8') : '', |
|
436 | + 'tagline' => !empty($res['tagline']) ? html_entity_decode($res['tagline'], ENT_QUOTES, 'UTF-8') : '', |
|
437 | + 'genre' => !empty($res['genres']) ? html_entity_decode($res['genres'], ENT_QUOTES, 'UTF-8') : '', |
|
438 | + 'director' => !empty($res['director']) ? html_entity_decode($res['director'], ENT_QUOTES, 'UTF-8') : '', |
|
439 | + 'actors' => !empty($res['cast']) ? html_entity_decode($res['cast'], ENT_QUOTES, 'UTF-8') : '', |
|
440 | + 'directurl' => !empty($res['directurl']) ? html_entity_decode($res['directurl'], ENT_QUOTES, 'UTF-8') : '', |
|
441 | 441 | 'classused' => $this->whichClass, |
442 | 442 | ]; |
443 | 443 | |
@@ -447,12 +447,12 @@ discard block |
||
447 | 447 | $xxxID = $check['id']; |
448 | 448 | |
449 | 449 | // Update BoxCover. |
450 | - if (! empty($mov['cover'])) { |
|
450 | + if (!empty($mov['cover'])) { |
|
451 | 451 | $cover = $this->releaseImage->saveImage($xxxID.'-cover', $mov['cover'], $this->imgSavePath); |
452 | 452 | } |
453 | 453 | |
454 | 454 | // BackCover. |
455 | - if (! empty($mov['backdrop'])) { |
|
455 | + if (!empty($mov['backdrop'])) { |
|
456 | 456 | $backdrop = $this->releaseImage->saveImage($xxxID.'-backdrop', $mov['backdrop'], $this->imgSavePath, 1920, 1024); |
457 | 457 | } |
458 | 458 | |
@@ -480,12 +480,12 @@ discard block |
||
480 | 480 | ] |
481 | 481 | ); |
482 | 482 | // Update BoxCover. |
483 | - if (! empty($mov['cover'])) { |
|
483 | + if (!empty($mov['cover'])) { |
|
484 | 484 | $cover = $this->releaseImage->saveImage($xxxID.'-cover', $mov['cover'], $this->imgSavePath); |
485 | 485 | } |
486 | 486 | |
487 | 487 | // BackCover. |
488 | - if (! empty($mov['backdrop'])) { |
|
488 | + if (!empty($mov['backdrop'])) { |
|
489 | 489 | $backdrop = $this->releaseImage->saveImage($xxxID.'-backdrop', $mov['backdrop'], $this->imgSavePath, 1920, 1024); |
490 | 490 | } |
491 | 491 | |
@@ -598,7 +598,7 @@ discard block |
||
598 | 598 | $name = trim(preg_replace('/(brazilian|chinese|croatian|danish|deutsch|dutch|estonian|flemish|finnish|french|german|greek|hebrew|icelandic|italian|latin|nordic|norwegian|polish|portuguese|japenese|japanese|russian|serbian|slovenian|spanish|spanisch|swedish|thai|turkish)$/i', '', $name)); |
599 | 599 | |
600 | 600 | // Check if the name is long enough and not just numbers and not file (d) of (d) and does not contain Episodes and any dated 00.00.00 which are site rips.. |
601 | - if (\strlen($name) > 5 && ! preg_match('/^\d+$/', $name) && ! preg_match('/( File \d+ of \d+|\d+.\d+.\d+)/', $name) && ! preg_match('/(E\d+)/', $name) && ! preg_match('/\d\d\.\d\d.\d\d/', $name)) { |
|
601 | + if (\strlen($name) > 5 && !preg_match('/^\d+$/', $name) && !preg_match('/( File \d+ of \d+|\d+.\d+.\d+)/', $name) && !preg_match('/(E\d+)/', $name) && !preg_match('/\d\d\.\d\d.\d\d/', $name)) { |
|
602 | 602 | $this->currentTitle = $name; |
603 | 603 | |
604 | 604 | return true; |