mirror of
https://github.com/bnair123/MusicAnalyser.git
synced 2026-02-25 19:56:06 +00:00
- 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.
33 lines
673 B
Python
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
|