diff --git a/GUI plan.md b/GUI plan.md index 706c9be..79c5ac4 100644 --- a/GUI plan.md +++ b/GUI plan.md @@ -1,13 +1,24 @@ -### Python-first + +### Python-first Desktop Architecture -- Primary GUI framework: `PySide6` (Qt for Python) — native desktop look, cross-platform on Windows and Linux, mature widget set, good documentation. -- Desktop architecture: keep the core downloader logic as a Python package and expose a local HTTP/WebSocket API (e.g., `FastAPI`) that the GUI talks to. The GUI stays a thin client that issues commands and receives status updates. +- **Primary GUI framework**: `PySide6` (Qt for Python). +- **Communication Layer**: A local `FastAPI` backend to separate core logic from the UI. +- **IPC Mechanism**: The GUI spawns the FastAPI server on a random high port (binding to `127.0.0.1` ONLY) and communicates via REST/WebSockets. -### Why this approach +### Core Features to Implement -- Stay in Python end-to-end for now, minimizing new languages or runtimes. -- A local API boundary lets you reuse the same backend for a future Web frontend (React/Next.js or plain SPA) and for Android (native or Flutter shell that talks to the API or a hosted API). -- `PySide6` provides a polished native desktop UX and easier packaging for Windows/Linux compared with Python mobile toolkits. +1. **Dashboard Overview**: List all tracked playlists, their status (Last Sync), and total size. +2. **Interactive Configuration**: Wizard-style setup for new playlists (URL detection, folder picker). +3. **Queue Manager**: Visual progress bars for active downloads, showing speed, ETA, and current video title. +4. **Log Viewer**: Real-time streaming of yt-dlp logs for troubleshooting. +5. **Settings Panel**: Global settings for binary paths (ffmpeg, aria2c), max parallel jobs, and Docker detection toggle. + +### Phase 1 Roadmap: "The Bridge" + +- [ ] **Refactor `src/manager.py`**: Convert CLI-first execution to async-compatible methods for FastAPI consumption. +- [ ] **FastAPI Integration**: Create endpoints for `/playlists`, `/status`, and `/download/start`. +- [ ] **PySide6 Skeleton**: Basic window with `QWebEngine` (if hybrid) or native `QWidget` dashboard. +- [ ] **Packaging**: `pyinstaller` configuration to bundle both backend and frontend into a single `.exe`. ### Packaging & Distribution (brief) diff --git a/project plan.md b/project plan.md index 620608c..a9a388d 100644 --- a/project plan.md +++ b/project plan.md @@ -3,8 +3,8 @@ ## Subject Area - Tool for downloading and synchronizing YouTube playlists. -- Focuses on reliable batch downloading, format selection (audio and/or video), configurable quality and keeping local copies synced with playlist changes. -- Targets power users and archivists who need large-scale, repeatable playlist archiving and ongoing synchronization, with GUI interfaces. +- Focuses on batch downloading, format selection (audio and/or video), configurable quality and keeping local copies synced with playlist changes. +- Targets power users and archivists who need large-scale, repeatable playlist archiving and ongoing synchronization, with GUI interface. ## Problem @@ -18,38 +18,33 @@ Individuals who need to download a large number of videos or audio files from a ## Functionality Definition -- Can download: - - Video only - - Audio only - - Both video and audio -- Can update the playlist (download only newly added videos) -- Can delete videos that are no longer in the playlist -- Has configuration for: - - Quality - - Download type (audio, video) - - Save directory - - Use of aria2c - - aria2-related settings - - GUI settings +- Multi-format Download: + - Video only (mp4) + - Audio only (mp3) + - Both video and audio (mp3 & mp4) +- Smart Synchronization: + - Archive tracking (prevents re-downloading existing media) + - Playlist Pruning (automatically deletes local files no longer in the YouTube playlist) + - Sequential Renumbering (keeps local files sorted by playlist position) +- Advanced Configuration: + - Per-playlist settings (Quality, paths, archive file) + - Global performance options (Parallel downloads, aria2c threading) + - Path management for yt-dlp, ffmpeg, and aria2c (Docker-aware) +- GUI Integration: + - Real-time status updates via backend API + - Visual configuration editor + - Modern, responsive Qt-based interface -## GUI +## Platforms -- Has buttons for all features -- Allows adjusting all settings from the GUI -- Modern Design +- Desktop: Windows (Primary), Linux +- Docker +- Possible Future: Web App, Android App (via shared FastAPI backend) -## Platform +## Architecture & Languages -- Desktop application -- Optional: - - Web App - - Android App - -## Languages - -- Backend - - Python -- Frontend - - qt ? - - Tkinter? +- Core Engine: Python (yt-dlp wrapper) +- Backend API: FastAPI (Local localhost-only boundary) +- Desktop Frontend: PySide6 (Qt for Python) +- Distribution: PyInstaller / Briefcase (Windows .exe, Linux AppImage) \ No newline at end of file