Added:
- activity on menu - starting activity page
This commit is contained in:
@@ -12,7 +12,7 @@ use Symfony\Component\String\Slugger\SluggerInterface;
|
||||
|
||||
readonly class MangadexProvider implements MetadataProviderInterface
|
||||
{
|
||||
public function __construct(private ClientInterface $client, private SluggerInterface $slugger)
|
||||
public function __construct(private ClientInterface $client, private SluggerInterface $slugger, private NotificationService $notificationService)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -22,12 +22,17 @@ readonly class MangadexProvider implements MetadataProviderInterface
|
||||
return new ArrayCollection();
|
||||
}
|
||||
|
||||
$results = $this->client->get('/manga', [
|
||||
'title' => $title,
|
||||
'contentRating' => ['safe', 'suggestive'],
|
||||
'includes' => ['cover_art', 'author'],
|
||||
'limit' => 25
|
||||
]);
|
||||
try{
|
||||
$results = $this->client->get('/manga', [
|
||||
'title' => $title,
|
||||
'contentRating' => ['safe', 'suggestive'],
|
||||
'includes' => ['cover_art', 'author'],
|
||||
'limit' => 25
|
||||
]);
|
||||
}catch(\Exception $e){
|
||||
$this->notificationService->sendUpdate('notification', ['status' => 'error', 'message' => 'An error occurred while fetching data from Mangadex.']);
|
||||
return new ArrayCollection();
|
||||
}
|
||||
|
||||
$mangas = [];
|
||||
foreach ($results['data'] as $result) {
|
||||
|
||||
Reference in New Issue
Block a user