feat(manga): regrouper les chapitres d'un volume importé dans la liste API
Les chapitres partageant le même pagesDirectory non-null et le même volume non-null (import CBZ en bloc) sont fusionnés en un seul item isVolumeGroup=true côté Application, avec volumeChaptersRange et volumeChapterCount. Le frontend affiche "Vol. X — Chapitres Y-Z" à la place de N lignes identiques.
This commit is contained in:
parent
c268b2c312
commit
fb8f64ee59
@@ -185,6 +185,21 @@ readonly class LegacyMangaRepository implements MangaRepositoryInterface
|
||||
);
|
||||
}
|
||||
|
||||
public function findAllChapters(string $mangaId, string $sortOrder = 'desc'): array
|
||||
{
|
||||
$queryBuilder = $this->entityManager->createQueryBuilder()
|
||||
->select('c')
|
||||
->from(EntityChapter::class, 'c')
|
||||
->where('c.manga = :mangaId')
|
||||
->orderBy('c.number', $sortOrder)
|
||||
->setParameter('mangaId', $mangaId);
|
||||
|
||||
return array_map(
|
||||
fn (EntityChapter $entity) => $this->toChapterDomain($entity),
|
||||
$queryBuilder->getQuery()->getResult()
|
||||
);
|
||||
}
|
||||
|
||||
public function countChapters(string $mangaId): int
|
||||
{
|
||||
return $this->entityManager->createQueryBuilder()
|
||||
|
||||
Reference in New Issue
Block a user