[CHANGE] Reworked cipher stuff

This commit is contained in:
max
2025-10-24 21:16:08 +02:00
parent a84195aefa
commit b5c701b971
8 changed files with 92 additions and 4 deletions

View File

@@ -0,0 +1,43 @@
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<IEnumerable<YouTubeClientItem>> SearchClientsAsync(string? search, CancellationToken cancellationToken)
{
var searchResults = await ClientService.GetClientsAsync(search, cancellationToken: cancellationToken);
return !searchResults.IsSuccess ? [] : searchResults.Value;
}
}