@@ -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 { |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | use Symfony\Component\Process\Process; |
| 17 | 17 | use Zip as ZipStream; |
| 18 | 18 | |
| 19 | -if (! function_exists('getRawHtml')) { |
|
| 19 | +if (!function_exists('getRawHtml')) { |
|
| 20 | 20 | /** |
| 21 | 21 | * @param bool $cookie |
| 22 | 22 | * @return bool|mixed|string |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | } |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | -if (! function_exists('makeFieldLinks')) { |
|
| 54 | +if (!function_exists('makeFieldLinks')) { |
|
| 55 | 55 | /** |
| 56 | 56 | * @return string |
| 57 | 57 | * |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | } |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | -if (! function_exists('getUserBrowseOrder')) { |
|
| 84 | +if (!function_exists('getUserBrowseOrder')) { |
|
| 85 | 85 | /** |
| 86 | 86 | * @param string $orderBy |
| 87 | 87 | */ |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | } |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | -if (! function_exists('getUserBrowseOrdering')) { |
|
| 110 | +if (!function_exists('getUserBrowseOrdering')) { |
|
| 111 | 111 | function getUserBrowseOrdering(): array |
| 112 | 112 | { |
| 113 | 113 | return [ |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | } |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | -if (! function_exists('getSimilarName')) { |
|
| 140 | +if (!function_exists('getSimilarName')) { |
|
| 141 | 141 | /** |
| 142 | 142 | * @param string $name |
| 143 | 143 | */ |
@@ -147,14 +147,14 @@ discard block |
||
| 147 | 147 | } |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | -if (! function_exists('color')) { |
|
| 150 | +if (!function_exists('color')) { |
|
| 151 | 151 | function color(string $string = ''): Color |
| 152 | 152 | { |
| 153 | 153 | return new Color($string); |
| 154 | 154 | } |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | -if (! function_exists('human_filesize')) { |
|
| 157 | +if (!function_exists('human_filesize')) { |
|
| 158 | 158 | /** |
| 159 | 159 | * @param int $decimals |
| 160 | 160 | */ |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | } |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | -if (! function_exists('bcdechex')) { |
|
| 170 | +if (!function_exists('bcdechex')) { |
|
| 171 | 171 | /** |
| 172 | 172 | * @return string |
| 173 | 173 | */ |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | } |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | -if (! function_exists('runCmd')) { |
|
| 187 | +if (!function_exists('runCmd')) { |
|
| 188 | 188 | /** |
| 189 | 189 | * Run CLI command. |
| 190 | 190 | * |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | } |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | -if (! function_exists('escapeString')) { |
|
| 215 | +if (!function_exists('escapeString')) { |
|
| 216 | 216 | /** |
| 217 | 217 | * @return string |
| 218 | 218 | */ |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | } |
| 223 | 223 | } |
| 224 | 224 | |
| 225 | -if (! function_exists('realDuration')) { |
|
| 225 | +if (!function_exists('realDuration')) { |
|
| 226 | 226 | /** |
| 227 | 227 | * @return string |
| 228 | 228 | */ |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | } |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | -if (! function_exists('is_it_json')) { |
|
| 237 | +if (!function_exists('is_it_json')) { |
|
| 238 | 238 | /** |
| 239 | 239 | * @param array|string $isIt |
| 240 | 240 | * @return bool |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | return $zipped; |
| 278 | 278 | } |
| 279 | 279 | |
| 280 | -if (! function_exists('release_flag')) { |
|
| 280 | +if (!function_exists('release_flag')) { |
|
| 281 | 281 | // Function inspired by c0r3@newznabforums adds country flags on the browse page. |
| 282 | 282 | /** |
| 283 | 283 | * @param string $text Text to match against. |
@@ -413,10 +413,10 @@ discard block |
||
| 413 | 413 | |
| 414 | 414 | return ''; |
| 415 | 415 | } |
| 416 | - if (! function_exists('sanitize')) { |
|
| 416 | + if (!function_exists('sanitize')) { |
|
| 417 | 417 | function sanitize(array|string $phrases, array $doNotSanitize = []): string |
| 418 | 418 | { |
| 419 | - if (! is_array($phrases)) { |
|
| 419 | + if (!is_array($phrases)) { |
|
| 420 | 420 | $wordArray = explode(' ', str_replace('.', ' ', $phrases)); |
| 421 | 421 | } else { |
| 422 | 422 | $wordArray = $phrases; |
@@ -427,9 +427,9 @@ discard block |
||
| 427 | 427 | foreach ($wordArray as $words) { |
| 428 | 428 | $words = preg_split('/\s+/', $words); |
| 429 | 429 | foreach ($words as $st) { |
| 430 | - if (Str::startsWith($st, ['!', '+', '-', '?', '*']) && Str::length($st) > 1 && ! preg_match('/([!+?\-*]){2,}/', $st)) { |
|
| 430 | + if (Str::startsWith($st, ['!', '+', '-', '?', '*']) && Str::length($st) > 1 && !preg_match('/([!+?\-*]){2,}/', $st)) { |
|
| 431 | 431 | $str = $st; |
| 432 | - } elseif (Str::endsWith($st, ['+', '-', '?', '*']) && Str::length($st) > 1 && ! preg_match('/([!+?\-*]){2,}/', $st)) { |
|
| 432 | + } elseif (Str::endsWith($st, ['+', '-', '?', '*']) && Str::length($st) > 1 && !preg_match('/([!+?\-*]){2,}/', $st)) { |
|
| 433 | 433 | $str = $st; |
| 434 | 434 | } else { |
| 435 | 435 | $str = Sanitizer::escape($st, $doNotSanitize); |