Add Spotify integration with improved token management and user interface

- Implemented Spotify OAuth handling in spotify_client_manager.py to ensure valid access tokens for users.
- Created helper functions in spotify_helper.py for refreshing tokens and retrieving user information.
- Developed manage_spotify.html template for connecting and managing Spotify accounts, displaying connection status and token information.
- Added logging for token management processes to enhance debugging and monitoring.
- Introduced a debug client for Spotify interactions to facilitate easier testing and development.
This commit is contained in:
Christian Krakau-Louis
2025-05-27 21:40:37 +02:00
parent d2772b88fe
commit 2f55f898ed
44 changed files with 2317 additions and 1884 deletions
+52 -10
View File
@@ -91,7 +91,49 @@
## 🆕 Upcoming Milestones
### 🎯 Milestone 10: **"Scraper Symphony" Release** External Music Data
### 🎯 Milestone 10: **"Import Intelligent" Release** Enhanced Song Import System
* [ ] Implement parallel playlist import processing
* [ ] Design and implement import queue system
* [ ] Add background worker system for processing imports
* [ ] Enable multiple concurrent import jobs
* [ ] Implement priority system for import jobs
* [ ] Create comprehensive import progress reporting
* [ ] Real-time progress indicators for active imports
* [ ] Detailed error reporting with recovery options
* [ ] Email notifications when imports complete
* [ ] Redesign Spotify search functionality
* [ ] Improve search algorithm and relevance scoring
* [ ] Add advanced filtering options (year, genre, etc.)
* [ ] Implement caching for frequent searches
* [ ] Ensure proper pagination and performance
* [ ] Add text-based playlist import capability
* [ ] Support for pasting plain text playlists
* [ ] Line-by-line parsing with artist/song detection
* [ ] Confidence scoring for matches
* [ ] Manual review interface for low-confidence matches
* [ ] Support for various text formats (CSV, plain text, etc.)
* [ ] Build playlist scraper for "curated" Spotify playlists
* [ ] Web scraper for Spotify web interface
* [ ] Extract track names and artists from HTML/JSON
* [ ] Format compatibility with text-based import
* [ ] Handle rate limiting and detection prevention
* [ ] Implement production-grade web server
* [ ] Replace Flask development server with Gunicorn/uWSGI
* [ ] Configure proper worker processes and threads
* [ ] Implement graceful shutdown and restart capabilities
* [ ] Add Nginx as reverse proxy with proper caching
* [ ] Set up proper SSL termination and security headers
* [ ] Optimize static file serving
* [ ] Scale database for concurrent operations
* [ ] Implement connection pooling
* [ ] Add database query optimizations and indexing
* [ ] Configure database for concurrent write operations
* [ ] Set up monitoring for database performance
* [ ] Implement read/write splitting if necessary
* [ ] Add database migration safety for zero-downtime upgrades
### 🎯 Milestone 11: **"Scraper Symphony" Release** External Music Data
* [ ] Identify 23 public music chart sources (Billboard, Official Charts, etc.)
* [ ] Build scraper with user-agent rotation and proxy support
@@ -101,7 +143,7 @@
* [ ] Store scraper runs and log errors transparently
* [ ] Add cron-based scheduler for scraper refresh
### 🎯 Milestone 11: **"Alert Amplifier" Release** Notifications & Emails
### 🎯 Milestone 12: **"Alert Amplifier" Release** Notifications & Emails
* [ ] Email verification for new accounts
* [ ] Notify users when round generation completes
@@ -109,7 +151,7 @@
* [ ] Optional weekly usage summary for admins
* [ ] Push notification support via browser or Telegram
### 🎯 Milestone 12: **"Rhythm Roundsmith" Release** AI-Generated Quiz Rounds
### 🎯 Milestone 13: **"Rhythm Roundsmith" Release** AI-Generated Quiz Rounds
* [ ] Develop AI module to generate full quiz rounds
* [ ] Use existing song metadata (genre, year, tempo, artist)
@@ -122,7 +164,7 @@
* [ ] Add backend abstraction to swap AI providers (OpenAI, Mistral, etc.)
* [ ] Build tuning pipeline for prompt quality testing
### 🎯 Milestone 13: **"Storage Sanctuary" Release** Multi-Provider Storage
### 🎯 Milestone 14: **"Storage Sanctuary" Release** Multi-Provider Storage
* [ ] Implement cloud storage backend abstraction
* [ ] Add support for AWS S3 storage
@@ -131,12 +173,12 @@
* [ ] Add support for S3-compatible storage (MinIO, Wasabi, etc.)
* [ ] Integrate Dropbox as a storage backend
* [ ] Create unified storage management UI
* [ ] Export backups to cloud storage
* [ ] Export backups to cloud storage
* [ ] Store and retrieve music rounds from cloud storage
* [ ] Add background synchronization and status tracking
* [ ] Implement bandwidth-efficient differential uploads
### 🎯 Milestone 14: **"Collaboration Core" Release** Multi-User Round Sharing
### 🎯 Milestone 15: **"Collaboration Core" Release** Multi-User Round Sharing
* [ ] Allow shared editing of rounds
* [ ] Add collaboration roles (view, comment, edit)
@@ -146,7 +188,7 @@
* [ ] Allow public view-only sharing links with optional expiration
* [ ] Display access audit log (who opened/edited and when)
### 🎯 Milestone 15: **"Profile Personalizer" Release** User Preferences & Tagging
### 🎯 Milestone 16: **"Profile Personalizer" Release** User Preferences & Tagging
* [x] User-specific intro/outro/replay MP3 fallback system
* [x] Persistent custom user settings
@@ -155,7 +197,7 @@
* [ ] Add filtering and sorting by tag
* [ ] Dark mode toggle
### 🎯 Milestone 16: **"Performance Pulse" Release** Scaling & Speed
### 🎯 Milestone 17: **"Performance Pulse" Release** Scaling & Speed
* [ ] Index high-traffic database fields (tags, dates, users)
* [ ] Paginate round/song lists
@@ -163,7 +205,7 @@
* [ ] Add Redis/memory cache layer for read-heavy endpoints
* [ ] Load test with simulated users and large playlists
### 🎯 Milestone 17: **"Deployment Dynamo" Release** CI/CD and Maintenance
### 🎯 Milestone 18: **"Deployment Dynamo" Release** CI/CD and Maintenance
* [ ] GitHub Actions or GitLab CI/CD pipeline for builds and tests
* [ ] Nightly backup job with status alert
@@ -186,5 +228,5 @@
* [ ] Implement keyboard shortcuts in the application
* [ ] Document keyboard shortcuts for power users when implemented
*Last updated: May 12, 2025*
*Last updated: May 14, 2025*