feat(player): watched controls, compact layout, description popover

- Watched: an explicit toggle in the modal (Mark watched / Watched→unmark) plus
  auto-mark when playback reaches the end (within 10s, or on the ended event).
- Compact layout: drop the header bar and the redundant 'Open on YouTube' button
  (the embed's own YouTube logo already jumps out); Close moves to the title row,
  channel + meta share one line — fits without a scrollbar at higher zoom.
- Card actions reflect status: watched shows a double-check, saved a filled
  bookmark, with matching tooltips.
- Description: new GET /api/videos/{id} exposes the already-stored description,
  shown in a popover when hovering the modal title (fetched lazily).
This commit is contained in:
npeter83 2026-06-12 17:39:01 +02:00
parent 99dfa7691c
commit fcb77ac2e1
5 changed files with 161 additions and 60 deletions

View file

@ -287,3 +287,21 @@ def set_video_state(
row.watched_at = datetime.now(timezone.utc) if status == "watched" else row.watched_at
db.commit()
return {"video_id": video_id, "status": status}
@router.get("/videos/{video_id}")
def get_video_detail(
video_id: str,
user: User = Depends(current_user),
db: Session = Depends(get_db),
) -> dict:
"""On-demand detail (description, like count) — kept out of the feed list payload
so the feed stays lean; fetched lazily, e.g. for the title hover popover."""
v = db.get(Video, video_id)
if v is None:
raise HTTPException(status_code=404, detail="Unknown video")
return {
"id": v.id,
"description": v.description,
"like_count": v.like_count,
}