feat: amélioration de la gestion des messages dans le Makefile avec la séparation des commandes et des événements. Mise à jour des services pour intégrer un nouvel EventDispatcher et réorganisation des imports dans les fichiers concernés. Gestion des exceptions ajoutée dans le provider Mangadex pour une meilleure robustesse.
This commit is contained in:
parent
bec1572fcb
commit
8d14676656
@@ -3,6 +3,7 @@
|
||||
namespace App\Domain\Manga\Application\CommandHandler;
|
||||
|
||||
use App\Domain\Manga\Application\Command\CreateMangaFromMangadex;
|
||||
use App\Domain\Manga\Application\Response\CreateMangaResponse;
|
||||
use App\Domain\Manga\Domain\Contract\Provider\MangaProviderInterface;
|
||||
use App\Domain\Manga\Domain\Contract\Repository\MangaRepositoryInterface;
|
||||
use App\Domain\Manga\Domain\Contract\Service\ImageProcessorInterface;
|
||||
|
||||
@@ -30,7 +30,7 @@ readonly class MangadexProvider implements MangaProviderInterface
|
||||
}
|
||||
|
||||
$mangas = $this->createMangasFromResults($results['data']);
|
||||
$this->enrichWithRatings($mangas);
|
||||
// $this->enrichWithRatings($mangas);
|
||||
|
||||
usort($mangas, fn ($a, $b) => ($b->getRating() ?? 0) <=> ($a->getRating() ?? 0));
|
||||
|
||||
@@ -114,7 +114,11 @@ readonly class MangadexProvider implements MangaProviderInterface
|
||||
$mangas
|
||||
);
|
||||
|
||||
$ratings = $this->client->getMangaRatings($externalIds);
|
||||
try {
|
||||
$ratings = $this->client->getMangaRatings($externalIds);
|
||||
} catch (\Exception $e) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (isset($ratings['statistics'])) {
|
||||
foreach ($mangas as $manga) {
|
||||
@@ -146,4 +150,4 @@ readonly class MangadexProvider implements MangaProviderInterface
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user