Merge branch 'main' of ssh://git.homelab.nestor-server.fr:2222/colgora/Mangarr
All checks were successful
Build and Deploy / deploy (push) Successful in 1m46s
All checks were successful
Build and Deploy / deploy (push) Successful in 1m46s
# Conflicts: # src/Domain/Manga/Application/CommandHandler/DeleteChapterHandler.php # src/Domain/Manga/Application/CommandHandler/EditMultipleChaptersHandler.php # src/Domain/Manga/Application/EventListener/ChapterImportedEventListener.php # src/Domain/Manga/Application/EventListener/VolumeImportedEventListener.php # src/Domain/Manga/Application/Response/ChapterResponse.php # src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/DeleteCbzProvider.php # src/Domain/Manga/Infrastructure/ApiPlatform/State/Provider/DeleteChapterProvider.php # src/Domain/Manga/Infrastructure/Persistence/Repository/LegacyChapterRepository.php
This commit is contained in:
@@ -68,12 +68,13 @@ readonly class MangadxChapterSynchronizationService implements ChapterSynchroniz
|
||||
if ($shouldReplaceChapter) {
|
||||
$chaptersByNumber[(string) $chapterNumber] = new Chapter(
|
||||
new ChapterId((string) Uuid::uuid4()),
|
||||
$manga->getId()->getValue(),
|
||||
$manga->getId(),
|
||||
$chapterNumber,
|
||||
$title,
|
||||
isset($chapterData['attributes']['volume']) ? (int) $chapterData['attributes']['volume'] : null,
|
||||
true,
|
||||
null,
|
||||
0,
|
||||
new \DateTimeImmutable()
|
||||
);
|
||||
$chapterLanguages[(string) $chapterNumber] = $language;
|
||||
@@ -98,8 +99,8 @@ readonly class MangadxChapterSynchronizationService implements ChapterSynchroniz
|
||||
// Sauvegarde uniquement les nouveaux chapitres et collecte leurs IDs
|
||||
foreach ($chaptersByNumber as $chapterNumber => $chapter) {
|
||||
if (!isset($existingChapters[(float) $chapterNumber])) {
|
||||
$newChapterId = $this->mangaRepository->saveChapter($chapter);
|
||||
$newChapterIds[] = $newChapterId->getValue(); // ✨ Collecte des IDs
|
||||
$manga->addChapter($chapter);
|
||||
$newChapterIds[] = $chapter->getId();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,7 +144,8 @@ readonly class MangadxChapterSynchronizationService implements ChapterSynchroniz
|
||||
$currentChapter->getTitle(),
|
||||
null, // volume = null
|
||||
$currentChapter->isVisible(),
|
||||
$currentChapter->getCbzPath(),
|
||||
$currentChapter->getPagesDirectory(),
|
||||
$currentChapter->getPageCount(),
|
||||
$currentChapter->getCreatedAt()
|
||||
);
|
||||
}
|
||||
@@ -156,7 +158,8 @@ readonly class MangadxChapterSynchronizationService implements ChapterSynchroniz
|
||||
$currentChapter->getTitle(),
|
||||
$prevVolume, // prend le volume des adjacents
|
||||
$currentChapter->isVisible(),
|
||||
$currentChapter->getCbzPath(),
|
||||
$currentChapter->getPagesDirectory(),
|
||||
$currentChapter->getPageCount(),
|
||||
$currentChapter->getCreatedAt()
|
||||
);
|
||||
}
|
||||
@@ -210,7 +213,8 @@ readonly class MangadxChapterSynchronizationService implements ChapterSynchroniz
|
||||
$currentChapter->getTitle(),
|
||||
$prevVolume,
|
||||
$currentChapter->isVisible(),
|
||||
$currentChapter->getCbzPath(),
|
||||
$currentChapter->getPagesDirectory(),
|
||||
$currentChapter->getPageCount(),
|
||||
$currentChapter->getCreatedAt()
|
||||
);
|
||||
}
|
||||
@@ -223,7 +227,8 @@ readonly class MangadxChapterSynchronizationService implements ChapterSynchroniz
|
||||
$currentChapter->getTitle(),
|
||||
$nextVolume,
|
||||
$currentChapter->isVisible(),
|
||||
$currentChapter->getCbzPath(),
|
||||
$currentChapter->getPagesDirectory(),
|
||||
$currentChapter->getPageCount(),
|
||||
$currentChapter->getCreatedAt()
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user