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:
@@ -83,27 +83,4 @@ public class ReleaseClient
|
||||
? ApiResult<ReleaseDto>.CreatePassResult(release)
|
||||
: ApiResult<ReleaseDto>.CreateFailResult("Failed to deserialize response");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fetches the high-res waveform datum for a Mix release, addressed by its public EntryKey. A 404
|
||||
/// means no datum is stored (not yet generated, or not a Mix) — a valid state, so it returns a pass
|
||||
/// result with a null value. Any other non-success status is a genuine failure.
|
||||
/// </summary>
|
||||
public async Task<ApiResult<WaveformProfileDto?>> GetMixWaveform(string entryKey)
|
||||
{
|
||||
var response = await _http.GetAsync($"api/release/{Uri.EscapeDataString(entryKey)}/mix/waveform");
|
||||
|
||||
if (response.StatusCode == System.Net.HttpStatusCode.NotFound)
|
||||
return ApiResult<WaveformProfileDto?>.CreatePassResult(null);
|
||||
|
||||
if (!response.IsSuccessStatusCode)
|
||||
return ApiResult<WaveformProfileDto?>.CreateFailResult($"HTTP {(int)response.StatusCode}");
|
||||
|
||||
var json = await response.Content.ReadAsStringAsync();
|
||||
var profile = JsonSerializer.Deserialize<WaveformProfileDto>(json, JsonOptions);
|
||||
|
||||
return profile is not null
|
||||
? ApiResult<WaveformProfileDto?>.CreatePassResult(profile)
|
||||
: ApiResult<WaveformProfileDto?>.CreateFailResult("Failed to deserialize response");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user