refactor(scraping): DDD refactoring — stockage images individuelles #3

Merged
colgora merged 1 commits from feat/scraping-ddd-image-storage into main 2026-03-09 20:53:15 +01:00
Owner

Le domaine Scraping ne génère plus d'archives CBZ ni ne modifie les
entités du domaine Manga directement. Il scrape, stocke les images
individuellement, et émet un événement partagé.

Changements principaux

Domaine Scraping

  • Suppression : CbzGeneratorInterface, CbzGenerator, CbzGenerationRequest,
    CbzPath, CbzGenerationException
  • Suppression : save() de ChapterRepositoryInterface (Scraping)
  • Suppression : cbzPath du modèle Chapter (Scraping)
  • Ajout : ImageStorageInterface + LocalImageStorage
    (stockage dans {MANGA_DATA_PATH}/pages/{chapterId}/)
  • ScrapeChapterHandler utilise ImageStorage au lieu du générateur CBZ

Événement partagé

  • ChapterScraped déplacé dans Domain/Shared/Domain/Event/
    avec jobId, chapterId, pagesDirectory, pageCount
  • Routing Messenger ajouté

Domaine Manga

  • Ajout : ChapterScrapedEventListener + ChapterScrapedMessageHandler
    pour mettre à jour Chapter.pagesDirectory via le Repository Manga

Domaine Reader

  • LegacyChapterRepository en dual-mode :
    pagesDirectory en priorité, fallback cbzPath (backward compat)
  • Requêtes prev/next : filtrent pagesDirectory IS NOT NULL OR cbzPath IS NOT NULL
  • ChapterContext expose pagesDirectory

Architecture

  • phparkitect.php : App\Domain\Shared\Domain\Event autorisé dans
    les couches Application (correction violations pré-existantes
    ChapterImported/VolumeImported + nouvelle ChapterScraped)

Tests

  • 218/218 tests passent (+3 nouveaux)
  • InMemoryImageStorage créé pour les tests unitaires

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com

Le domaine Scraping ne génère plus d'archives CBZ ni ne modifie les entités du domaine Manga directement. Il scrape, stocke les images individuellement, et émet un événement partagé. ## Changements principaux ### Domaine Scraping - Suppression : CbzGeneratorInterface, CbzGenerator, CbzGenerationRequest, CbzPath, CbzGenerationException - Suppression : save() de ChapterRepositoryInterface (Scraping) - Suppression : cbzPath du modèle Chapter (Scraping) - Ajout : ImageStorageInterface + LocalImageStorage (stockage dans {MANGA_DATA_PATH}/pages/{chapterId}/) - ScrapeChapterHandler utilise ImageStorage au lieu du générateur CBZ ### Événement partagé - ChapterScraped déplacé dans Domain/Shared/Domain/Event/ avec jobId, chapterId, pagesDirectory, pageCount - Routing Messenger ajouté ### Domaine Manga - Ajout : ChapterScrapedEventListener + ChapterScrapedMessageHandler pour mettre à jour Chapter.pagesDirectory via le Repository Manga ### Domaine Reader - LegacyChapterRepository en dual-mode : pagesDirectory en priorité, fallback cbzPath (backward compat) - Requêtes prev/next : filtrent pagesDirectory IS NOT NULL OR cbzPath IS NOT NULL - ChapterContext expose pagesDirectory ### Architecture - phparkitect.php : App\Domain\Shared\Domain\Event autorisé dans les couches Application (correction violations pré-existantes ChapterImported/VolumeImported + nouvelle ChapterScraped) ## Tests - 218/218 tests passent (+3 nouveaux) - InMemoryImageStorage créé pour les tests unitaires Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
colgora added 1 commit 2026-03-09 20:50:07 +01:00
Le domaine Scraping ne génère plus d'archives CBZ ni ne modifie les
entités du domaine Manga directement. Il scrape, stocke les images
individuellement, et émet un événement partagé.

## Changements principaux

### Domaine Scraping
- Suppression : CbzGeneratorInterface, CbzGenerator, CbzGenerationRequest,
  CbzPath, CbzGenerationException
- Suppression : save() de ChapterRepositoryInterface (Scraping)
- Suppression : cbzPath du modèle Chapter (Scraping)
- Ajout : ImageStorageInterface + LocalImageStorage
  (stockage dans {MANGA_DATA_PATH}/pages/{chapterId}/)
- ScrapeChapterHandler utilise ImageStorage au lieu du générateur CBZ

### Événement partagé
- ChapterScraped déplacé dans Domain/Shared/Domain/Event/
  avec jobId, chapterId, pagesDirectory, pageCount
- Routing Messenger ajouté

### Domaine Manga
- Ajout : ChapterScrapedEventListener + ChapterScrapedMessageHandler
  pour mettre à jour Chapter.pagesDirectory via le Repository Manga

### Domaine Reader
- LegacyChapterRepository en dual-mode :
  pagesDirectory en priorité, fallback cbzPath (backward compat)
- Requêtes prev/next : filtrent pagesDirectory IS NOT NULL OR cbzPath IS NOT NULL
- ChapterContext expose pagesDirectory

### Architecture
- phparkitect.php : App\Domain\Shared\Domain\Event autorisé dans
  les couches Application (correction violations pré-existantes
  ChapterImported/VolumeImported + nouvelle ChapterScraped)

## Tests
- 218/218 tests passent (+3 nouveaux)
- InMemoryImageStorage créé pour les tests unitaires

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
colgora force-pushed feat/scraping-ddd-image-storage from b7f4ee9082 to c311cfe80c 2026-03-09 20:52:16 +01:00 Compare
colgora merged commit 6875ad4222 into main 2026-03-09 20:53:15 +01:00
colgora deleted branch feat/scraping-ddd-image-storage 2026-03-09 20:53:16 +01:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: colgora/Mangarr#3