Skip to content

Commit d2ef59d

Browse files
authored
Merge pull request #457
Updated dependencies. Refactored to async scheme
2 parents 8e242dc + 8e2b333 commit d2ef59d

File tree

101 files changed

+1113
-2407
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+1113
-2407
lines changed

Moonlight.ApiServer.Runtime/Program.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010

1111
var cs = new Startup();
1212

13-
await cs.Initialize(args, pluginLoader.Instances);
13+
await cs.InitializeAsync(args, pluginLoader.Instances);
1414

1515
var builder = WebApplication.CreateBuilder(args);
1616

17-
await cs.AddMoonlight(builder);
17+
await cs.AddMoonlightAsync(builder);
1818

1919
var app = builder.Build();
2020

21-
await cs.AddMoonlight(app);
21+
await cs.AddMoonlightAsync(app);
2222

2323
// Handle setup of wasm app hosting in the runtime
2424
// so the Moonlight.ApiServer doesn't need the wasm package

Moonlight.ApiServer/Configuration/AppConfiguration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public record SignalRData
6262
public record FilesData
6363
{
6464
[YamlMember(Description = "The maximum file size limit a combine operation is allowed to process")]
65-
public long CombineLimit { get; set; } = ByteConverter.FromGigaBytes(5).MegaBytes;
65+
public double CombineLimit { get; set; } = ByteConverter.FromGigaBytes(5).MegaBytes;
6666
}
6767

6868
public record FrontendData

Moonlight.ApiServer/Database/CoreDataContext.cs

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,47 @@
11
using Hangfire.EntityFrameworkCore;
22
using Microsoft.EntityFrameworkCore;
3-
using MoonCore.Extended.SingleDb;
43
using Moonlight.ApiServer.Configuration;
54
using Moonlight.ApiServer.Database.Entities;
65
using Moonlight.ApiServer.Models;
76

87
namespace Moonlight.ApiServer.Database;
98

10-
public class CoreDataContext : DatabaseContext
9+
public class CoreDataContext : DbContext
1110
{
12-
public override string Prefix { get; } = "Core";
13-
11+
private readonly AppConfiguration Configuration;
12+
1413
public DbSet<User> Users { get; set; }
1514
public DbSet<ApiKey> ApiKeys { get; set; }
1615
public DbSet<Theme> Themes { get; set; }
1716

1817
public CoreDataContext(AppConfiguration configuration)
1918
{
20-
Options = new()
19+
Configuration = configuration;
20+
}
21+
22+
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
23+
{
24+
if(optionsBuilder.IsConfigured)
25+
return;
26+
27+
var database = Configuration.Database;
28+
29+
var connectionString = $"Host={database.Host};" +
30+
$"Port={database.Port};" +
31+
$"Database={database.Database};" +
32+
$"Username={database.Username};" +
33+
$"Password={database.Password}";
34+
35+
optionsBuilder.UseNpgsql(connectionString, builder =>
2136
{
22-
Host = configuration.Database.Host,
23-
Port = configuration.Database.Port,
24-
Username = configuration.Database.Username,
25-
Password = configuration.Database.Password,
26-
Database = configuration.Database.Database
27-
};
37+
builder.MigrationsHistoryTable("MigrationsHistory", "core");
38+
});
2839
}
2940

3041
protected override void OnModelCreating(ModelBuilder modelBuilder)
3142
{
43+
modelBuilder.Model.SetDefaultSchema("core");
44+
3245
base.OnModelCreating(modelBuilder);
3346
modelBuilder.OnHangfireModelCreating();
3447

Moonlight.ApiServer/Database/Migrations/20250226080942_AddedUsersAndApiKey.Designer.cs

Lines changed: 0 additions & 90 deletions
This file was deleted.

Moonlight.ApiServer/Database/Migrations/20250226080942_AddedUsersAndApiKey.cs

Lines changed: 0 additions & 59 deletions
This file was deleted.

Moonlight.ApiServer/Database/Migrations/20250314095412_ModifiedApiKeyEntity.Designer.cs

Lines changed: 0 additions & 89 deletions
This file was deleted.

Moonlight.ApiServer/Database/Migrations/20250314095412_ModifiedApiKeyEntity.cs

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)