2026-07-03 01:06:35 +00:00

28 lines
724 B
Python

from pydantic import BaseModel
from typing import Optional, List
from datetime import datetime
from .song import SongResponse
class PlaylistBase(BaseModel):
name: str
description: Optional[str] = ""
class PlaylistCreate(PlaylistBase):
mood_category: Optional[str] = None
song_ids: Optional[List[str]] = []
class PlaylistResponse(PlaylistBase):
id: str
cover_art_path: Optional[str] = None
created_at: datetime
updated_at: datetime
mood_category: Optional[str] = None
is_shared: bool = False
share_token: Optional[str] = None
song_count: int = 0
class Config:
from_attributes = True
class PlaylistWithSongs(PlaylistResponse):
songs: List[SongResponse] = []