Skip to content

Commit

Permalink
Merge pull request #136 from BUTR/code-formatting/fix-codeformatting
Browse files Browse the repository at this point in the history
Automated PR to fix formatting errors
  • Loading branch information
Aragas authored Dec 8, 2023
2 parents cd67fa2 + 8a109c7 commit 59d7e38
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 11 deletions.
3 changes: 1 addition & 2 deletions src/BUTR.Site.NexusMods.Server/Models/API/MessageResponse.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using Microsoft.AspNetCore.Mvc;

namespace BUTR.Site.NexusMods.Server.Models.API;

namespace BUTR.Site.NexusMods.Server.Models.API;
4 changes: 2 additions & 2 deletions src/BUTR.Site.NexusMods.Server/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public void ConfigureServices(IServiceCollection services)
client.BaseAddress = new Uri("https://embed.gog.com/");
client.DefaultRequestHeaders.Add("User-Agent", userAgent);
}).AddPolicyHandler(GetRetryPolicy());

services.AddSingleton<SteamBinaryCache>();
services.AddSingleton<SteamDepotDownloader>();

Expand Down Expand Up @@ -240,7 +240,7 @@ public void ConfigureServices(IServiceCollection services)

services.AddControllersWithAPIResult(opt => opt.ValueProviderFactories.Add(new ClaimsValueProviderFactory()))
.AddJsonOptions(opt => Configure(opt.JsonSerializerOptions));

services.AddHttpContextAccessor();
services.AddRouting();
services.AddResponseCompression(options =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ namespace BUTR.Site.NexusMods.Server.Utils.Http.ApiResults;
public record ApiResult(ProblemDetails? Error) : IApiResult, IConvertToActionResult
{
public static implicit operator ObjectResult(ApiResult apiResult) => new(apiResult);

public static ApiResult FromError(ProblemDetails? error) => new(error);

public IActionResult Convert() => (ObjectResult) this;
}

Expand All @@ -22,6 +22,6 @@ public sealed record ApiResult<TValue>(TValue? Value, ProblemDetails? Error) : I

public static ApiResult<TValue?> FromResult(TValue? data, ProblemDetails? error = null) => new(data, error);
public static ApiResult<TValue?> FromError(ProblemDetails? error) => new(default, error);

public IActionResult Convert() => (ObjectResult) this;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public void Apply(OpenApiOperation operation, OperationFilterContext? context)

if (!operation.Responses.TryGetValue("200", out var successResponse))
return;

var copy400 = CopyHelper.CopyPublicProperties(successResponse, new OpenApiResponse());
copy400.Description = "Invalid API Request.";
operation.Responses.Add("400", copy400);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Controllers;
using Microsoft.AspNetCore.Mvc.Infrastructure;
using Microsoft.Extensions.DependencyInjection;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using BUTR.Site.NexusMods.Server.Extensions;
using BUTR.Site.NexusMods.Server.Extensions;

using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public sealed class StreamingMultipartResult : IActionResult
{
public IEnumerable<Func<Stream, CancellationToken, Task>> Contents { get; }
public string Mime { get; }

public StreamingMultipartResult(IEnumerable<Func<Stream, CancellationToken, Task>> contents, string mime)
{
Contents = contents;
Expand Down

0 comments on commit 59d7e38

Please sign in to comment.