Fixed some warnings

pull/4072/head
tidusjar 4 years ago
parent 80a3dedf87
commit bb4d8924f4

@ -0,0 +1,10 @@
[*.cs]
# CS1591: Missing XML comment for publicly visible type or member
dotnet_diagnostic.CS1591.severity = none
# RCS1090: Add call to 'ConfigureAwait' (or vice versa).
dotnet_diagnostic.RCS1090.severity = none
# RCS1036: Remove redundant empty line.
dotnet_diagnostic.RCS1036.severity = none

@ -8,6 +8,5 @@ namespace Ombi.Attributes
{ {
Roles = "Admin"; Roles = "Admin";
} }
} }
} }

@ -46,6 +46,10 @@
<None Remove="wwwroot\dist\**" /> <None Remove="wwwroot\dist\**" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Include="..\.editorconfig" Link=".editorconfig" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="AspNetCore.HealthChecks.MySql" Version="3.0.0" /> <PackageReference Include="AspNetCore.HealthChecks.MySql" Version="3.0.0" />

@ -49,8 +49,6 @@ namespace Ombi
} }
}); });
Console.WriteLine(HelpOutput(result)); Console.WriteLine(HelpOutput(result));
if (baseUrl.HasValue()) if (baseUrl.HasValue())
{ {
@ -64,11 +62,9 @@ namespace Ombi
demoInstance.Demo = demo; demoInstance.Demo = demo;
instance.StoragePath = storagePath ?? string.Empty; instance.StoragePath = storagePath ?? string.Empty;
var services = new ServiceCollection(); var services = new ServiceCollection();
services.ConfigureDatabases(null); services.ConfigureDatabases(null);
using (var provider = services.BuildServiceProvider()) using var provider = services.BuildServiceProvider();
{
var settingsDb = provider.GetRequiredService<SettingsContext>(); var settingsDb = provider.GetRequiredService<SettingsContext>();
var ombiDb = provider.GetRequiredService<OmbiContext>(); var ombiDb = provider.GetRequiredService<OmbiContext>();
@ -103,12 +99,10 @@ namespace Ombi
var strat = settingsDb.Database.CreateExecutionStrategy(); var strat = settingsDb.Database.CreateExecutionStrategy();
await strat.ExecuteAsync(async () => await strat.ExecuteAsync(async () =>
{ {
using (var tran = await settingsDb.Database.BeginTransactionAsync()) using var tran = await settingsDb.Database.BeginTransactionAsync();
{
settingsDb.ApplicationConfigurations.Add(url); settingsDb.ApplicationConfigurations.Add(url);
await settingsDb.SaveChangesAsync(); await settingsDb.SaveChangesAsync();
await tran.CommitAsync(); await tran.CommitAsync();
}
}); });
urlValue = url.Value; urlValue = url.Value;
@ -120,11 +114,9 @@ namespace Ombi
var strat = settingsDb.Database.CreateExecutionStrategy(); var strat = settingsDb.Database.CreateExecutionStrategy();
await strat.ExecuteAsync(async () => await strat.ExecuteAsync(async () =>
{ {
using (var tran = await settingsDb.Database.BeginTransactionAsync()) using var tran = await settingsDb.Database.BeginTransactionAsync();
{
await settingsDb.SaveChangesAsync(); await settingsDb.SaveChangesAsync();
await tran.CommitAsync(); await tran.CommitAsync();
}
}); });
urlValue = url.Value; urlValue = url.Value;
@ -140,7 +132,6 @@ namespace Ombi
CreateHostBuilder(args).Build().Run(); CreateHostBuilder(args).Build().Run();
} }
}
private static async Task CheckSecurityToken(ApplicationConfiguration securityToken, SettingsContext ctx, StartupSingleton instance) private static async Task CheckSecurityToken(ApplicationConfiguration securityToken, SettingsContext ctx, StartupSingleton instance)
{ {
@ -154,12 +145,10 @@ namespace Ombi
var strat = ctx.Database.CreateExecutionStrategy(); var strat = ctx.Database.CreateExecutionStrategy();
await strat.ExecuteAsync(async () => await strat.ExecuteAsync(async () =>
{ {
using (var tran = await ctx.Database.BeginTransactionAsync()) using var tran = await ctx.Database.BeginTransactionAsync();
{
ctx.ApplicationConfigurations.Add(securityToken); ctx.ApplicationConfigurations.Add(securityToken);
await ctx.SaveChangesAsync(); await ctx.SaveChangesAsync();
await tran.CommitAsync(); await tran.CommitAsync();
}
}); });
} }
@ -170,7 +159,7 @@ namespace Ombi
Host.CreateDefaultBuilder(args) Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder => .ConfigureWebHostDefaults(webBuilder =>
{ {
webBuilder.ConfigureKestrel(serverOptions => webBuilder.ConfigureKestrel(_ =>
{ {
// Set properties and call methods on options // Set properties and call methods on options
}); });
@ -204,12 +193,10 @@ namespace Ombi
var strat = settingsDb.Database.CreateExecutionStrategy(); var strat = settingsDb.Database.CreateExecutionStrategy();
await strat.ExecuteAsync(async () => await strat.ExecuteAsync(async () =>
{ {
using (var tran = await settingsDb.Database.BeginTransactionAsync()) using var tran = await settingsDb.Database.BeginTransactionAsync();
{
settingsDb.Add(ombiSettingsContent); settingsDb.Add(ombiSettingsContent);
await settingsDb.SaveChangesAsync(); await settingsDb.SaveChangesAsync();
await tran.CommitAsync(); await tran.CommitAsync();
}
}); });
} }
var ombiSettings = JsonConvert.DeserializeObject<OmbiSettings>(ombiSettingsContent.Content); var ombiSettings = JsonConvert.DeserializeObject<OmbiSettings>(ombiSettingsContent.Content);

@ -22,7 +22,7 @@
}, },
"Ombi": { "Ombi": {
"commandName": "Project", "commandName": "Project",
"commandLineArgs": "--host http://localhost:3577 ", "commandLineArgs": "--host http://localhost:3577 --baseUrl /ombi/",
"environmentVariables": { "environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development" "ASPNETCORE_ENVIRONMENT": "Development"
}, },

@ -93,7 +93,7 @@ namespace Ombi
.AddNewtonsoftJson(x => x.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore); .AddNewtonsoftJson(x => x.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore);
services.AddOmbiMappingProfile(); services.AddOmbiMappingProfile();
services.AddAutoMapper(expression => { expression.AddCollectionMappers(); }); services.AddAutoMapper(expression => expression.AddCollectionMappers());
services.RegisterApplicationDependencies(); // Ioc and EF services.RegisterApplicationDependencies(); // Ioc and EF
services.AddSwagger(); services.AddSwagger();
@ -110,10 +110,7 @@ namespace Ombi
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Latest); services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Latest);
services.AddSignalR(); services.AddSignalR();
services.AddSpaStaticFiles(configuration => services.AddSpaStaticFiles(configuration => configuration.RootPath = "ClientApp/dist");
{
configuration.RootPath = "ClientApp/dist";
});
} }

Loading…
Cancel
Save