mirror of
https://github.com/bnair123/MusicAnalyser.git
synced 2026-02-25 11:46:07 +00:00
Fixed and added all the stats_service.py methods
This commit is contained in:
@@ -87,9 +87,28 @@ The LLM returns a JSON object with:
|
||||
|
||||
## 3. Data Models (`backend/app/models.py`)
|
||||
|
||||
- **Track:** Stores static metadata and audio features. `raw_data` stores the full Spotify JSON for future-proofing.
|
||||
- **Artist:** Normalized artist entities. Linked to tracks via `track_artists` table.
|
||||
- **Track:** Stores static metadata and audio features.
|
||||
- `lyrics`: Full lyrics from Genius (Text).
|
||||
- `image_url`: Album art URL (String).
|
||||
- `raw_data`: The full Spotify JSON for future-proofing.
|
||||
- **Artist:** Normalized artist entities.
|
||||
- `image_url`: Artist profile image (String).
|
||||
- **PlayHistory:** The timeseries ledger. Links `Track` to a timestamp and context.
|
||||
- **AnalysisSnapshot:** Stores the final output of these services.
|
||||
- `metrics_payload`: The JSON output of `StatsService`.
|
||||
- `narrative_report`: The JSON output of `NarrativeService`.
|
||||
|
||||
## 4. External Integrations
|
||||
|
||||
### Spotify
|
||||
- **Ingestion:** Polls `recently-played` endpoint every 60s.
|
||||
- **Enrichment:** Fetches Artist genres and images.
|
||||
|
||||
### Genius
|
||||
- **Client:** `backend/app/services/genius_client.py`.
|
||||
- **Function:** Searches for lyrics and high-res album art if missing from Spotify data.
|
||||
- **Trigger:** Runs during the ingestion loop for new tracks.
|
||||
|
||||
### ReccoBeats
|
||||
- **Function:** Fetches audio features (Danceability, Energy, Valence) for tracks.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user