|
@@ 342-367 (lines=26) @@
|
| 339 |
|
//Although it's rare, it's possible for new chapters to have a different amount of segments to the oldChapter (or vice versa). |
| 340 |
|
//Since this can cause errors, we just throw a fail. |
| 341 |
|
$count = count($newChapterSegments); |
| 342 |
|
if($count === count($oldChapterSegments)) { |
| 343 |
|
if($count === 2) { |
| 344 |
|
//FIXME: This feels like a mess. |
| 345 |
|
$oldVolume = substr(array_shift($oldChapterSegments), 1); |
| 346 |
|
$newVolume = substr(array_shift($newChapterSegments), 1); |
| 347 |
|
|
| 348 |
|
if(in_array($oldVolume, ['TBD', 'TBA', 'NA'])) $oldVolume = 999; |
| 349 |
|
if(in_array($newVolume, ['TBD', 'TBA', 'NA'])) $newVolume = 999; |
| 350 |
|
|
| 351 |
|
$oldVolume = floatval($oldVolume); |
| 352 |
|
$newVolume = floatval($newVolume); |
| 353 |
|
} else { |
| 354 |
|
$oldVolume = 0; |
| 355 |
|
$newVolume = 0; |
| 356 |
|
} |
| 357 |
|
$oldChapter = floatval(substr(array_shift($oldChapterSegments), 1)); |
| 358 |
|
$newChapter = floatval(substr(array_shift($newChapterSegments), 1)); |
| 359 |
|
|
| 360 |
|
if($newVolume > $oldVolume) { |
| 361 |
|
//$newVolume is higher, no need to check chapter. |
| 362 |
|
$status = TRUE; |
| 363 |
|
} elseif($newChapter > $oldChapter) { |
| 364 |
|
//$newVolume isn't higher, but chapter is. |
| 365 |
|
$status = TRUE; |
| 366 |
|
} |
| 367 |
|
} |
| 368 |
|
|
| 369 |
|
return $status; |
| 370 |
|
} |
|
@@ 613-638 (lines=26) @@
|
| 610 |
|
//Although it's rare, it's possible for new chapters to have a different amount of segments to the oldChapter (or vice versa). |
| 611 |
|
//Since this can cause errors, we just throw a fail. |
| 612 |
|
$count = count($newChapterSegments); |
| 613 |
|
if($count === count($oldChapterSegments)) { |
| 614 |
|
if($count === 2) { |
| 615 |
|
//FIXME: This feels like a mess. |
| 616 |
|
$oldVolume = substr(array_shift($oldChapterSegments), 1); |
| 617 |
|
$newVolume = substr(array_shift($newChapterSegments), 1); |
| 618 |
|
|
| 619 |
|
if(in_array($oldVolume, ['TBD', 'TBA', 'NA'])) $oldVolume = 999; |
| 620 |
|
if(in_array($newVolume, ['TBD', 'TBA', 'NA'])) $newVolume = 999; |
| 621 |
|
|
| 622 |
|
$oldVolume = floatval($oldVolume); |
| 623 |
|
$newVolume = floatval($newVolume); |
| 624 |
|
} else { |
| 625 |
|
$oldVolume = 0; |
| 626 |
|
$newVolume = 0; |
| 627 |
|
} |
| 628 |
|
$oldChapter = floatval(substr(array_shift($oldChapterSegments), 1)); |
| 629 |
|
$newChapter = floatval(substr(array_shift($newChapterSegments), 1)); |
| 630 |
|
|
| 631 |
|
if($newVolume > $oldVolume) { |
| 632 |
|
//$newVolume is higher, no need to check chapter. |
| 633 |
|
$status = TRUE; |
| 634 |
|
} elseif($newChapter > $oldChapter) { |
| 635 |
|
//$newVolume isn't higher, but chapter is. |
| 636 |
|
$status = TRUE; |
| 637 |
|
} |
| 638 |
|
} |
| 639 |
|
|
| 640 |
|
return $status; |
| 641 |
|
} |