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

@@ -2,18 +2,31 @@
namespace App\Tests\Domain\Scraping\Adapter;
use App\Domain\Scraping\Domain\Contract\Service\ImageStorageInterface;
use App\Domain\Shared\Domain\Contract\ImageStorageInterface;
class InMemoryImageStorage implements ImageStorageInterface
{
/** @var array<string, string> chapterId => pagesDirectory */
/** @var array<string, string> targetId => pagesDirectory */
public array $stored = [];
public function storeChapterImages(string $chapterId, array $localImagePaths): string
public function storeChapterImages(string $targetId, array $localImagePaths): string
{
$dir = '/fake/pages/' . $chapterId;
$this->stored[$chapterId] = $dir;
$dir = '/fake/pages/' . $targetId;
$this->stored[$targetId] = $dir;
return $dir;
}
public function extractFromCbz(string $targetId, string $cbzBinary): string
{
$dir = '/fake/pages/' . $targetId;
$this->stored[$targetId] = $dir;
return $dir;
}
public function countCbzImages(string $cbzBinary): int
{
return 0;
}
}