[Blazor] Set up settings on startup.

This commit is contained in:
2025-07-27 03:29:21 +01:00
parent f4b87f68ec
commit 80f1c0e28e

View File

@@ -4,6 +4,7 @@ using Microsoft.FluentUI.AspNetCore.Components;
using RomRepoMgr.Blazor;
using RomRepoMgr.Blazor.Components;
using RomRepoMgr.Database;
using RomRepoMgr.Settings;
using Serilog;
Log.Logger = new LoggerConfiguration()
@@ -69,6 +70,17 @@ builder.Services.AddDbContextFactory<Context>(options =>
#endif
});
Log.Debug("Setting the settings...");
Settings.Current = new SetSettings
{
DatabasePath = Path.Combine(Environment.CurrentDirectory, Consts.DbFolder, "database.db"),
TemporaryFolder = Path.Combine(Environment.CurrentDirectory, Consts.TemporaryFolder),
RepositoryPath = Path.Combine(Environment.CurrentDirectory, Consts.RepositoryFolder),
UseInternalDecompressor = true,
Compression = CompressionType.Zstd // Todo: Read from configuration
};
Log.Debug("Building the application...");
WebApplication app = builder.Build();