@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | $silent = $this->option('quiet'); |
| 38 | 38 | $debug = $this->option('debug'); |
| 39 | 39 | |
| 40 | - if (! $silent) { |
|
| 40 | + if (!$silent) { |
|
| 41 | 41 | $this->info('Starting IRC Scraper...'); |
| 42 | 42 | if ($debug) { |
| 43 | 43 | $this->warn('Debug mode enabled'); |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | return self::SUCCESS; |
| 51 | 51 | } catch (\Exception $e) { |
| 52 | - if (! $silent) { |
|
| 52 | + if (!$silent) { |
|
| 53 | 53 | $this->error($e->getMessage()); |
| 54 | 54 | } |
| 55 | 55 | |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | $blacklistId = $this->option('blacklist-id') ?? ''; |
| 28 | 28 | $delete = $this->option('delete'); |
| 29 | 29 | |
| 30 | - if (! $delete) { |
|
| 30 | + if (!$delete) { |
|
| 31 | 31 | $this->warn('Running in DRY-RUN mode. Use --delete to actually remove releases.'); |
| 32 | 32 | } |
| 33 | 33 | |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | // Handle fix_crap checkbox array - convert to comma-separated string |
| 26 | 26 | if (isset($data['fix_crap']) && is_array($data['fix_crap'])) { |
| 27 | 27 | $data['fix_crap'] = implode(',', $data['fix_crap']); |
| 28 | - } elseif (! isset($data['fix_crap'])) { |
|
| 28 | + } elseif (!isset($data['fix_crap'])) { |
|
| 29 | 29 | // If no checkboxes selected, save empty string |
| 30 | 30 | $data['fix_crap'] = ''; |
| 31 | 31 | } |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | |
| 54 | 54 | // Parse fix_crap setting into an array |
| 55 | 55 | $fixCrapSetting = $this->runVar['settings']['fix_crap'] ?? ''; |
| 56 | - $fixCrapTypes = ! empty($fixCrapSetting) |
|
| 56 | + $fixCrapTypes = !empty($fixCrapSetting) |
|
| 57 | 57 | ? (is_array($fixCrapSetting) ? $fixCrapSetting : explode(',', $fixCrapSetting)) |
| 58 | 58 | : []; |
| 59 | 59 | $fixCrapTypes = array_filter($fixCrapTypes); |
@@ -34,13 +34,13 @@ |
||
| 34 | 34 | $renamed = $this->argument('renamed') ?? ''; |
| 35 | 35 | $mode = $this->option('mode') ?? 'pipeline'; |
| 36 | 36 | |
| 37 | - if (! $this->isValidChar($guid)) { |
|
| 37 | + if (!$this->isValidChar($guid)) { |
|
| 38 | 38 | $this->error('GUID character must be a-f or 0-9.'); |
| 39 | 39 | |
| 40 | 40 | return self::FAILURE; |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | - if (! in_array($mode, ['pipeline', 'parallel'], true)) { |
|
| 43 | + if (!in_array($mode, ['pipeline', 'parallel'], true)) { |
|
| 44 | 44 | $this->error('Mode must be either "pipeline" or "parallel".'); |
| 45 | 45 | |
| 46 | 46 | return self::FAILURE; |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | use Symfony\Component\Process\Process; |
| 16 | 16 | use Zip as ZipStream; |
| 17 | 17 | |
| 18 | -if (! function_exists('getRawHtml')) { |
|
| 18 | +if (!function_exists('getRawHtml')) { |
|
| 19 | 19 | /** |
| 20 | 20 | * @param bool $cookie |
| 21 | 21 | * @return bool|mixed|string |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | } |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | -if (! function_exists('makeFieldLinks')) { |
|
| 53 | +if (!function_exists('makeFieldLinks')) { |
|
| 54 | 54 | /** |
| 55 | 55 | * @return string |
| 56 | 56 | * |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | } |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | -if (! function_exists('getUserBrowseOrder')) { |
|
| 83 | +if (!function_exists('getUserBrowseOrder')) { |
|
| 84 | 84 | /** |
| 85 | 85 | * @param string $orderBy |
| 86 | 86 | */ |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | } |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | -if (! function_exists('getUserBrowseOrdering')) { |
|
| 109 | +if (!function_exists('getUserBrowseOrdering')) { |
|
| 110 | 110 | function getUserBrowseOrdering(): array |
| 111 | 111 | { |
| 112 | 112 | return [ |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | } |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | -if (! function_exists('getSimilarName')) { |
|
| 139 | +if (!function_exists('getSimilarName')) { |
|
| 140 | 140 | /** |
| 141 | 141 | * @param string $name |
| 142 | 142 | */ |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | } |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | -if (! function_exists('human_filesize')) { |
|
| 149 | +if (!function_exists('human_filesize')) { |
|
| 150 | 150 | /** |
| 151 | 151 | * @param int $decimals |
| 152 | 152 | */ |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | } |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | -if (! function_exists('bcdechex')) { |
|
| 162 | +if (!function_exists('bcdechex')) { |
|
| 163 | 163 | /** |
| 164 | 164 | * @return string |
| 165 | 165 | */ |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | } |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | -if (! function_exists('runCmd')) { |
|
| 179 | +if (!function_exists('runCmd')) { |
|
| 180 | 180 | /** |
| 181 | 181 | * Run CLI command. |
| 182 | 182 | * |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | } |
| 205 | 205 | } |
| 206 | 206 | |
| 207 | -if (! function_exists('escapeString')) { |
|
| 207 | +if (!function_exists('escapeString')) { |
|
| 208 | 208 | |
| 209 | 209 | function escapeString($string): string |
| 210 | 210 | { |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | } |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | -if (! function_exists('realDuration')) { |
|
| 215 | +if (!function_exists('realDuration')) { |
|
| 216 | 216 | |
| 217 | 217 | function realDuration($milliseconds): string |
| 218 | 218 | { |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | } |
| 223 | 223 | } |
| 224 | 224 | |
| 225 | -if (! function_exists('is_it_json')) { |
|
| 225 | +if (!function_exists('is_it_json')) { |
|
| 226 | 226 | /** |
| 227 | 227 | * @throws JsonException |
| 228 | 228 | */ |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | } |
| 238 | 238 | } |
| 239 | 239 | |
| 240 | -if (! function_exists('getStreamingZip')) { |
|
| 240 | +if (!function_exists('getStreamingZip')) { |
|
| 241 | 241 | /** |
| 242 | 242 | * @throws Exception |
| 243 | 243 | */ |
@@ -264,7 +264,7 @@ discard block |
||
| 264 | 264 | } |
| 265 | 265 | } |
| 266 | 266 | |
| 267 | -if (! function_exists('release_flag')) { |
|
| 267 | +if (!function_exists('release_flag')) { |
|
| 268 | 268 | // Function inspired by c0r3@newznabforums adds country flags on the browse page. |
| 269 | 269 | /** |
| 270 | 270 | * @param string $text Text to match against. |
@@ -401,7 +401,7 @@ discard block |
||
| 401 | 401 | } |
| 402 | 402 | } |
| 403 | 403 | |
| 404 | -if (! function_exists('getReleaseCover')) { |
|
| 404 | +if (!function_exists('getReleaseCover')) { |
|
| 405 | 405 | /** |
| 406 | 406 | * Get the cover image URL for a release based on its type and ID |
| 407 | 407 | * |
@@ -414,7 +414,7 @@ discard block |
||
| 414 | 414 | $coverId = null; |
| 415 | 415 | |
| 416 | 416 | // Helper function to get value from object or array |
| 417 | - $getValue = function ($data, $key) { |
|
| 417 | + $getValue = function($data, $key) { |
|
| 418 | 418 | if (is_array($data)) { |
| 419 | 419 | return $data[$key] ?? null; |
| 420 | 420 | } elseif (is_object($data)) { |
@@ -433,25 +433,25 @@ discard block |
||
| 433 | 433 | $xxxinfo_id = $getValue($release, 'xxxinfo_id'); |
| 434 | 434 | $anidbid = $getValue($release, 'anidbid'); |
| 435 | 435 | |
| 436 | - if (! empty($imdbid) && $imdbid > 0) { |
|
| 436 | + if (!empty($imdbid) && $imdbid > 0) { |
|
| 437 | 437 | $coverType = 'movies'; |
| 438 | 438 | $coverId = str_pad($imdbid, 7, '0', STR_PAD_LEFT); |
| 439 | - } elseif (! empty($musicinfo_id)) { |
|
| 439 | + } elseif (!empty($musicinfo_id)) { |
|
| 440 | 440 | $coverType = 'music'; |
| 441 | 441 | $coverId = $musicinfo_id; |
| 442 | - } elseif (! empty($consoleinfo_id)) { |
|
| 442 | + } elseif (!empty($consoleinfo_id)) { |
|
| 443 | 443 | $coverType = 'console'; |
| 444 | 444 | $coverId = $consoleinfo_id; |
| 445 | - } elseif (! empty($bookinfo_id)) { |
|
| 445 | + } elseif (!empty($bookinfo_id)) { |
|
| 446 | 446 | $coverType = 'book'; |
| 447 | 447 | $coverId = $bookinfo_id; |
| 448 | - } elseif (! empty($gamesinfo_id)) { |
|
| 448 | + } elseif (!empty($gamesinfo_id)) { |
|
| 449 | 449 | $coverType = 'games'; |
| 450 | 450 | $coverId = $gamesinfo_id; |
| 451 | - } elseif (! empty($xxxinfo_id)) { |
|
| 451 | + } elseif (!empty($xxxinfo_id)) { |
|
| 452 | 452 | $coverType = 'xxx'; |
| 453 | 453 | $coverId = $xxxinfo_id; |
| 454 | - } elseif (! empty($anidbid)) { |
|
| 454 | + } elseif (!empty($anidbid)) { |
|
| 455 | 455 | $coverType = 'anime'; |
| 456 | 456 | $coverId = $anidbid; |
| 457 | 457 | } |
@@ -467,10 +467,10 @@ discard block |
||
| 467 | 467 | } |
| 468 | 468 | } |
| 469 | 469 | |
| 470 | -if (! function_exists('sanitize')) { |
|
| 470 | +if (!function_exists('sanitize')) { |
|
| 471 | 471 | function sanitize(array|string $phrases, array $doNotSanitize = []): string |
| 472 | 472 | { |
| 473 | - if (! is_array($phrases)) { |
|
| 473 | + if (!is_array($phrases)) { |
|
| 474 | 474 | $wordArray = explode(' ', str_replace('.', ' ', $phrases)); |
| 475 | 475 | } else { |
| 476 | 476 | $wordArray = $phrases; |
@@ -481,9 +481,9 @@ discard block |
||
| 481 | 481 | foreach ($wordArray as $words) { |
| 482 | 482 | $words = preg_split('/\s+/', $words); |
| 483 | 483 | foreach ($words as $st) { |
| 484 | - if (Str::startsWith($st, ['!', '+', '-', '?', '*']) && Str::length($st) > 1 && ! preg_match('/([!+?\-*]){2,}/', $st)) { |
|
| 484 | + if (Str::startsWith($st, ['!', '+', '-', '?', '*']) && Str::length($st) > 1 && !preg_match('/([!+?\-*]){2,}/', $st)) { |
|
| 485 | 485 | $str = $st; |
| 486 | - } elseif (Str::endsWith($st, ['+', '-', '?', '*']) && Str::length($st) > 1 && ! preg_match('/([!+?\-*]){2,}/', $st)) { |
|
| 486 | + } elseif (Str::endsWith($st, ['+', '-', '?', '*']) && Str::length($st) > 1 && !preg_match('/([!+?\-*]){2,}/', $st)) { |
|
| 487 | 487 | $str = $st; |
| 488 | 488 | } else { |
| 489 | 489 | $str = Sanitizer::escape($st, $doNotSanitize); |
@@ -498,7 +498,7 @@ discard block |
||
| 498 | 498 | } |
| 499 | 499 | } |
| 500 | 500 | |
| 501 | -if (! function_exists('formatBytes')) { |
|
| 501 | +if (!function_exists('formatBytes')) { |
|
| 502 | 502 | /** |
| 503 | 503 | * Format bytes into human-readable file size. |
| 504 | 504 | * |
@@ -517,7 +517,7 @@ discard block |
||
| 517 | 517 | } |
| 518 | 518 | } |
| 519 | 519 | |
| 520 | -if (! function_exists('csp_nonce')) { |
|
| 520 | +if (!function_exists('csp_nonce')) { |
|
| 521 | 521 | /** |
| 522 | 522 | * Generate a CSP nonce for inline scripts |
| 523 | 523 | * This should be stored in the request and reused across the request lifecycle |
@@ -534,7 +534,7 @@ discard block |
||
| 534 | 534 | } |
| 535 | 535 | } |
| 536 | 536 | |
| 537 | -if (! function_exists('userDate')) { |
|
| 537 | +if (!function_exists('userDate')) { |
|
| 538 | 538 | /** |
| 539 | 539 | * Format a date/time string according to the authenticated user's timezone |
| 540 | 540 | * |
@@ -566,7 +566,7 @@ discard block |
||
| 566 | 566 | } |
| 567 | 567 | } |
| 568 | 568 | |
| 569 | -if (! function_exists('userDateDiffForHumans')) { |
|
| 569 | +if (!function_exists('userDateDiffForHumans')) { |
|
| 570 | 570 | /** |
| 571 | 571 | * Format a date/time string as a human-readable diff according to the authenticated user's timezone |
| 572 | 572 | * |
@@ -597,7 +597,7 @@ discard block |
||
| 597 | 597 | } |
| 598 | 598 | } |
| 599 | 599 | |
| 600 | -if (! function_exists('getAvailableTimezones')) { |
|
| 600 | +if (!function_exists('getAvailableTimezones')) { |
|
| 601 | 601 | /** |
| 602 | 602 | * Get a list of available timezones grouped by region |
| 603 | 603 | * |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | $type = $this->argument('type'); |
| 35 | 35 | $renamed = $this->argument('renamed'); |
| 36 | 36 | |
| 37 | - if (! \in_array($type, ['ama', 'add', 'ani', 'mov', 'nfo', 'tv'], true)) { |
|
| 37 | + if (!\in_array($type, ['ama', 'add', 'ani', 'mov', 'nfo', 'tv'], true)) { |
|
| 38 | 38 | $this->error('Type must be one of: ama, add, ani, mov, nfo, sha, tv'); |
| 39 | 39 | $this->line(''); |
| 40 | 40 | $this->line('ama => Do amazon/books processing'); |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | // Authenticate and authorize user |
| 41 | 41 | $userData = $this->authenticateUser($request); |
| 42 | - if (! \is_array($userData)) { |
|
| 42 | + if (!\is_array($userData)) { |
|
| 43 | 43 | return $userData; // Return error response |
| 44 | 44 | } |
| 45 | 45 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | // Validate and sanitize ID parameter |
| 55 | 55 | $releaseId = $this->validateAndSanitizeId($request); |
| 56 | - if (! \is_string($releaseId)) { |
|
| 56 | + if (!\is_string($releaseId)) { |
|
| 57 | 57 | return $releaseId; // Return error response |
| 58 | 58 | } |
| 59 | 59 | |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | */ |
| 72 | 72 | private function normalizeGuidParameter(Request $request, ?string $guid): void |
| 73 | 73 | { |
| 74 | - if ($guid !== null && ! $request->has('id')) { |
|
| 74 | + if ($guid !== null && !$request->has('id')) { |
|
| 75 | 75 | $request->merge(['id' => $guid]); |
| 76 | 76 | } |
| 77 | 77 | } |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | $user = User::getByRssToken($request->input('r')); |
| 126 | - if (! $user) { |
|
| 126 | + if (!$user) { |
|
| 127 | 127 | return Utility::showApiError(100); |
| 128 | 128 | } |
| 129 | 129 | |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | ) { |
| 254 | 254 | // Get NZB file path and validate |
| 255 | 255 | $nzbPath = (new NZB)->getNZBPath($releaseId); |
| 256 | - if (! File::exists($nzbPath)) { |
|
| 256 | + if (!File::exists($nzbPath)) { |
|
| 257 | 257 | return Utility::showApiError(300, 'NZB file not found!'); |
| 258 | 258 | } |
| 259 | 259 | |
@@ -309,9 +309,9 @@ discard block |
||
| 309 | 309 | ]; |
| 310 | 310 | |
| 311 | 311 | // Add optional metadata headers |
| 312 | - if (! empty($releaseData->imdbid) && $releaseData->imdbid > 0) { |
|
| 312 | + if (!empty($releaseData->imdbid) && $releaseData->imdbid > 0) { |
|
| 313 | 313 | $headers['X-DNZB-MoreInfo'] = "http://www.imdb.com/title/tt{$releaseData->imdbid}"; |
| 314 | - } elseif (! empty($releaseData->tvdb) && $releaseData->tvdb > 0) { |
|
| 314 | + } elseif (!empty($releaseData->tvdb) && $releaseData->tvdb > 0) { |
|
| 315 | 315 | $headers['X-DNZB-MoreInfo'] = "http://www.thetvdb.com/?tab=series&id={$releaseData->tvdb}"; |
| 316 | 316 | } |
| 317 | 317 | |
@@ -339,7 +339,7 @@ discard block |
||
| 339 | 339 | $lastChunk = false; |
| 340 | 340 | |
| 341 | 341 | // Stream and modify content in chunks |
| 342 | - while (! gzeof($fileHandle)) { |
|
| 342 | + while (!gzeof($fileHandle)) { |
|
| 343 | 343 | $chunk = gzread($fileHandle, self::BUFFER_SIZE); |
| 344 | 344 | if ($chunk === false) { |
| 345 | 345 | break; |
@@ -44,11 +44,11 @@ |
||
| 44 | 44 | $rslt = $adult->getXXXRange($page, $catarray, $offset, config('nntmux.items_per_page'), $orderby, -1, $this->userdata['categoryexclusions']); |
| 45 | 45 | $results = $this->paginate($rslt ?? [], $rslt[0]->_totalcount ?? 0, config('nntmux.items_per_page'), $page, $request->url(), $request->query()); |
| 46 | 46 | |
| 47 | - $title = ($request->has('title') && ! empty($request->input('title'))) ? stripslashes($request->input('title')) : ''; |
|
| 47 | + $title = ($request->has('title') && !empty($request->input('title'))) ? stripslashes($request->input('title')) : ''; |
|
| 48 | 48 | |
| 49 | - $actors = ($request->has('actors') && ! empty($request->input('actors'))) ? stripslashes($request->input('actors')) : ''; |
|
| 49 | + $actors = ($request->has('actors') && !empty($request->input('actors'))) ? stripslashes($request->input('actors')) : ''; |
|
| 50 | 50 | |
| 51 | - $director = ($request->has('director') && ! empty($request->input('director'))) ? stripslashes($request->input('director')) : ''; |
|
| 51 | + $director = ($request->has('director') && !empty($request->input('director'))) ? stripslashes($request->input('director')) : ''; |
|
| 52 | 52 | |
| 53 | 53 | $genres = $adult->getAllGenres(true); |
| 54 | 54 | $genre = ($request->has('genre') && \in_array($request->input('genre'), $genres, false)) ? $request->input('genre') : ''; |