fix(import): extraire les images CBZ vers le stockage individuel

Corrige l'import de chapitres/volumes CBZ qui stockait le chemin du fichier
CBZ comme pagesDirectory. Le reader ne trouvait aucune image car
LegacyChapterRepository attend un dossier d'images individuelles.

- Déplace ImageStorageInterface dans Shared (storeChapterImages + extractFromCbz + countCbzImages)
- Crée ImageStorageManager dans Shared/Infrastructure (extraction ZIP + copie)
- Supprime LocalImageStorage et l'ancienne interface dans Scraping
- Refactore ImportChapterHandler et ImportVolumeHandler pour utiliser ImageStorageInterface
- Corrige LegacyChapterRepository : construit l'URL depuis basename(pagesDirectory)
  au lieu de chapterId (fix pour les volumes partagés)
This commit is contained in:
ext.jeremy.guillot@maxicoffee.domains
2026-03-15 18:26:28 +01:00
parent be8a3c6de8
commit 2e3abb76c3
13 changed files with 173 additions and 108 deletions

View File

@@ -13,22 +13,22 @@ use App\Domain\Manga\Domain\Model\ValueObject\MangaId;
use App\Domain\Manga\Domain\Model\ValueObject\MangaSlug;
use App\Domain\Manga\Domain\Model\ValueObject\MangaTitle;
use App\Tests\Domain\Manga\Adapter\InMemoryMangaRepository;
use App\Tests\Domain\Manga\Adapter\InMemoryPathManager;
use App\Tests\Domain\Scraping\Adapter\InMemoryImageStorage;
use PHPUnit\Framework\TestCase;
class ImportChapterHandlerTest extends TestCase
{
private InMemoryMangaRepository $mangaRepository;
private InMemoryPathManager $pathManager;
private InMemoryImageStorage $imageStorage;
private ImportChapterHandler $handler;
protected function setUp(): void
{
$this->mangaRepository = new InMemoryMangaRepository();
$this->pathManager = new InMemoryPathManager();
$this->imageStorage = new InMemoryImageStorage();
$this->handler = new ImportChapterHandler(
$this->mangaRepository,
$this->pathManager
$this->imageStorage
);
}