fix: TrackDetail render mode, pause, and secondary text color
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
@page "/track/{EntryKey}"
|
@page "/track/{EntryKey}"
|
||||||
@rendermode InteractiveWebAssembly
|
|
||||||
|
|
||||||
<PageTitle>@(ViewModel.Track?.TrackName ?? "Track") - DeepDrft</PageTitle>
|
<PageTitle>@(ViewModel.Track?.TrackName ?? "Track") - DeepDrft</PageTitle>
|
||||||
|
|
||||||
@@ -24,7 +23,7 @@ else if (ViewModel.NotFound)
|
|||||||
<div class="deepdrft-track-detail-container">
|
<div class="deepdrft-track-detail-container">
|
||||||
<div class="deepdrft-track-detail-masthead">
|
<div class="deepdrft-track-detail-masthead">
|
||||||
<MudText Typo="Typo.h4" Align="Align.Center">Track not found.</MudText>
|
<MudText Typo="Typo.h4" Align="Align.Center">Track not found.</MudText>
|
||||||
<MudText Typo="Typo.body2" Align="Align.Center" Class="mud-text-secondary">
|
<MudText Typo="Typo.body2" Align="Align.Center" Color="Color.Secondary">
|
||||||
This track may have been moved or removed.
|
This track may have been moved or removed.
|
||||||
</MudText>
|
</MudText>
|
||||||
<div class="d-flex justify-center mt-4">
|
<div class="d-flex justify-center mt-4">
|
||||||
|
|||||||
@@ -67,9 +67,12 @@ public partial class TrackDetail : ComponentBase, IDisposable
|
|||||||
{
|
{
|
||||||
if (ViewModel.Track is null) return;
|
if (ViewModel.Track is null) return;
|
||||||
|
|
||||||
// Resume the current track if it's merely paused; otherwise stream the new selection.
|
var isThisTrack = PlayerService.CurrentTrack?.Id == ViewModel.Track.Id;
|
||||||
// SelectTrackStreaming is the live entry point — the buffered SelectTrack path is dead.
|
|
||||||
if (PlayerService.CurrentTrack?.Id == ViewModel.Track.Id && PlayerService.IsPaused)
|
// Toggle play/pause if this track is already the active one (playing or paused);
|
||||||
|
// otherwise start a fresh stream. SelectTrackStreaming is the live entry point —
|
||||||
|
// the buffered SelectTrack path is dead.
|
||||||
|
if (isThisTrack && (PlayerService.IsPlaying || PlayerService.IsPaused))
|
||||||
{
|
{
|
||||||
await PlayerService.TogglePlayPause();
|
await PlayerService.TogglePlayPause();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user