mirror of
https://github.com/bnair123/MusicAnalyser.git
synced 2026-02-25 11:46:07 +00:00
feat: Initial backend setup for Music Analyser
- Created FastAPI backend structure. - Implemented Spotify Recently Played ingestion logic. - Set up SQLite database with SQLAlchemy models. - Added AI Service using Google Gemini. - Created helper scripts for auth and background worker. - Added Dockerfile and GitHub Actions workflow.
This commit is contained in:
32
backend/app/schemas.py
Normal file
32
backend/app/schemas.py
Normal file
@@ -0,0 +1,32 @@
|
||||
from pydantic import BaseModel
|
||||
from typing import List, Optional
|
||||
from datetime import datetime
|
||||
|
||||
class TrackBase(BaseModel):
|
||||
id: str
|
||||
name: str
|
||||
artist: str
|
||||
album: str
|
||||
duration_ms: int
|
||||
popularity: Optional[int] = None
|
||||
lyrics_summary: Optional[str] = None
|
||||
genre_tags: Optional[str] = None
|
||||
|
||||
class Track(TrackBase):
|
||||
created_at: datetime
|
||||
updated_at: datetime
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
class PlayHistoryBase(BaseModel):
|
||||
track_id: str
|
||||
played_at: datetime
|
||||
context_uri: Optional[str] = None
|
||||
|
||||
class PlayHistory(PlayHistoryBase):
|
||||
id: int
|
||||
track: Track
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
Reference in New Issue
Block a user