feat: add last_technique_at to creators API endpoint

This commit is contained in:
jlightner 2026-04-03 04:12:31 +00:00
parent ea8a77be59
commit acd0567e3c
2 changed files with 8 additions and 0 deletions

View file

@ -46,11 +46,18 @@ async def list_creators(
.correlate(Creator) .correlate(Creator)
.scalar_subquery() .scalar_subquery()
) )
last_technique_sq = (
select(func.max(TechniquePage.created_at))
.where(TechniquePage.creator_id == Creator.id)
.correlate(Creator)
.scalar_subquery()
)
stmt = select( stmt = select(
Creator, Creator,
technique_count_sq.label("technique_count"), technique_count_sq.label("technique_count"),
video_count_sq.label("video_count"), video_count_sq.label("video_count"),
last_technique_sq.label("last_technique_at"),
).where(Creator.hidden != True) # noqa: E712 ).where(Creator.hidden != True) # noqa: E712
# Genre filter # Genre filter

View file

@ -358,6 +358,7 @@ class CreatorBrowseItem(CreatorRead):
"""Creator with technique and video counts for browse pages.""" """Creator with technique and video counts for browse pages."""
technique_count: int = 0 technique_count: int = 0
video_count: int = 0 video_count: int = 0
last_technique_at: datetime | None = None
# ── Content Reports ────────────────────────────────────────────────────────── # ── Content Reports ──────────────────────────────────────────────────────────