[CHANGE] Reworked db with interceptors

This commit is contained in:
max
2025-09-10 23:49:41 +02:00
parent b1e5b0dc68
commit 0f83cf1ddc
23 changed files with 293 additions and 79 deletions

View File

@@ -2,7 +2,7 @@
<html lang="en">
<head>
<title>Application</title>
<title>YouTube Manager server</title>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<base href="/"/>
@@ -11,7 +11,6 @@
<link rel="icon" type="image/png" href="favicon.png"/>
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" rel="stylesheet"/>
<link href="_content/MudBlazor/MudBlazor.min.css?v=@Metadata.Version" rel="stylesheet"/>
<HeadOutlet/>
</head>
<body>

View File

@@ -107,7 +107,11 @@ public partial class EventConsole : ComponentBase
_batchLock.Release();
}
_serviceEvents.AddRange(batch);
foreach (var serviceEvent in _batchBuffer.Where(serviceEvent => !_serviceEvents.Contains(serviceEvent)))
{
_serviceEvents.Add(serviceEvent);
}
_lastBatchUpdate = DateTime.UtcNow;
if (_virtualize != null)

View File

@@ -6,6 +6,8 @@
@inject ILibraryService LibraryService
@inject IDialogService DialogService
@inject IOptions<LibrarySettings> LibraryOptions
@inject ClientService ClientService
@inject ISnackbar Snackbar
<PageTitle>Channels</PageTitle>

View File

@@ -28,21 +28,21 @@ public partial class Channels : ComponentBase
return;
}
var client = (ClientPrep)result.Data;
if (client == null)
var clientPrep = (ClientPrep)result.Data;
if (clientPrep?.YouTubeClient == null)
{
return;
}
/*var savedResult = await ClientManager.SaveClientAsync(client);
var savedResult = await ClientService.SaveClientAsync(clientPrep.YouTubeClient, clientPrep.Channel);
if (!savedResult.IsSuccess)
{
Snackbar.Add($"Failed to store client: {savedResult.Error?.Description ?? "Unknown!"}", Severity.Error);
}
else
{
Snackbar.Add($"Client {client.External.Channel?.Handle ?? client.Id} saved!", Severity.Success);
}*/
Snackbar.Add($"Client {clientPrep.Channel?.Handle ?? clientPrep.YouTubeClient.Id} saved!", Severity.Success);
}
await InvokeAsync(StateHasChanged);
}

View File

@@ -1,6 +1,6 @@
@page "/Development"
@using Manager.App.Components.Application.Dev
<title>Development page</title>
<PageTitle>Development page</PageTitle>
<MudTabs Outlined Position="Position.Left" PanelClass="pa-4" ApplyEffectsToContainer Style="height: 100%">
<MudTabPanel Text="Authentication">

View File

@@ -5,7 +5,7 @@
@inject BackgroundServiceRegistry ServiceRegistry
<title>Services</title>
<PageTitle>Services</PageTitle>
<MudDataGrid T="ExtendedBackgroundService" Items="@_backgroundServices" Filterable QuickFilter="@QuickFilter">
<ToolBarContent>
@@ -39,4 +39,4 @@
</MudDataGrid>
<EventConsole AsyncEnumerable="@GetEventAsyncEnumerable()" InitialEvents="@GetInitialEvents()"
Elevation="0" Class="mt-3" Style="flex: 1; display: flex; flex-direction: column; min-height: 0;"/>
Elevation="0" Class="mt-3" Style="flex: 1; display: flex; flex-direction: column; min-height: 350px;"/>

View File

@@ -3,4 +3,5 @@
<RouteView RouteData="routeData" DefaultLayout="typeof(Layout.MainLayout)"/>
<FocusOnNavigate RouteData="routeData" Selector="h1"/>
</Found>
</Router>
</Router>
<HeadOutlet />