Added:
- activity on menu - starting activity page
This commit is contained in:
@@ -33,10 +33,10 @@ readonly class DownloadChapterHandler
|
||||
{
|
||||
$chapter = $this->chapterRepository->find($message->getChapterId());
|
||||
if (!$chapter) {
|
||||
$this->notificationService->sendUpdate('notification', ['status' => 'error', 'message' => 'Chapter not found.']);
|
||||
$this->notificationService->sendUpdate(['status' => 'error', 'message' => 'Chapter not found.']);
|
||||
throw new BadRequestHttpException('Chapter not found');
|
||||
} elseif ($chapter->getLocalPath() !== null) {
|
||||
$this->notificationService->sendUpdate('notification', ['status' => 'error', 'message' => 'Chapter already scraped.']);
|
||||
$this->notificationService->sendUpdate(['status' => 'error', 'message' => 'Chapter already scraped.']);
|
||||
throw new BadRequestHttpException('Chapter already downloaded');
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ readonly class DownloadChapterHandler
|
||||
$scrapedSuccessfully = true;
|
||||
break;
|
||||
} catch (Exception $e) {
|
||||
$this->notificationService->sendUpdate('notification', [
|
||||
$this->notificationService->sendUpdate([
|
||||
'status' => 'warning',
|
||||
'message' => 'An error occurred while scraping with source: ' . $source->getBaseUrl() . '. Trying next source...'
|
||||
]);
|
||||
@@ -74,13 +74,13 @@ readonly class DownloadChapterHandler
|
||||
}
|
||||
|
||||
if (!$scrapedSuccessfully) {
|
||||
$this->notificationService->sendUpdate('notification', [
|
||||
$this->notificationService->sendUpdate([
|
||||
'status' => 'error',
|
||||
'message' => 'All sources failed to scrape the chapter ' . $chapter->getManga()->getTitle() . ' ' . $chapter->getNumber() . '.'
|
||||
]);
|
||||
throw new Exception('All sources failed to scrape the chapter ' . $chapter->getManga()->getTitle() . ' ' . $chapter->getNumber() . '.');
|
||||
}
|
||||
|
||||
$this->notificationService->sendUpdate('notification', ['status' => 'success', 'message' => 'Chapter scraped successfully.']);
|
||||
$this->notificationService->sendUpdate(['status' => 'success', 'message' => 'Chapter scraped successfully.']);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user