feat(cms): add Track Browser foundation with mode toggle and CmsTrackGrid
- Extend ICmsTrackService.GetPagedAsync with album/genre filter params - Add CmsTrackBrowserViewModel (DI-scoped) with lazy album/genre load - Extract CmsTrackGrid: 9-column layout, waveform status, per-row generate, info tooltip, album/genre filter params, OnStatusLoaded callback - Restructure TrackList: remove MudTabs, add three @page routes, mode toggle, Generate All Missing button; album/genre stubs for next wave
This commit is contained in:
@@ -154,6 +154,7 @@ public class CmsTrackService : ICmsTrackService
|
||||
|
||||
public async Task<ResultContainer<PagedResult<TrackDto>>> GetPagedAsync(
|
||||
int page, int pageSize, string? sortColumn, bool sortDescending,
|
||||
string? album = null, string? genre = null,
|
||||
CancellationToken ct = default)
|
||||
{
|
||||
var client = _httpClientFactory.CreateClient(ContentCmsClientName);
|
||||
@@ -162,6 +163,14 @@ public class CmsTrackService : ICmsTrackService
|
||||
{
|
||||
query += $"&sortColumn={Uri.EscapeDataString(sortColumn)}";
|
||||
}
|
||||
if (!string.IsNullOrWhiteSpace(album))
|
||||
{
|
||||
query += $"&album={Uri.EscapeDataString(album)}";
|
||||
}
|
||||
if (!string.IsNullOrWhiteSpace(genre))
|
||||
{
|
||||
query += $"&genre={Uri.EscapeDataString(genre)}";
|
||||
}
|
||||
|
||||
HttpResponseMessage response;
|
||||
try
|
||||
@@ -542,7 +551,7 @@ public class CmsTrackService : ICmsTrackService
|
||||
{
|
||||
// Re-use the paged endpoint: a single-item page carries the full TotalCount, so no
|
||||
// dedicated count endpoint is needed.
|
||||
var paged = await GetPagedAsync(page: 1, pageSize: 1, sortColumn: null, sortDescending: false, ct);
|
||||
var paged = await GetPagedAsync(page: 1, pageSize: 1, sortColumn: null, sortDescending: false, ct: ct);
|
||||
if (!paged.Success || paged.Value is null)
|
||||
{
|
||||
var error = paged.Messages.FirstOrDefault()?.Message ?? "Failed to load track count.";
|
||||
|
||||
Reference in New Issue
Block a user