WIP: Add timestamp to comments and fix frontend errors

This commit is contained in:
Mistral Vibe
2026-03-29 22:06:36 +02:00
parent f7a07ba05e
commit a8aba72b3a
6 changed files with 139 additions and 6 deletions

View File

@@ -8,6 +8,7 @@ from pydantic import BaseModel, ConfigDict
class SongCommentCreate(BaseModel):
body: str
timestamp: float | None = None
class SongCommentRead(BaseModel):
@@ -18,6 +19,7 @@ class SongCommentRead(BaseModel):
body: str
author_id: uuid.UUID
author_name: str
timestamp: float | None
created_at: datetime
@classmethod
@@ -28,5 +30,6 @@ class SongCommentRead(BaseModel):
body=getattr(c, "body"),
author_id=getattr(c, "author_id"),
author_name=getattr(getattr(c, "author"), "display_name"),
timestamp=getattr(c, "timestamp"),
created_at=getattr(c, "created_at"),
)