Add per-episode play tracking with bar chart in admin analytics
- POST /api/analytics/play records a play event (title + date) on first play per player mount, skipping admin sessions - Plays persisted to data/episode-plays.json with total + byDay buckets - Admin stats response includes episodePlays sorted by total plays - AnalyticsPanel shows horizontal bar chart + summary cards for all episodes dynamically — new episodes appear automatically as played Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -59,6 +59,10 @@ export const state = {
|
||||
downloadCounts: {},
|
||||
downloadCountsWritePromise: Promise.resolve(),
|
||||
|
||||
// episodePlays: { [title]: { total: number, byDay: { [YYYY-MM-DD]: number } } }
|
||||
episodePlays: {},
|
||||
episodePlaysWritePromise: Promise.resolve(),
|
||||
|
||||
// qrCodes: Array<{ id, slug, label, destination, createdAt }>
|
||||
// qrScans: Array<{ id, qrId, slug, scannedAt, ip, userAgent }>
|
||||
qrCodes: [],
|
||||
|
||||
Reference in New Issue
Block a user