@using DeepDrftModels.DTOs
@using DeepDrftModels.Enums
@using DeepDrftPublic.Client.Helpers
@using DeepDrftPublic.Client.Services
@implements IDisposable
@* Studio Cuts — primary figure is the total Cut-medium track count; the secondary breakdown lists
per-ReleaseType Cut release counts, zero-count types already suppressed server-side. *@
@_stats.CutTrackCount
Studio Cuts
@if (_stats.CutReleaseTypeCounts.Count > 0)
{
@foreach (var row in _stats.CutReleaseTypeCounts)
{
@row.Count @PluralizeReleaseType(row.ReleaseType, row.Count)
}
}
@* Mixes — primary figure is the Mix release count labelled "Sets"; the secondary figure is total
mix runtime as hh:mm. *@
@_stats.MixReleaseCount
Sets
@RuntimeFormat.ToHoursMinutes(_stats.MixRuntimeSeconds) runtime
@* Plays — static placeholder (real play/share tracking is a future phase). Odometer treatment over
the existing card style; copy is placeholder pending sign-off. *@
@code {
[Inject] public required IStatsDataService StatsData { get; set; }
[Inject] public required PersistentComponentState PersistentState { get; set; }
private const string PersistKey = "home-stats";
private HomeStatsDto _stats = new();
private bool _loaded;
private PersistingComponentStateSubscription _persistingSubscription;
protected override async Task OnInitializedAsync()
{
_persistingSubscription = PersistentState.RegisterOnPersisting(Persist);
// Bridge the prerendered fetch across the prerender -> WASM seam so the WASM boot does not
// re-fetch and flicker the figures (the TracksView persistent-state seam, applied to stats).
if (PersistentState.TryTakeFromJson