[CHANGE] Library service, db migrations, ui blazor

This commit is contained in:
max
2025-08-31 20:11:03 +02:00
parent aeb9adf930
commit 98fe4b9391
19 changed files with 1206 additions and 18 deletions

View File

@@ -0,0 +1,36 @@
using Manager.App.Models.Library;
using MudBlazor;
namespace Manager.App.Components.Pages;
public partial class Library
{
private LibraryInformation? _libraryInformation;
private bool _loading;
private CancellationTokenSource _cancellationTokenSource = new();
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
if (_cancellationTokenSource.IsCancellationRequested)
{
_cancellationTokenSource = new CancellationTokenSource();
}
_loading = true;
await InvokeAsync(StateHasChanged);
var result = await LibraryService.GetLibraryInfoAsync(_cancellationTokenSource.Token);
if (result is { IsSuccess: true, Value: not null })
{
_libraryInformation = result.Value;
}
else
{
Snackbar.Add($"Failed to get library info. Error: {result.Error?.Description}", Severity.Error);
}
_loading = false;
await InvokeAsync(StateHasChanged);
}
}
}