Compare commits
2 Commits
3c83a83396
...
38af6174fa
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
38af6174fa | ||
|
|
2fe20c804a |
@@ -6,6 +6,8 @@
|
||||
@inject AuthenticationStateProvider AuthProvider
|
||||
@inject ISnackbar Snackbar
|
||||
@inject HttpClient Http
|
||||
@implements IDisposable
|
||||
@implements IAsyncDisposable
|
||||
|
||||
<MudStack Spacing="1" Row AlignItems="AlignItems.Center" Wrap="Wrap.NoWrap">
|
||||
<!-- Кнопки управления -->
|
||||
@@ -291,6 +293,13 @@
|
||||
{
|
||||
try
|
||||
{
|
||||
AudioPlayerService.OnLoadAndPlayRequested -= OnServiceLoadAndPlay;
|
||||
AudioPlayerService.OnPlayRequested -= OnServicePlay;
|
||||
AudioPlayerService.OnPauseRequested -= OnServicePause;
|
||||
AudioPlayerService.OnSeekRequested -= OnServiceSeek;
|
||||
AudioPlayerService.OnVolumeChangeRequested -= OnServiceVolumeChange;
|
||||
AudioPlayerService.OnStateChanged -= OnServiceStateChanged;
|
||||
|
||||
if (_audioElement != null)
|
||||
await _audioElement.DisposeAsync();
|
||||
if (_audioModule != null)
|
||||
@@ -298,4 +307,9 @@
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
DisposeAsync().AsTask().Wait();
|
||||
}
|
||||
}
|
||||
@@ -214,6 +214,13 @@
|
||||
}
|
||||
</MudStack>
|
||||
</MudStack>
|
||||
<MudTextField @bind-Value="_playlistFilterText"
|
||||
Placeholder="Фильтр треков..."
|
||||
Adornment="Adornment.Start"
|
||||
AdornmentIcon="@Icons.Material.Filled.Search"
|
||||
Variant="Variant.Text"
|
||||
FullWidth
|
||||
Class="mb-2" />
|
||||
}
|
||||
};
|
||||
|
||||
@@ -231,7 +238,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudTable Items="@_tracks"
|
||||
<MudTable Items="@FilteredPlaylistTracks"
|
||||
Hover
|
||||
Elevation="0"
|
||||
Breakpoint="Breakpoint.None"
|
||||
@@ -388,7 +395,14 @@
|
||||
@if (_searchResult?.Tracks != null)
|
||||
{
|
||||
<MudText Typo="Typo.h6" Class="mt-4 mb-2 ml-2">Треки</MudText>
|
||||
<MudTable Items="@_searchResult.Tracks"
|
||||
<MudTextField @bind-Value="_searchFilterText"
|
||||
Placeholder="Фильтр треков..."
|
||||
Adornment="Adornment.Start"
|
||||
AdornmentIcon="@Icons.Material.Filled.Search"
|
||||
Variant="Variant.Text"
|
||||
FullWidth
|
||||
Class="mb-2" />
|
||||
<MudTable Items="@FilteredSearchTracks"
|
||||
Hover
|
||||
Elevation="0"
|
||||
Style="min-height: 0;"
|
||||
@@ -458,6 +472,16 @@
|
||||
/// <summary>Состояние: Происходит загрузка треков плейлиста.</summary>
|
||||
private bool _tracksLoading = true;
|
||||
|
||||
/// <summary>Текст фильтра для треков плейлиста</summary>
|
||||
private string _playlistFilterText = "";
|
||||
private List<YandexTrack> FilteredPlaylistTracks =>
|
||||
string.IsNullOrWhiteSpace(_playlistFilterText)
|
||||
? _tracks
|
||||
: _tracks.Where(t => t.Title.Contains(_playlistFilterText, StringComparison.InvariantCultureIgnoreCase) ||
|
||||
t.Artists.Any(a => a.Name.Contains(_playlistFilterText, StringComparison.InvariantCultureIgnoreCase)))
|
||||
.ToList();
|
||||
|
||||
|
||||
/********************************
|
||||
* Вкладка добавления треков
|
||||
*********************************/
|
||||
@@ -471,9 +495,17 @@
|
||||
private MudTextField<string> _searchField;
|
||||
/// <summary>Результат поиска.</summary>
|
||||
private YandexSearchResult? _searchResult = null;
|
||||
/// <summary>Текст фильтра для результатов поиска</summary>
|
||||
private string _searchFilterText = "";
|
||||
private List<YandexTrack> FilteredSearchTracks =>
|
||||
string.IsNullOrWhiteSpace(_searchFilterText) || _searchResult?.Tracks == null
|
||||
? _searchResult?.Tracks ?? new List<YandexTrack>()
|
||||
: _searchResult.Tracks.Where(t => t.Title.Contains(_searchFilterText, StringComparison.InvariantCultureIgnoreCase) ||
|
||||
t.Artists.Any(a => a.Name.Contains(_searchFilterText, StringComparison.InvariantCultureIgnoreCase)))
|
||||
.ToList();
|
||||
|
||||
/********************************
|
||||
* Вкладка добавления треков
|
||||
* Контекстные кнопки
|
||||
*********************************/
|
||||
/// <summary>Признак, что альбом в фаворитах.</summary>
|
||||
private bool _isFavorite;
|
||||
@@ -621,7 +653,6 @@
|
||||
}
|
||||
|
||||
|
||||
|
||||
#region Добавление/удаление трека
|
||||
/// <summary>Добавление трека.</summary>
|
||||
private async Task AddTrack(YandexTrack track)
|
||||
@@ -933,7 +964,7 @@
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Поделитьсы ссылкой
|
||||
#region Поделиться ссылкой
|
||||
/// <summary> Поделиться ссылкой </summary>
|
||||
private async Task SharePlaylist()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user