feat(p12-w2): track-cardinal high-res waveform fetch + bridge rewire

Add GET api/track/{trackEntryKey}/waveform/high-res (+ proxy), ITrackDataService.GetTrackWaveform; rewire visualizer to resolve the current track's EntryKey and re-fetch on track change. Retire the client mix-waveform read path.
This commit is contained in:
daniel-c-harvey
2026-06-17 11:12:26 -04:00
parent ec3989c354
commit a19a734757
13 changed files with 216 additions and 74 deletions
@@ -319,4 +319,40 @@ public class TrackProxyController : ControllerBase
return Content(json, "application/json");
}
}
/// <summary>
/// Proxies a track's high-res waveform datum (JSON) from DeepDrftAPI — the per-track datum the lava
/// visualizer fetches for the current track (phase-12 §5b). Unauthenticated, same posture as the
/// 512-bucket profile forward above; the "high-res" suffix selects the TrackWaveforms datum. Small
/// JSON, buffered and relayed; a 404 (no high-res datum stored — track not yet backfilled) passes
/// through so the visualizer blanks gracefully.
/// </summary>
[HttpGet("{trackId}/waveform/high-res")]
public async Task<ActionResult> GetHighResWaveform(string trackId, CancellationToken ct = default)
{
var path = $"api/track/{Uri.EscapeDataString(trackId)}/waveform/high-res";
HttpResponseMessage upstream;
try
{
upstream = await _upstream.GetAsync(path, HttpCompletionOption.ResponseHeadersRead, ct);
}
catch (Exception ex)
{
_logger.LogError(ex, "Upstream call to DeepDrftAPI track/{TrackId}/waveform/high-res failed", trackId);
return StatusCode(502, "Upstream unavailable");
}
using (upstream)
{
if (!upstream.IsSuccessStatusCode)
{
_logger.LogWarning("DeepDrftAPI track/{TrackId}/waveform/high-res returned {Status}", trackId, (int)upstream.StatusCode);
return StatusCode((int)upstream.StatusCode);
}
var json = await upstream.Content.ReadAsStringAsync(ct);
return Content(json, "application/json");
}
}
}