[CHANGE] Remove anon accounts && added simple caching for urls
This commit is contained in:
@@ -10,7 +10,6 @@ namespace Manager.App.Components.Dialogs
|
||||
{
|
||||
[CascadingParameter] private IMudDialogInstance? MudDialog { get; set; }
|
||||
[Parameter] public string DefaultUserAgent { get; set; } = "";
|
||||
private bool IsAnonymous { get; set; }
|
||||
private ClientPrep? PreparingClient { get; set; }
|
||||
private CookieCollection ImportCookies { get; set; } = [];
|
||||
private bool _isLoading;
|
||||
@@ -22,12 +21,7 @@ namespace Manager.App.Components.Dialogs
|
||||
|
||||
private bool CanSave()
|
||||
{
|
||||
if (IsAnonymous || PreparingClient?.YouTubeClient?.State?.LoggedIn == true)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return PreparingClient?.YouTubeClient?.State?.LoggedIn == true;
|
||||
}
|
||||
|
||||
private bool CanContinue()
|
||||
@@ -35,13 +29,13 @@ namespace Manager.App.Components.Dialogs
|
||||
switch (_steps)
|
||||
{
|
||||
case AccountImportSteps.Authenticate:
|
||||
if (IsAnonymous || ImportCookies.Count != 0)
|
||||
if (ImportCookies.Count != 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case AccountImportSteps.Validate:
|
||||
if (IsAnonymous || PreparingClient?.YouTubeClient?.State?.LoggedIn == true)
|
||||
if (PreparingClient?.YouTubeClient?.State?.LoggedIn == true)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -96,7 +90,6 @@ namespace Manager.App.Components.Dialogs
|
||||
{
|
||||
PreparingClient?.YouTubeClient?.Dispose();
|
||||
PreparingClient = null;
|
||||
IsAnonymous = false;
|
||||
ImportCookies.Clear();
|
||||
_steps = AccountImportSteps.Authenticate;
|
||||
StateHasChanged();
|
||||
@@ -150,10 +143,6 @@ namespace Manager.App.Components.Dialogs
|
||||
{
|
||||
_isLoading = true;
|
||||
PreparingClient = new ClientPrep();
|
||||
if (IsAnonymous)
|
||||
{
|
||||
ImportCookies.Clear();
|
||||
}
|
||||
var clientResult = await YouTubeClient.CreateAsync(ImportCookies, DefaultUserAgent);
|
||||
if (clientResult.IsSuccess)
|
||||
{
|
||||
|
Reference in New Issue
Block a user