@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | $show = $this->option('show'); |
| 58 | 58 | $sizeTolerance = (float) $this->option('size-tolerance'); |
| 59 | 59 | |
| 60 | - if ($limit && ! is_numeric($limit)) { |
|
| 60 | + if ($limit && !is_numeric($limit)) { |
|
| 61 | 61 | $this->error('Limit must be a numeric value.'); |
| 62 | 62 | |
| 63 | 63 | return Command::FAILURE; |
@@ -134,27 +134,27 @@ discard block |
||
| 134 | 134 | $matched = false; |
| 135 | 135 | |
| 136 | 136 | // 1. Title + Size Match (most reliable) |
| 137 | - if (! $matched) { |
|
| 137 | + if (!$matched) { |
|
| 138 | 138 | $matched = $this->matchByTitleAndSize($release, $cleanName, $dryRun, $show, $sizeTolerance, $categorize); |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | // 2. Filename + Size Match |
| 142 | - if (! $matched) { |
|
| 142 | + if (!$matched) { |
|
| 143 | 143 | $matched = $this->matchByFilenameAndSize($release, $cleanName, $dryRun, $show, $sizeTolerance, $categorize); |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | // 3. Direct Title Match (no size check) |
| 147 | - if (! $matched) { |
|
| 147 | + if (!$matched) { |
|
| 148 | 148 | $matched = $this->matchByDirectTitle($release, $cleanName, $dryRun, $show, $categorize); |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | // 4. Direct Filename Match (no size check) |
| 152 | - if (! $matched) { |
|
| 152 | + if (!$matched) { |
|
| 153 | 153 | $matched = $this->matchByDirectFilename($release, $cleanName, $dryRun, $show, $categorize); |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | // 5. Partial Title Match (least strict, last resort) |
| 157 | - if (! $matched) { |
|
| 157 | + if (!$matched) { |
|
| 158 | 158 | $matched = $this->matchByPartialTitle($release, $cleanName, $dryRun, $show, $categorize); |
| 159 | 159 | } |
| 160 | 160 | |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | $this->matched++; |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | - if (! $show && $this->checked % 10 === 0) { |
|
| 165 | + if (!$show && $this->checked % 10 === 0) { |
|
| 166 | 166 | $percent = round(($this->checked / $total) * 100, 1); |
| 167 | 167 | $this->info( |
| 168 | 168 | "Progress: {$percent}% ({$this->checked}/{$total}) | ". |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | } |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | - if (! $show) { |
|
| 174 | + if (!$show) { |
|
| 175 | 175 | echo PHP_EOL; |
| 176 | 176 | } |
| 177 | 177 | } |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | $manticore = new ManticoreSearch; |
| 188 | 188 | $results = $manticore->searchIndexes('predb_rt', $cleanName, ['title']); |
| 189 | 189 | |
| 190 | - if (! empty($results['data'])) { |
|
| 190 | + if (!empty($results['data'])) { |
|
| 191 | 191 | // Get the first matching PreDB entry from database |
| 192 | 192 | $predbId = $results['data'][0]['id'] ?? null; |
| 193 | 193 | if ($predbId) { |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | $manticore = new ManticoreSearch; |
| 226 | 226 | $results = $manticore->searchIndexes('predb_rt', $cleanName, ['filename']); |
| 227 | 227 | |
| 228 | - if (! empty($results['data'])) { |
|
| 228 | + if (!empty($results['data'])) { |
|
| 229 | 229 | // Get the first matching PreDB entry from database |
| 230 | 230 | $predbId = $results['data'][0]['id'] ?? null; |
| 231 | 231 | if ($predbId) { |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | $manticore = new ManticoreSearch; |
| 269 | 269 | $results = $manticore->searchIndexes('predb_rt', $cleanName, ['title', 'filename']); |
| 270 | 270 | |
| 271 | - if (! empty($results['data'])) { |
|
| 271 | + if (!empty($results['data'])) { |
|
| 272 | 272 | // Get the best matching PreDB entry from database |
| 273 | 273 | foreach ($results['data'] as $result) { |
| 274 | 274 | $predbId = $result['id'] ?? null; |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | // Try to match by title and size |
| 335 | 335 | $matched = $this->matchByTitleAndSize($release, $cleanName, $dryRun, $show, $sizeTolerance, $categorize); |
| 336 | 336 | |
| 337 | - if (! $matched) { |
|
| 337 | + if (!$matched) { |
|
| 338 | 338 | // Try to match by filename and size |
| 339 | 339 | $matched = $this->matchByFilenameAndSize($release, $cleanName, $dryRun, $show, $sizeTolerance, $categorize); |
| 340 | 340 | } |
@@ -343,7 +343,7 @@ discard block |
||
| 343 | 343 | $this->matched++; |
| 344 | 344 | } |
| 345 | 345 | |
| 346 | - if (! $show && $this->checked % 10 === 0) { |
|
| 346 | + if (!$show && $this->checked % 10 === 0) { |
|
| 347 | 347 | $percent = round(($this->checked / $total) * 100, 1); |
| 348 | 348 | $this->info( |
| 349 | 349 | "Progress: {$percent}% ({$this->checked}/{$total}) | ". |
@@ -352,7 +352,7 @@ discard block |
||
| 352 | 352 | } |
| 353 | 353 | } |
| 354 | 354 | |
| 355 | - if (! $show) { |
|
| 355 | + if (!$show) { |
|
| 356 | 356 | echo PHP_EOL; |
| 357 | 357 | } |
| 358 | 358 | } |
@@ -397,7 +397,7 @@ discard block |
||
| 397 | 397 | $this->matched++; |
| 398 | 398 | } |
| 399 | 399 | |
| 400 | - if (! $show && ($this->checked - $initialChecked) % 10 === 0) { |
|
| 400 | + if (!$show && ($this->checked - $initialChecked) % 10 === 0) { |
|
| 401 | 401 | $percent = round((($this->checked - $initialChecked) / $total) * 100, 1); |
| 402 | 402 | $this->info( |
| 403 | 403 | "Progress: {$percent}% ({$this->checked}/{$total}) | ". |
@@ -406,7 +406,7 @@ discard block |
||
| 406 | 406 | } |
| 407 | 407 | } |
| 408 | 408 | |
| 409 | - if (! $show) { |
|
| 409 | + if (!$show) { |
|
| 410 | 410 | echo PHP_EOL; |
| 411 | 411 | } |
| 412 | 412 | } |
@@ -430,7 +430,7 @@ discard block |
||
| 430 | 430 | $manticore = new ManticoreSearch; |
| 431 | 431 | $results = $manticore->searchIndexes('predb_rt', $cleanName, ['title']); |
| 432 | 432 | |
| 433 | - if (! empty($results['data'])) { |
|
| 433 | + if (!empty($results['data'])) { |
|
| 434 | 434 | // Filter results by size in PHP and get from database |
| 435 | 435 | foreach ($results['data'] as $result) { |
| 436 | 436 | $predbId = $result['id'] ?? null; |
@@ -453,7 +453,7 @@ discard block |
||
| 453 | 453 | // Fallback to direct query |
| 454 | 454 | $predb = Predb::query() |
| 455 | 455 | ->where('title', $cleanName) |
| 456 | - ->where(function ($query) use ($sizeMin, $sizeMax) { |
|
| 456 | + ->where(function($query) use ($sizeMin, $sizeMax) { |
|
| 457 | 457 | $query->whereNull('size') |
| 458 | 458 | ->orWhereBetween('size', [$sizeMin, $sizeMax]); |
| 459 | 459 | }) |
@@ -485,7 +485,7 @@ discard block |
||
| 485 | 485 | $manticore = new ManticoreSearch; |
| 486 | 486 | $results = $manticore->searchIndexes('predb_rt', $cleanName, ['filename']); |
| 487 | 487 | |
| 488 | - if (! empty($results['data'])) { |
|
| 488 | + if (!empty($results['data'])) { |
|
| 489 | 489 | // Filter results by size in PHP and get from database |
| 490 | 490 | foreach ($results['data'] as $result) { |
| 491 | 491 | $predbId = $result['id'] ?? null; |
@@ -508,7 +508,7 @@ discard block |
||
| 508 | 508 | // Fallback to direct query |
| 509 | 509 | $predb = Predb::query() |
| 510 | 510 | ->where('filename', $cleanName) |
| 511 | - ->where(function ($query) use ($sizeMin, $sizeMax) { |
|
| 511 | + ->where(function($query) use ($sizeMin, $sizeMax) { |
|
| 512 | 512 | $query->whereNull('size') |
| 513 | 513 | ->orWhereBetween('size', [$sizeMin, $sizeMax]); |
| 514 | 514 | }) |
@@ -552,7 +552,7 @@ discard block |
||
| 552 | 552 | |
| 553 | 553 | if ($release->searchname === $predb->title) { |
| 554 | 554 | // Names already match, just update predb_id |
| 555 | - if (! $dryRun) { |
|
| 555 | + if (!$dryRun) { |
|
| 556 | 556 | Release::where('id', $release->id)->update(['predb_id' => $predb->id]); |
| 557 | 557 | } |
| 558 | 558 | |
@@ -583,7 +583,7 @@ discard block |
||
| 583 | 583 | $newCategory = null; |
| 584 | 584 | $newCategoryName = $oldCategoryName; |
| 585 | 585 | |
| 586 | - if (! $dryRun) { |
|
| 586 | + if (!$dryRun) { |
|
| 587 | 587 | // Update release |
| 588 | 588 | Release::where('id', $release->id)->update([ |
| 589 | 589 | 'name' => $newName, |
@@ -664,7 +664,7 @@ discard block |
||
| 664 | 664 | */ |
| 665 | 665 | protected function getCategoryName(int $categoryId): string |
| 666 | 666 | { |
| 667 | - if (! isset($this->categoryCache[$categoryId])) { |
|
| 667 | + if (!isset($this->categoryCache[$categoryId])) { |
|
| 668 | 668 | $category = Category::query()->where('id', $categoryId)->first(['title']); |
| 669 | 669 | $this->categoryCache[$categoryId] = $category ? $category->title : "Unknown (ID: {$categoryId})"; |
| 670 | 670 | } |