Track video clicks as engagement signals

- stats: started_count now includes any video opened (last_watched_at set)
  not just ones with saved progress seconds
- VideoPlayer: fires updateProgress immediately on open so even a
  click-and-back sets last_watched_at and counts as a started video

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-27 01:19:47 +02:00
parent fadb0fffcd
commit 1b010d4081
2 changed files with 11 additions and 1 deletions

View File

@@ -140,7 +140,7 @@ def get_stats(
text("""
SELECT COUNT(*) AS n FROM user_videos
WHERE user_id = :uid AND watched = 0
AND watch_progress_seconds > 0
AND (watch_progress_seconds > 0 OR last_watched_at IS NOT NULL)
"""),
{"uid": uid},
).mappings().first()