@@ -53,8 +53,8 @@ discard block |
||
| 53 | 53 | } |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - if (! $yesMode) { |
|
| 57 | - if (! $this->confirm('Are you sure you want to install NNTmux? This will wipe your database!!')) { |
|
| 56 | + if (!$yesMode) { |
|
| 57 | + if (!$this->confirm('Are you sure you want to install NNTmux? This will wipe your database!!')) { |
|
| 58 | 58 | $this->info('Installation aborted by user.'); |
| 59 | 59 | exit; |
| 60 | 60 | } |
@@ -97,33 +97,33 @@ discard block |
||
| 97 | 97 | $zip_path = config('nntmux_settings.tmp_unzip_path'); |
| 98 | 98 | $unrar_path = config('nntmux.tmp_unrar_path'); |
| 99 | 99 | |
| 100 | - if (! File::isWritable($nzb_path)) { |
|
| 100 | + if (!File::isWritable($nzb_path)) { |
|
| 101 | 101 | $this->warn($nzb_path.' is not writable. Please fix folder permissions'); |
| 102 | 102 | |
| 103 | 103 | return false; |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | - if (! file_exists($unrar_path)) { |
|
| 106 | + if (!file_exists($unrar_path)) { |
|
| 107 | 107 | $this->info('Creating missing '.$unrar_path.' folder'); |
| 108 | - if (! @File::makeDirectory($unrar_path) && ! File::isDirectory($unrar_path)) { |
|
| 108 | + if (!@File::makeDirectory($unrar_path) && !File::isDirectory($unrar_path)) { |
|
| 109 | 109 | throw new \RuntimeException('Unable to create '.$unrar_path.' folder'); |
| 110 | 110 | } |
| 111 | 111 | $this->info('Folder '.$unrar_path.' successfully created'); |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | - if (! is_writable($unrar_path)) { |
|
| 114 | + if (!is_writable($unrar_path)) { |
|
| 115 | 115 | $this->warn($unrar_path.' is not writable. Please fix folder permissions'); |
| 116 | 116 | |
| 117 | 117 | return false; |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | - if (! File::isWritable($covers_path)) { |
|
| 120 | + if (!File::isWritable($covers_path)) { |
|
| 121 | 121 | $this->warn($covers_path.' is not writable. Please fix folder permissions'); |
| 122 | 122 | |
| 123 | 123 | return false; |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | - if (! File::isWritable($zip_path)) { |
|
| 126 | + if (!File::isWritable($zip_path)) { |
|
| 127 | 127 | $this->warn($zip_path.' is not writable. Please fix folder permissions'); |
| 128 | 128 | |
| 129 | 129 | return false; |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | $meta_title = 'Browse Groups'; |
| 28 | 28 | $meta_keywords = 'browse,groups,description,details'; |
| 29 | 29 | $meta_description = 'Browse groups'; |
| 30 | - if (! empty($search)) { |
|
| 30 | + if (!empty($search)) { |
|
| 31 | 31 | $meta_title .= ' - Search: '.$search; |
| 32 | 32 | $meta_description = 'Browse groups search results for '.$search; |
| 33 | 33 | } |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | public static function updateRelease($id, $name, $searchName, $fromName, $categoryId, $parts, $grabs, $size, $postedDate, $addedDate, $videoId, $episodeId, $imDbId, $aniDbId): void |
| 156 | 156 | { |
| 157 | 157 | $movieInfoId = null; |
| 158 | - if (! empty($imDbId)) { |
|
| 158 | + if (!empty($imDbId)) { |
|
| 159 | 159 | $movieInfoId = MovieInfo::whereImdbid($imDbId)->first(['id']); |
| 160 | 160 | } |
| 161 | 161 | self::whereId($id)->update( |
@@ -349,7 +349,7 @@ discard block |
||
| 349 | 349 | |
| 350 | 350 | $releases = $query->get(); |
| 351 | 351 | |
| 352 | - $releases->each(function ($release) { |
|
| 352 | + $releases->each(function($release) { |
|
| 353 | 353 | $release->group_name = $release->group->name ?? null; |
| 354 | 354 | $release->showtitle = $release->video->title ?? null; |
| 355 | 355 | $release->tvdb = $release->video->tvdb ?? null; |
@@ -366,7 +366,7 @@ discard block |
||
| 366 | 366 | $release->sub_category = $release->category->title ?? null; |
| 367 | 367 | $release->category_name = $release->parent_category.' > '.$release->sub_category; |
| 368 | 368 | $release->category_ids = $release->category->parentid.','.$release->category->id; |
| 369 | - $release->group_names = $release->releaseGroup->map(function ($relGroup) { |
|
| 369 | + $release->group_names = $release->releaseGroup->map(function($relGroup) { |
|
| 370 | 370 | return $relGroup->group->name; |
| 371 | 371 | })->implode(','); |
| 372 | 372 | }); |
@@ -403,12 +403,12 @@ discard block |
||
| 403 | 403 | |
| 404 | 404 | preg_match('/(^\w+[-_. ].+?\.(\d+p)).+/i', $rel['searchname'], $similar); |
| 405 | 405 | |
| 406 | - if (! empty($similar)) { |
|
| 406 | + if (!empty($similar)) { |
|
| 407 | 407 | if (config('nntmux.elasticsearch_enabled') === true) { |
| 408 | 408 | $searchResult = (new ElasticSearchSiteSearch)->indexSearch($similar[1], 10); |
| 409 | 409 | } else { |
| 410 | 410 | $searchResult = (new ManticoreSearch)->searchIndexes('releases_rt', $similar[1]); |
| 411 | - if (! empty($searchResult)) { |
|
| 411 | + if (!empty($searchResult)) { |
|
| 412 | 412 | $searchResult = Arr::wrap(Arr::get($searchResult, 'id')); |
| 413 | 413 | } |
| 414 | 414 | } |
@@ -50,8 +50,7 @@ |
||
| 50 | 50 | if ($method === '7' || $method === '8') { |
| 51 | 51 | $compressedHeaders = config('nntmux_nntp.compressed_headers'); |
| 52 | 52 | if ((config('nntmux_nntp.use_alternate_nntp_server') === true ? |
| 53 | - $nntp->doConnect($compressedHeaders, true) : |
|
| 54 | - $nntp->doConnect()) !== true) { |
|
| 53 | + $nntp->doConnect($compressedHeaders, true) : $nntp->doConnect()) !== true) { |
|
| 55 | 54 | $this->error('Unable to connect to usenet.'); |
| 56 | 55 | |
| 57 | 56 | return 1; |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | $limit = $this->argument('limit'); |
| 35 | 35 | |
| 36 | 36 | // Validate the limit argument |
| 37 | - if ($limit !== 'full' && ! is_numeric($limit)) { |
|
| 37 | + if ($limit !== 'full' && !is_numeric($limit)) { |
|
| 38 | 38 | $this->error('Limit must be "full" or a numeric value.'); |
| 39 | 39 | |
| 40 | 40 | return 1; |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | |
| 96 | 96 | // Create each index |
| 97 | 97 | foreach ($indexes as $indexName => $schema) { |
| 98 | - if (! $this->createIndex($indexName, $schema, $dropExisting)) { |
|
| 98 | + if (!$this->createIndex($indexName, $schema, $dropExisting)) { |
|
| 99 | 99 | $hasErrors = true; |
| 100 | 100 | } |
| 101 | 101 | } |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | $indices->drop(['index' => $indexName, 'body' => ['silent' => true]]); |
| 128 | 128 | $this->info("Successfully dropped {$indexName} index."); |
| 129 | 129 | } catch (ResponseException $e) { |
| 130 | - if (! str_contains($e->getMessage(), 'unknown index')) { |
|
| 130 | + if (!str_contains($e->getMessage(), 'unknown index')) { |
|
| 131 | 131 | $this->warn("Warning when dropping {$indexName} index: ".$e->getMessage()); |
| 132 | 132 | } |
| 133 | 133 | } |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | ]); |
| 30 | 30 | |
| 31 | 31 | // Check if password is correct |
| 32 | - if (! Hash::check($validated['current_password'], Auth::user()->password)) { |
|
| 32 | + if (!Hash::check($validated['current_password'], Auth::user()->password)) { |
|
| 33 | 33 | if ($request->expectsJson() || $request->ajax()) { |
| 34 | 34 | return response()->json([ |
| 35 | 35 | 'success' => false, |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | User::onlyTrashed() |
| 35 | 35 | ->where('deleted_at', '<', now()->subDays(config('nntmux.purge_inactive_users_days'))) |
| 36 | 36 | ->get() |
| 37 | - ->each(function ($user) { |
|
| 37 | + ->each(function($user) { |
|
| 38 | 38 | $user->forceDelete(); // Permanently delete the user |
| 39 | 39 | }); |
| 40 | 40 | } |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | // Add country data to each user based on their host IP |
| 58 | 58 | foreach ($results as $user) { |
| 59 | 59 | $position = null; |
| 60 | - if (! empty($user->host) && filter_var($user->host, FILTER_VALIDATE_IP)) { |
|
| 60 | + if (!empty($user->host) && filter_var($user->host, FILTER_VALIDATE_IP)) { |
|
| 61 | 61 | $position = Location::get($user->host); |
| 62 | 62 | } |
| 63 | 63 | $user->country_name = $position ? $position->countryName : null; |