diff --git a/backend/routers/creators.py b/backend/routers/creators.py index 1b277b8..1fc4ba5 100644 --- a/backend/routers/creators.py +++ b/backend/routers/creators.py @@ -46,11 +46,18 @@ async def list_creators( .correlate(Creator) .scalar_subquery() ) + last_technique_sq = ( + select(func.max(TechniquePage.created_at)) + .where(TechniquePage.creator_id == Creator.id) + .correlate(Creator) + .scalar_subquery() + ) stmt = select( Creator, technique_count_sq.label("technique_count"), video_count_sq.label("video_count"), + last_technique_sq.label("last_technique_at"), ).where(Creator.hidden != True) # noqa: E712 # Genre filter diff --git a/backend/schemas.py b/backend/schemas.py index f18f83e..54bf520 100644 --- a/backend/schemas.py +++ b/backend/schemas.py @@ -358,6 +358,7 @@ class CreatorBrowseItem(CreatorRead): """Creator with technique and video counts for browse pages.""" technique_count: int = 0 video_count: int = 0 + last_technique_at: datetime | None = None # ── Content Reports ──────────────────────────────────────────────────────────