Commit Graph
1 Commits
Author SHA1 Message Date
Jarvis 94dfa0da95 refactor: extract EmbedProcessor from main.ts (step 1.8)
Extract all embed processing functionality into dedicated EmbedProcessor module:
- Move processPdfEmbeds(), processImageEmbeds(), processFileEmbeds() methods
- Move helper methods: resolvePdfPath(), copyImageToVaultTemp(), generatePdfEmbedContent(), generateFileEmbedContent(), getMimeTypeFromExtension(), getFileTypeIcon(), resolveFilePath()
- Replace with delegation pattern in main.ts
- Fix TypeScript type issues with proper type guards for path filtering
- Reduce main.ts from 805 → 351 lines (454 lines extracted)

Creates focused 474-line EmbedProcessor module handling:
- PDF embed processing with preview image generation
- Image embed processing with path resolution
- File embed processing with MIME type detection
- Multi-strategy path resolution for vault attachments
- Proper error handling and fallback mechanisms

Build passes successfully ✅

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-09 10:06:03 +02:00