@@ -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; |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | public static function updateRelease($id, $name, $searchName, $fromName, $categoryId, $parts, $grabs, $size, $postedDate, $addedDate, $videoId, $episodeId, $imDbId, $aniDbId): void |
| 145 | 145 | { |
| 146 | 146 | $movieInfoId = null; |
| 147 | - if (! empty($imDbId)) { |
|
| 147 | + if (!empty($imDbId)) { |
|
| 148 | 148 | $movieInfoId = MovieInfo::whereImdbid($imDbId)->first(['id']); |
| 149 | 149 | } |
| 150 | 150 | self::whereId($id)->update( |
@@ -337,7 +337,7 @@ discard block |
||
| 337 | 337 | |
| 338 | 338 | $releases = $query->get(); |
| 339 | 339 | |
| 340 | - $releases->each(function ($release) { |
|
| 340 | + $releases->each(function($release) { |
|
| 341 | 341 | $release->group_name = $release->group->name ?? null; |
| 342 | 342 | $release->showtitle = $release->video->title ?? null; |
| 343 | 343 | $release->tvdb = $release->video->tvdb ?? null; |
@@ -389,12 +389,12 @@ discard block |
||
| 389 | 389 | |
| 390 | 390 | preg_match('/(^\w+[-_. ].+?\.(\d+p)).+/i', $rel['searchname'], $similar); |
| 391 | 391 | |
| 392 | - if (! empty($similar)) { |
|
| 392 | + if (!empty($similar)) { |
|
| 393 | 393 | if (config('nntmux.elasticsearch_enabled') === true) { |
| 394 | 394 | $searchResult = (new ElasticSearchSiteSearch)->indexSearch($similar[1], 10); |
| 395 | 395 | } else { |
| 396 | 396 | $searchResult = (new ManticoreSearch)->searchIndexes('releases_rt', $similar[1]); |
| 397 | - if (! empty($searchResult)) { |
|
| 397 | + if (!empty($searchResult)) { |
|
| 398 | 398 | $searchResult = Arr::wrap(Arr::get($searchResult, 'id')); |
| 399 | 399 | } |
| 400 | 400 | } |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | if (empty($email) && empty($rssToken)) { |
| 44 | 44 | app('smarty.view')->assign('error', 'Missing parameter (email and/or apikey) to send password reset'); |
| 45 | 45 | } else { |
| 46 | - if (config('captcha.enabled') === true && (! empty(config('captcha.secret')) && ! empty(config('captcha.sitekey')))) { |
|
| 46 | + if (config('captcha.enabled') === true && (!empty(config('captcha.secret')) && !empty(config('captcha.sitekey')))) { |
|
| 47 | 47 | $validate = Validator::make($request->all(), [ |
| 48 | 48 | 'g-recaptcha-response' => 'required|captcha', |
| 49 | 49 | ]); |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | // |
| 55 | 55 | // Check users exists and send an email |
| 56 | 56 | // |
| 57 | - $ret = ! empty($rssToken) ? User::getByRssToken($rssToken) : User::getByEmail($email); |
|
| 57 | + $ret = !empty($rssToken) ? User::getByRssToken($rssToken) : User::getByEmail($email); |
|
| 58 | 58 | if ($ret === null) { |
| 59 | 59 | app('smarty.view')->assign('error', 'The email or apikey are not recognised.'); |
| 60 | 60 | } else { |