@page "/cuts/{Id:long}" @using DeepDrftModels.DTOs @using DeepDrftPublic.Client.Controls @using DeepDrftPublic.Client.Services @inherits CutDetailBase @(ViewModel.Release?.Title ?? "Cut") - DeepDrft @if (ViewModel.IsLoading) {
} else if (ViewModel.NotFound || ViewModel.Release is null) {
Cut not found.
All cuts
} else { var release = ViewModel.Release; var hasGenre = release.Genre is not null; var hasYear = release.ReleaseDate is not null; var firstTrack = ViewModel.Tracks.Count > 0 ? ViewModel.Tracks[0] : null;
@* Header split: meta + Play/Share on the LEFT, bordered cover on the RIGHT (spec §3.1). *@
@release.Title @release.Artist @if (hasGenre || hasYear) {
@if (hasGenre) { @release.Genre } @if (hasGenre && hasYear) { · } @if (hasYear) { @release.ReleaseDate!.Value.Year }
}
@* Header Play starts the album's first track. Wired to the single-slot player today; the §3.4 queue seam means a future swap to QueueService.PlayRelease is a one-line change inside PlayAlbum, not a markup edit. Disabled until a streamable track is resolved. *@ Play @if (firstTrack is not null) { }
@if (!string.IsNullOrEmpty(release.ImagePath)) { } else { }
@if (ViewModel.Tracks.Count == 0) { No tracks in this cut yet. } else {
@foreach (var track in ViewModel.Tracks) {
@track.TrackNumber
@track.TrackName
}
}
} @code { [CascadingParameter] public IStreamingPlayerService? PlayerService { get; set; } // Header Play: start the album's first track. The §3.4 queue seam lives here — swapping this body // to `Queue.PlayRelease(ViewModel.Tracks)` once IQueueService (track 11.F) lands is a one-line // change with no other edit to this page. The queue type is not referenced here because it does // not exist in this worktree. private Task PlayAlbum() { var first = ViewModel.Tracks.Count > 0 ? ViewModel.Tracks[0] : null; return first is null ? Task.CompletedTask : PlayTrack(first); } // Row play: toggle if this track is already active, otherwise start a fresh stream. Mirrors the // scaffold's own PlayTrack wiring (SessionDetail uses the same idiom for its diverged layout). private async Task PlayTrack(TrackDto track) { if (PlayerService is null) return; var isThisTrack = PlayerService.CurrentTrack?.Id == track.Id; if (isThisTrack && (PlayerService.IsPlaying || PlayerService.IsPaused)) { await PlayerService.TogglePlayPause(); } else { await PlayerService.SelectTrackStreaming(track); } } }