feat: refactorisation de la gestion du scraping des chapitres en remplaçant les identifiants de manga et de chapitre par un identifiant de chapitre unique, amélioration de la récupération des sources préférées et ajout de la gestion des erreurs pour les échecs de scraping.
This commit is contained in:
parent
e29433bb0c
commit
c9f1771522
@@ -74,9 +74,7 @@ class ScrapeChapterHandlerTest extends TestCase
|
||||
public function testHandleSuccessfully(): void
|
||||
{
|
||||
$command = new ScrapeChapter(
|
||||
mangaId: 'test-manga',
|
||||
chapterNumber: '2',
|
||||
sourceId: 'test-source'
|
||||
chapterId: '1'
|
||||
);
|
||||
|
||||
$this->handler->handle($command);
|
||||
@@ -90,16 +88,14 @@ class ScrapeChapterHandlerTest extends TestCase
|
||||
$this->assertInstanceOf(ChapterScraped::class, $dispatchedMessages[0]);
|
||||
$this->assertEquals($job->id, $dispatchedMessages[0]->getJobId());
|
||||
|
||||
$chapter = $this->chapterRepository->getByMangaIdAndChapterNumber('test-manga', 2);
|
||||
$chapter = $this->chapterRepository->getById('1');
|
||||
$this->assertNotNull($chapter->cbzPath);
|
||||
}
|
||||
|
||||
public function testHandleThrowsException(): void
|
||||
{
|
||||
$command = new ScrapeChapter(
|
||||
mangaId: 'test-manga',
|
||||
chapterNumber: '2',
|
||||
sourceId: 'test-source'
|
||||
chapterId: '1'
|
||||
);
|
||||
|
||||
$exception = new \Exception('Scraping failed');
|
||||
|
||||
Reference in New Issue
Block a user