using Manager.App.Models.System; using Manager.YouTube.Util.Cipher; using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Web; using MudBlazor; namespace Manager.App.Components.Application.Dev; public partial class CipherDev : ComponentBase { private YouTubeClientItem? _selectedClient; private async Task ExecCipher(MouseEventArgs obj) { if (_selectedClient == null) { Snackbar.Add("No client selected", Severity.Warning); return; } var ytClientResult = await ClientService.LoadClientByIdAsync(_selectedClient.Id); if (!ytClientResult.IsSuccess) { Snackbar.Add(ytClientResult.Error?.Description ?? "Failed to get the client!", Severity.Error); return; } var ytClient = ytClientResult.Value; if (ytClient.State == null) { Snackbar.Add("Client state is null!", Severity.Warning); return; } var decoder = await CipherManager.GetDecoderAsync(ytClient.State, ytClient); } private async Task> SearchClientsAsync(string? search, CancellationToken cancellationToken) { var searchResults = await ClientService.GetClientsAsync(search, cancellationToken: cancellationToken); return !searchResults.IsSuccess ? [] : searchResults.Value; } }