From bc5d7f52b86a4cfe61c71e84b10ffc256e161e7f Mon Sep 17 00:00:00 2001 From: daniel-c-harvey Date: Sat, 13 Jun 2026 19:45:26 -0400 Subject: [PATCH] fix: Type chip in releases grid shows "Session"/"DJ Mix" for non-Cut media Cut rows continue to show ReleaseType (Single/EP/Album). Session/Mix rows now read from a MediumTypeLabels dictionary so a future medium needs only one new entry, no markup change. --- .../Pages/Tracks/CmsAlbumBrowser.razor | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/DeepDrftManager/Components/Pages/Tracks/CmsAlbumBrowser.razor b/DeepDrftManager/Components/Pages/Tracks/CmsAlbumBrowser.razor index 28f43ec..ebaabc9 100644 --- a/DeepDrftManager/Components/Pages/Tracks/CmsAlbumBrowser.razor +++ b/DeepDrftManager/Components/Pages/Tracks/CmsAlbumBrowser.razor @@ -1,6 +1,7 @@ @using System.Net @using DeepDrftManager.Services @using DeepDrftModels.DTOs +@using DeepDrftModels.Enums @inject ICmsTrackService CmsTrackService @inject IDialogService DialogService @inject ISnackbar Snackbar @@ -56,7 +57,11 @@ else @(context.Release.Genre ?? "—") @(context.Release.ReleaseDate?.ToString("d MMMM, yyyy") ?? "—") - @context.Release.ReleaseType + + @(context.Release.Medium == ReleaseMedium.Cut + ? context.Release.ReleaseType?.ToString() ?? "—" + : MediumTypeLabels[context.Release.Medium]) + @context.TrackCount @@ -141,6 +146,15 @@ else private static string ThumbUrl(string imagePath) => $"/api/image/{Uri.EscapeDataString(imagePath)}"; + // Medium → Type-chip display label for non-Cut media. Cut rows show ReleaseType instead. + // One entry per non-Cut medium; a future medium adds one line here, no markup change needed. + private static readonly IReadOnlyDictionary MediumTypeLabels = + new Dictionary + { + [ReleaseMedium.Session] = "Session", + [ReleaseMedium.Mix] = "DJ Mix", + }; + private async Task ToggleExpand(AlbumRow row) { row.IsExpanded = !row.IsExpanded;