Добавлена подсветка воспроизводимой песни

This commit is contained in:
FrigaT
2026-05-22 00:07:26 +03:00
parent 9139d8ecfe
commit efe1c3c2dd
23 changed files with 362 additions and 57 deletions

View File

@@ -47,8 +47,7 @@
<MudTd DataLabel="">
<MudIconButton Icon="@Icons.Material.Filled.Delete"
Color="Color.Error"
OnClick="() => RemoveFromFavorites(context)"
Title="Удалить из избранного" />
OnClick="() => RemoveFromFavorites(context)" />
</MudTd>
</RowTemplate>
</MudTable>

View File

@@ -3,7 +3,7 @@
@inject NavigationManager Navigation
@inject AuthenticationStateProvider AuthProvider
<MudContainer MaxWidth="MaxWidth.Large" Class="mt-8">
<MudContainer MaxWidth="MaxWidth.Large" Class="mt-4 mt-sm-8">
<MudCard>
<MudCardHeader>
<CardHeaderContent>
@@ -26,7 +26,7 @@
<div style="display: flex; align-items: center; gap: 12px; flex-wrap: wrap;">
<MudIcon Icon="@Icons.Material.Filled.Share" Size="Size.Medium" />
<div style="flex: 1;">
<MudText Typo="Typo.body1" FontWeight="FontWeight.Bold">
<MudText Typo="Typo.body1" Style="font-weight: bold;">
Чтобы расшаривать плейлисты, необходимо зарегистрироваться
</MudText>
<MudText Typo="Typo.body2">
@@ -45,19 +45,19 @@
<!-- Краткие преимущества -->
<MudGrid>
<MudItem xs="12" sm="4">
<MudPaper Class="pa-3 text-center" Elevation="0" Style="background-color: rgba(0,0,0,0.04); border-radius: 8px;">
<MudPaper Class="pa-3 text-center feature-card" Elevation="0" Style="background-color: rgba(0,0,0,0.04); border-radius: 8px;">
<MudIcon Icon="@Icons.Material.Filled.Link" Size="Size.Medium" Color="Color.Primary" />
<MudText Typo="Typo.body2" Class="mt-2">Создавайте ссылки-приглашения</MudText>
</MudPaper>
</MudItem>
<MudItem xs="12" sm="4">
<MudPaper Class="pa-3 text-center" Elevation="0" Style="background-color: rgba(0,0,0,0.04); border-radius: 8px;">
<MudPaper Class="pa-3 text-center feature-card" Elevation="0" Style="background-color: rgba(0,0,0,0.04); border-radius: 8px;">
<MudIcon Icon="@Icons.Material.Filled.People" Size="Size.Medium" Color="Color.Primary" />
<MudText Typo="Typo.body2" Class="mt-2">Совместное управление треками</MudText>
</MudPaper>
</MudItem>
<MudItem xs="12" sm="4">
<MudPaper Class="pa-3 text-center" Elevation="0" Style="background-color: rgba(0,0,0,0.04); border-radius: 8px;">
<MudPaper Class="pa-3 text-center feature-card" Elevation="0" Style="background-color: rgba(0,0,0,0.04); border-radius: 8px;">
<MudIcon Icon="@Icons.Material.Filled.Security" Size="Size.Medium" Color="Color.Primary" />
<MudText Typo="Typo.body2" Class="mt-2">Гибкие настройки доступа</MudText>
</MudPaper>

View File

@@ -17,7 +17,7 @@
</CardHeaderContent>
<CardHeaderActions>
<!-- Явно указываем T="bool" для MudSwitch -->
<MudSwitch T="bool" @bind-Checked="_showOnlyShared" Color="Color.Primary" Label="Только расшаренные" />
<MudSwitch T="bool" @bind-Value="_showOnlyShared" Color="Color.Primary" Label="Только расшаренные" />
<MudIconButton Icon="@Icons.Material.Filled.Refresh" OnClick="LoadPlaylists" />
</CardHeaderActions>
</MudCardHeader>
@@ -71,11 +71,11 @@
</MudContainer>
@code {
private List<YandexPlaylistShare> _playlists;
private List<YandexPlaylistShare> _playlists = new();
private bool _loading = true;
private bool _showOnlyShared = false;
private List<YandexPlaylistShare> FilteredPlaylists => _showOnlyShared ? _playlists?.Where(p => p.IsShared).ToList() : _playlists;
private List<YandexPlaylistShare> FilteredPlaylists => _showOnlyShared ? _playlists.Where(p => p.IsShared).ToList() : _playlists;
protected override async Task OnInitializedAsync()
{
@@ -89,7 +89,7 @@
{
var response = await Http.GetFromJsonAsync<ApiResponse<List<YandexPlaylistShare>>>("/api/playlists");
if (response?.Success == true)
_playlists = response.Data;
_playlists = response.Data ?? new();
else
Snackbar.Add("Ошибка загрузки плейлистов", Severity.Error);
}

View File

@@ -48,7 +48,6 @@
</MudContainer>
@code {
private string _email = "user@example.com";
private string _statusText = "Загрузка...";
private bool _hasToken;

View File

@@ -43,7 +43,7 @@
var result = await response.Content.ReadFromJsonAsync<ApiResponse<LoginResponse>>();
if (result?.Success == true)
{
await AuthProvider.MarkUserAsAuthenticated(result.Data.Token, result.Data.RefreshToken);
await AuthProvider.MarkUserAsAuthenticated(result.Data!.Token, result.Data.RefreshToken);
Navigation.NavigateTo("/");
}
else
@@ -60,9 +60,9 @@
public class RegisterModel
{
public string Username { get; set; }
public string Email { get; set; }
public string Password { get; set; }
public string ConfirmPassword { get; set; }
public string Username { get; set; } = string.Empty;
public string Email { get; set; } = string.Empty;
public string Password { get; set; } = string.Empty;
public string ConfirmPassword { get; set; } = string.Empty;
}
}

View File

@@ -249,14 +249,16 @@
}
else
{
<MudTable Items="@FilteredPlaylistTracks"
Hover
Elevation="0"
Breakpoint="Breakpoint.None"
<MudTable Items="@FilteredPlaylistTracks"
Hover
Elevation="0"
Breakpoint="Breakpoint.None"
Class="content-fade-in"
Style="min-height: 0;">
<RowTemplate>
<MudTd Class="py-1 px-0" Style="width: 100%;">
<TrackItem Track="@context" PlaylistShareToken="@Token" CanPlay="@_canPlay"
IsCurrentTrack="@(AudioPlayerService.CurrentTrackId == context.TrackId)"
AddedByName="@(_trackAdditions.TryGetValue(context.TrackId, out var n) ? n : null)" />
</MudTd>
@if (_canRemove)
@@ -508,7 +510,7 @@
/// <summary>Состояние: Происходит поиск.</summary>
private bool _isSearching = false;
/// <summary>Ссылка на поле ввода</summary>
private MudTextField<string> _searchField;
private MudTextField<string> _searchField = null!;
/// <summary>Результат поиска.</summary>
private YandexSearchResult? _searchResult = null;
/// <summary>Текст фильтра для результатов поиска</summary>