feat: refonte du gestionnaire de chapitres pour intégrer la génération de fichiers CBZ, le téléchargement d'images en lot et la gestion des requêtes de scraping, avec mise à jour des interfaces et des modèles associés

This commit is contained in:
ext.jeremy.guillot@maxicoffee.domains
2025-03-28 20:42:21 +01:00
parent cdee6f77fc
commit d7088b14c2
22 changed files with 620 additions and 195 deletions

View File

@@ -3,24 +3,23 @@
namespace App\Tests\Domain\Scraping\Adapter;
use App\Domain\Scraping\Domain\Contract\Service\ScraperInterface;
use App\Domain\Scraping\Domain\Model\ScrapingJob;
use App\Domain\Scraping\Domain\Model\ValueObject\CbzPath;
use Ramsey\Uuid\Uuid;
use App\Domain\Scraping\Domain\Model\ValueObject\ScrapingRequest;
use App\Domain\Scraping\Domain\Model\ValueObject\ScrapingResult;
class InMemoryScraperAdapter implements ScraperInterface
{
private ?\Exception $shouldThrowException = null;
public function scrape(ScrapingJob $job): ScrapingJob
public function scrape(ScrapingRequest $request): ScrapingResult
{
if ($this->shouldThrowException) {
$job->fail($this->shouldThrowException->getMessage());
return $job;
throw $this->shouldThrowException;
}
$job->complete();
$job->cbzPath = new CbzPath('/path/to/test.cbz');
return $job;
return new ScrapingResult(
['http://example.com/image1.jpg', 'http://example.com/image2.jpg'],
2
);
}
public function simulateError(\Exception $exception): void