@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | $releases = new Releases; |
| 118 | 118 | |
| 119 | 119 | // Set Query Parameters based on Request objects |
| 120 | - $outputXML = ! ($request->has('o') && $request->input('o') === 'json'); |
|
| 120 | + $outputXML = !($request->has('o') && $request->input('o') === 'json'); |
|
| 121 | 121 | $minSize = $request->has('minsize') && $request->input('minsize') > 0 ? $request->input('minsize') : 0; |
| 122 | 122 | $offset = $this->offset($request); |
| 123 | 123 | |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | |
| 259 | 259 | $this->addCoverURL( |
| 260 | 260 | $relData, |
| 261 | - function ($release) { |
|
| 261 | + function($release) { |
|
| 262 | 262 | return Utility::getCoverURL(['type' => 'movies', 'id' => $release->imdbid]); |
| 263 | 263 | } |
| 264 | 264 | ); |
@@ -300,9 +300,9 @@ discard block |
||
| 300 | 300 | |
| 301 | 301 | if ($rel && $rel->isNotEmpty()) { |
| 302 | 302 | $data = ReleaseNfo::getReleaseNfo($rel->id); |
| 303 | - if (! empty($data)) { |
|
| 303 | + if (!empty($data)) { |
|
| 304 | 304 | if ($request->has('o') && $request->input('o') === 'file') { |
| 305 | - return response()->streamDownload(function () use ($data) { |
|
| 305 | + return response()->streamDownload(function() use ($data) { |
|
| 306 | 306 | echo $data['nfo']; |
| 307 | 307 | }, $rel['searchname'].'.nfo', ['Content-type:' => 'application/octet-stream']); |
| 308 | 308 | } |
@@ -344,7 +344,7 @@ discard block |
||
| 344 | 344 | header('Content-type: text/xml'); |
| 345 | 345 | } else { |
| 346 | 346 | // JSON encode the XMLWriter response |
| 347 | - $response = json_encode(xml_to_array($response), JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT + JSON_UNESCAPED_SLASHES); |
|
| 347 | + $response = json_encode(xml_to_array($response), JSON_THROW_ON_ERROR|JSON_PRETTY_PRINT + JSON_UNESCAPED_SLASHES); |
|
| 348 | 348 | header('Content-type: application/json'); |
| 349 | 349 | } |
| 350 | 350 | if ($response === false) { |
@@ -387,7 +387,7 @@ discard block |
||
| 387 | 387 | 'search' => ['available' => 'yes', 'supportedParams' => 'q'], |
| 388 | 388 | 'tv-search' => ['available' => 'yes', 'supportedParams' => 'q,vid,tvdbid,traktid,rid,tvmazeid,imdbid,tmdbid,season,ep'], |
| 389 | 389 | 'movie-search' => ['available' => 'yes', 'supportedParams' => 'q,imdbid, tmdbid, traktid'], |
| 390 | - 'audio-search' => ['available' => 'no', 'supportedParams' => ''], |
|
| 390 | + 'audio-search' => ['available' => 'no', 'supportedParams' => ''], |
|
| 391 | 391 | ], |
| 392 | 392 | 'categories' => $this->type === 'caps' |
| 393 | 393 | ? Category::getForMenu() |
@@ -402,9 +402,9 @@ discard block |
||
| 402 | 402 | { |
| 403 | 403 | $maxAge = -1; |
| 404 | 404 | if ($request->has('maxage')) { |
| 405 | - if (! $request->filled('maxage')) { |
|
| 405 | + if (!$request->filled('maxage')) { |
|
| 406 | 406 | return Utility::showApiError(201, 'Incorrect parameter (maxage must not be empty)'); |
| 407 | - } elseif (! is_numeric($request->input('maxage'))) { |
|
| 407 | + } elseif (!is_numeric($request->input('maxage'))) { |
|
| 408 | 408 | return Utility::showApiError(201, 'Incorrect parameter (maxage must be numeric)'); |
| 409 | 409 | } else { |
| 410 | 410 | $maxAge = (int) $request->input('maxage'); |
@@ -423,7 +423,7 @@ discard block |
||
| 423 | 423 | if ($request->has('cat')) { |
| 424 | 424 | $categoryIDs = urldecode($request->input('cat')); |
| 425 | 425 | // Append Web-DL category ID if HD present for SickBeard / Sonarr compatibility. |
| 426 | - if (str_contains($categoryIDs, (string) Category::TV_HD) && ! str_contains($categoryIDs, (string) Category::TV_WEBDL) && (int) Settings::settingValue('catwebdl') === 0) { |
|
| 426 | + if (str_contains($categoryIDs, (string) Category::TV_HD) && !str_contains($categoryIDs, (string) Category::TV_WEBDL) && (int) Settings::settingValue('catwebdl') === 0) { |
|
| 427 | 427 | $categoryIDs .= (','.Category::TV_WEBDL); |
| 428 | 428 | } |
| 429 | 429 | $categoryID = explode(',', $categoryIDs); |
@@ -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 | } |