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.
This commit is contained in:
@@ -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
|
||||
<MudTd DataLabel="Genre">@(context.Release.Genre ?? "—")</MudTd>
|
||||
<MudTd DataLabel="Release Date">@(context.Release.ReleaseDate?.ToString("d MMMM, yyyy") ?? "—")</MudTd>
|
||||
<MudTd DataLabel="Type">
|
||||
<MudChip T="string" Size="Size.Small" Variant="Variant.Outlined">@context.Release.ReleaseType</MudChip>
|
||||
<MudChip T="string" Size="Size.Small" Variant="Variant.Outlined">
|
||||
@(context.Release.Medium == ReleaseMedium.Cut
|
||||
? context.Release.ReleaseType?.ToString() ?? "—"
|
||||
: MediumTypeLabels[context.Release.Medium])
|
||||
</MudChip>
|
||||
</MudTd>
|
||||
<MudTd DataLabel="Tracks">@context.TrackCount</MudTd>
|
||||
<MudTd DataLabel="Actions">
|
||||
@@ -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<ReleaseMedium, string> MediumTypeLabels =
|
||||
new Dictionary<ReleaseMedium, string>
|
||||
{
|
||||
[ReleaseMedium.Session] = "Session",
|
||||
[ReleaseMedium.Mix] = "DJ Mix",
|
||||
};
|
||||
|
||||
private async Task ToggleExpand(AlbumRow row)
|
||||
{
|
||||
row.IsExpanded = !row.IsExpanded;
|
||||
|
||||
Reference in New Issue
Block a user