Features:
- Delete entire channels with all videos and downloaded files
- Delete individual video files while keeping database entries
- Scheduled automatic cleanup of videos older than 7 days
- Proper cascading deletes with file cleanup
Channel Deletion:
- New DELETE endpoint at /api/channels/<id>
- Removes channel, all video entries, and downloaded files
- User ownership verification
- Returns count of deleted files
- UI button on channels page with detailed confirmation dialog
Video File Deletion:
- New DELETE endpoint at /api/videos/<id>/file
- Celery async task to remove file from disk
- Resets download status to pending (allows re-download)
- UI button on watch page for completed videos
- Confirmation dialog with clear warnings
Scheduled Cleanup:
- Celery beat configuration for periodic tasks
- cleanup_old_videos task runs daily at midnight
- Automatically deletes videos completed more than 7 days ago
- Removes files and resets database status
- scheduled_tasks.py for beat schedule configuration
- verify_schedule.py helper to check task scheduling
UI Improvements:
- Added .btn-danger CSS class (black/white theme)
- Delete buttons with loading states
- Detailed confirmation dialogs warning about permanent deletion
- Dashboard now filters to show only completed videos
Bug Fixes:
- Fixed navbar alignment issues
- Added proper error handling for file deletion
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Created docker-compose.yml with 4 services:
- postgres: PostgreSQL 16 database with persistent volume
- redis: Redis 7 message broker
- app: Flask web application (port 5000)
- celery: Celery worker for async downloads
- Created Dockerfile with Python 3.14, FFmpeg, and uv
- Added psycopg2-binary dependency for PostgreSQL driver
- Updated database.py to use DATABASE_URL environment variable
- Supports PostgreSQL in production
- Falls back to SQLite for local development
- Updated celery_app.py to use environment variables:
- CELERY_BROKER_URL and CELERY_RESULT_BACKEND
- Created .env.example with all configuration variables
- Created .dockerignore to optimize Docker builds
- Updated .gitignore to exclude .env and Docker files
- Updated CLAUDE.md with comprehensive Docker documentation:
- Quick start with docker-compose commands
- Environment variable configuration
- Local development setup instructions
- Service architecture overview
All services have health checks and automatic restart configured.
Start entire stack with: docker-compose up
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Added yt-dlp, celery, and redis dependencies to pyproject.toml
- Extended VideoEntry model with download tracking fields:
- download_status (enum: pending, downloading, completed, failed)
- download_path, download_started_at, download_completed_at
- download_error, file_size
- Created celery_app.py with Redis broker configuration
- Created download_service.py with async download tasks:
- download_video() task downloads as MP4 format
- Configured yt-dlp for best MP4 quality with fallback
- Automatic retries on failure (max 3 attempts)
- Progress tracking and database updates
- Added Flask API endpoints in main.py:
- POST /api/download/<video_id> to trigger download
- GET /api/download/status/<video_id> to check status
- POST /api/download/batch for bulk downloads
- Generated and applied Alembic migration for new fields
- Created downloads/ directory for video storage
- Updated .gitignore to exclude downloads/ directory
- Updated CLAUDE.md with comprehensive documentation:
- Redis and Celery setup instructions
- Download workflow and architecture
- yt-dlp configuration details
- New API endpoint examples
Videos are downloaded as MP4 files using Celery workers.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>