From a9e3572573caf52c02f3cf5cebfb69d499bf3f69 Mon Sep 17 00:00:00 2001 From: jlightner Date: Fri, 3 Apr 2026 08:58:05 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20Added=20moment=5Fcount=20field=20to=20C?= =?UTF-8?q?reatorDetail=20schema,=20router=20query=20(K=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - "backend/schemas.py" - "backend/routers/creators.py" - "frontend/src/api/public-client.ts" GSD-Task: S02/T01 --- backend/routers/creators.py | 7 +++++++ backend/schemas.py | 1 + frontend/src/api/public-client.ts | 1 + 3 files changed, 9 insertions(+) diff --git a/backend/routers/creators.py b/backend/routers/creators.py index a82faa0..0628a4c 100644 --- a/backend/routers/creators.py +++ b/backend/routers/creators.py @@ -129,6 +129,13 @@ async def get_creator( .where(SourceVideo.creator_id == creator.id) )).scalar() or 0 + # Moment count (key moments across all creator's videos) + moment_count = (await db.execute( + select(func.count()).select_from(KeyMoment) + .join(SourceVideo, KeyMoment.source_video_id == SourceVideo.id) + .where(SourceVideo.creator_id == creator.id) + )).scalar() or 0 + # Technique pages for this creator technique_rows = (await db.execute( select( diff --git a/backend/schemas.py b/backend/schemas.py index 66b374b..9a646f0 100644 --- a/backend/schemas.py +++ b/backend/schemas.py @@ -58,6 +58,7 @@ class CreatorDetail(CreatorRead): featured: bool = False video_count: int = 0 technique_count: int = 0 + moment_count: int = 0 techniques: list[CreatorTechniqueItem] = [] genre_breakdown: dict[str, int] = {} diff --git a/frontend/src/api/public-client.ts b/frontend/src/api/public-client.ts index 59830fc..30d9c60 100644 --- a/frontend/src/api/public-client.ts +++ b/frontend/src/api/public-client.ts @@ -196,6 +196,7 @@ export interface CreatorDetailResponse { featured: boolean; avatar_url: string | null; technique_count: number; + moment_count: number; techniques: CreatorTechniqueItem[]; genre_breakdown: Record; }