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)
33 lines
772 B
PHP
33 lines
772 B
PHP
<?php
|
|
|
|
namespace App\Tests\Domain\Scraping\Adapter;
|
|
|
|
use App\Domain\Shared\Domain\Contract\ImageStorageInterface;
|
|
|
|
class InMemoryImageStorage implements ImageStorageInterface
|
|
{
|
|
/** @var array<string, string> targetId => pagesDirectory */
|
|
public array $stored = [];
|
|
|
|
public function storeChapterImages(string $targetId, array $localImagePaths): string
|
|
{
|
|
$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;
|
|
}
|
|
}
|