feat: CreateMangaFromMangadex endpoint + tests, missing image saving

This commit is contained in:
ext.jeremy.guillot@maxicoffee.domains
2025-02-11 00:10:54 +01:00
parent ae0eac3197
commit 50080f9779
14 changed files with 387 additions and 29 deletions

View File

@@ -123,4 +123,25 @@ readonly class MangadexProvider implements MangaProviderInterface
}
}
}
public function findByExternalId(ExternalId $externalId): ?Manga
{
try {
$result = $this->client->getManga($externalId->getValue());
if (!isset($result['data'])) {
return null;
}
$manga = $this->createMangaFromResult($result['data']);
if ($manga) {
$this->enrichWithRatings([$manga]);
}
return $manga;
} catch (\Exception) {
return null;
}
}
}