feat: add last_technique_at to creators API endpoint
This commit is contained in:
parent
ea8a77be59
commit
acd0567e3c
2 changed files with 8 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 ──────────────────────────────────────────────────────────
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue