How kieraneglin/pinchflat works
Main Components Overview
The system should be divided into these primary components:
a. Web Interface Layer
• Phoenix-based web application (lib/pinchflat_web/)
• Controllers for different resources (media items, profiles, sources)
• LiveView components for real-time updates
b. Core Application Layer (lib/pinchflat/)
• Media Management
• Download Management
• Indexing Systems
• Profile Management
• Settings Management
c. External Integrations
• yt-dlp integration
• YouTube API/RSS integration
• Apprise notifications
• File system operations
Key Architectural Elements
[Web Interface Layer]
• Phoenix Controllers
• LiveView Components
• Web Templates
• v
[Core Application Layer]
• Media Management
• Download Workers
• Quality Management
• Retention Management
• Indexing System
• Fast Indexing (API/RSS)
• Slow Indexing (File-based)
• Profile Management
• Download Rules
• Settings & Configuration
• System Preferences
• v
[External Services Layer]
• yt-dlp Integration
• YouTube API/RSS
• Apprise Notifications
• File System Operations
Data Flow Representation
• User requests → Web Interface → Core Application
• Download requests → yt-dlp → File System
• Indexing processes → YouTube API/RSS → Database
• Notification events → Apprise servers
Important Subsystems to Highlight
a. Download Pipeline:
[Source Request] → [Download Worker] → [Quality Check] → [Metadata Processing] → [File Storage]
b. Indexing Pipeline:
[Source Configuration] → [Fast/Slow Indexing] → [Media Discovery] → [Download Queue]
Additional Elements
Supporting components:
• SQLite database connections
• Background job queues (Oban)
• File system mount points
• Configuration storage
Specific Implementation Details
Architectural patterns:
• Phoenix LiveView for real-time updates
• Worker pool for downloads
• File system organization
• Notification system integration
• The modular nature of the application
• Clear separation of concerns
• Integration points with external services
• Data flow through the system
• Background processing architecture
This system design should reflect Pinchflat's self-contained nature while showing its complex internal architecture that handles media downloading, processing, and management.