Files
MusicAnalyser/backend/app/schemas.py
google-labs-jules[bot] a97997a17a 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.
2025-12-24 17:26:01 +00:00

33 lines
673 B
Python

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