dbd90ee52a
Player-service play-session tracker (floor + 3-bucket classify), SharePopover share tracker with debounce, sendBeacon interop, proxied rate-limited POST api/event/{play,share}, append-only event logs + incremental play_counter with server-side release resolution. Migration authored, not applied. No anonId, no read surface.
29 lines
1.4 KiB
C#
29 lines
1.4 KiB
C#
namespace DeepDrftModels.Entities;
|
||
|
||
/// <summary>
|
||
/// Incremental rollup of play counts per track (Phase 16 §4.1 / D6). One row per track, bumped inside
|
||
/// the same transaction that appends the <see cref="PlayEvent"/> — no background aggregation job. The
|
||
/// home card and per-target reads sum these instead of <c>COUNT(*)</c>-ing the event log on every
|
||
/// landing. Release totals are <em>derived</em> (D4) by summing the counters of the release's tracks,
|
||
/// so there is no separate release-counter row — this keeps the rollup normalized at one row per track.
|
||
/// </summary>
|
||
public class PlayCounter
|
||
{
|
||
public long Id { get; set; }
|
||
|
||
/// <summary>The track these counts belong to (SQL id). Unique — one counter row per track.</summary>
|
||
public long TrackId { get; set; }
|
||
|
||
/// <summary>Count of plays that ended in the <c>Partial</c> bucket (< 30%).</summary>
|
||
public long PartialCount { get; set; }
|
||
|
||
/// <summary>Count of plays that ended in the <c>Sampled</c> bucket (30%–80%).</summary>
|
||
public long SampledCount { get; set; }
|
||
|
||
/// <summary>Count of plays that ended in the <c>Complete</c> bucket (> 80%).</summary>
|
||
public long CompleteCount { get; set; }
|
||
|
||
/// <summary>Total plays for the track — the sum of the three bucket counts (headline figure).</summary>
|
||
public long TotalPlays => PartialCount + SampledCount + CompleteCount;
|
||
}
|