fix: volume gap filling for chapter transitions between different volumes
All checks were successful
Deploy / deploy (push) Successful in 3m3s
All checks were successful
Deploy / deploy (push) Successful in 3m3s
`fillVolumeGaps` incorrectly left chapters null when surrounded by two different non-null volumes (e.g. Vol10 → null → Vol11). Simplify the condition to always prefer the previous volume, covering all cases. Also fix `InMemoryMangaRepository::findExistingChaptersByNumbers` to return an array keyed by chapter number, matching the Doctrine contract. Add 5 unit tests for MangadxChapterSynchronizationService covering volume transitions, start-of-series gaps, explicit volumes, FR/EN priority, and deduplication of existing chapters.
This commit is contained in:
parent
465a05c13b
commit
d4e456961a
@@ -267,10 +267,14 @@ class InMemoryMangaRepository implements MangaRepositoryInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
return array_filter(
|
||||
$this->chapters[$mangaId],
|
||||
fn (Chapter $chapter) => in_array($chapter->getNumber(), $chapterNumbers)
|
||||
);
|
||||
$result = [];
|
||||
foreach ($this->chapters[$mangaId] as $chapter) {
|
||||
if (in_array($chapter->getNumber(), $chapterNumbers)) {
|
||||
$result[$chapter->getNumber()] = $chapter;
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function findByMonitoringCriteria(MonitoringCriteria $criteria): array
|
||||
|
||||
Reference in New Issue
Block a user