Metrics: per-item view count and total play history #12

Open
opened 2026-05-05 00:18:00 +10:00 by unkinben · 0 comments
Owner

Track how many times each user has watched an item, and the global total view count across all users. Requires a play_events table (user_id, media_id, watched_at, duration_seconds, completed BOOL). Aggregate views: total_plays (all users), user_plays (current user). Expose on the catalogue item response and as a dedicated /catalogue/{id}/stats endpoint. Can be populated from the user_media_state progress tracking (issue already filed) or as a separate event-sourced log.

Track how many times each user has watched an item, and the global total view count across all users. Requires a play_events table (user_id, media_id, watched_at, duration_seconds, completed BOOL). Aggregate views: total_plays (all users), user_plays (current user). Expose on the catalogue item response and as a dedicated /catalogue/{id}/stats endpoint. Can be populated from the user_media_state progress tracking (issue already filed) or as a separate event-sourced log.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: unkin/streamstack#12