feat: CreateMangaFromMangadex endpoint + tests, missing image saving
This commit is contained in:
parent
ae0eac3197
commit
50080f9779
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user