mirror of
https://github.com/bnair123/MusicAnalyser.git
synced 2026-02-25 11:46:07 +00:00
Implement Phase 2 Frontend and Phase 3 Data Enrichment
- Initialize React+Vite Frontend with Ant Design Dashboard. - Implement Data Enrichment: ReccoBeats (Audio Features) and Spotify (Genres). - Update Database Schema via Alembic Migrations. - Add Docker support (Dockerfile, docker-compose.yml). - Update README with hosting instructions.
This commit is contained in:
18
backend/app/services/reccobeats_client.py
Normal file
18
backend/app/services/reccobeats_client.py
Normal file
@@ -0,0 +1,18 @@
|
||||
import httpx
|
||||
from typing import List, Dict, Any
|
||||
|
||||
RECCOBEATS_API_URL = "https://api.reccobeats.com/v1/audio-features"
|
||||
|
||||
class ReccoBeatsClient:
|
||||
async def get_audio_features(self, spotify_ids: List[str]) -> List[Dict[str, Any]]:
|
||||
if not spotify_ids:
|
||||
return []
|
||||
ids_param = ",".join(spotify_ids)
|
||||
async with httpx.AsyncClient() as client:
|
||||
try:
|
||||
response = await client.get(RECCOBEATS_API_URL, params={"ids": ids_param})
|
||||
if response.status_code != 200:
|
||||
return []
|
||||
return response.json().get("content", [])
|
||||
except Exception:
|
||||
return []
|
||||
Reference in New Issue
Block a user