From 7ae1b9c808b0fc0babd8a14dfb4ebf191e2d1b1f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 19 Feb 2024 00:03:50 +0000 Subject: [PATCH] Automated dotnet-format update --- .../Attributes/HostedServiceAttribute.cs | 2 +- .../Attributes/ScopedServiceAttribute.cs | 2 +- .../Attributes/SingletonServiceAttribute.cs | 2 +- .../Attributes/TransientServiceAttribute.cs | 2 +- .../Interfaces/IToRegister.cs | 2 +- .../SourceGenerator.cs | 24 +++++++++---------- .../ApiResultActionResultTypeMapperTests.cs | 2 +- .../ApiResultProblemDetailsWriterTests.cs | 6 ++--- .../Csv/ExportOutputFormatterTests.cs | 10 ++++---- .../Extensions/ImmutableArrayExtensions.cs | 2 +- .../Extensions/ListExtensions.cs | 2 +- .../General/ICrashReportBatchedHandler.cs | 2 +- .../Services/General/IDiffProvider.cs | 2 +- .../General/INexusModsModFileParser.cs | 2 +- .../General/IQuartzEventProviderService.cs | 2 +- .../Services/General/ISteamBinaryCache.cs | 2 +- .../Services/General/ISteamDepotDownloader.cs | 2 +- .../HttpClients/ICrashReporterClient.cs | 2 +- .../Services/HttpClients/IDiscordClient.cs | 2 +- .../Services/HttpClients/IGOGAuthClient.cs | 6 ++--- .../Services/HttpClients/IGOGEmbedClient.cs | 2 +- .../Services/HttpClients/IGitHubAPIClient.cs | 2 +- .../Services/HttpClients/IGitHubClient.cs | 2 +- .../HttpClients/INexusModsAPIClient.cs | 2 +- .../Services/HttpClients/INexusModsClient.cs | 2 +- .../Services/HttpClients/ISteamAPIClient.cs | 6 ++--- .../HttpClients/ISteamCommunityClient.cs | 2 +- src/BUTR.Site.NexusMods.Server/Startup.cs | 6 ++--- .../Utils/Http/ApiResults/ApiResultUtils.cs | 2 +- 29 files changed, 52 insertions(+), 52 deletions(-) diff --git a/src/BUTR.Site.NexusMods.DependencyInjection/Attributes/HostedServiceAttribute.cs b/src/BUTR.Site.NexusMods.DependencyInjection/Attributes/HostedServiceAttribute.cs index 9c561780..9cd26dda 100644 --- a/src/BUTR.Site.NexusMods.DependencyInjection/Attributes/HostedServiceAttribute.cs +++ b/src/BUTR.Site.NexusMods.DependencyInjection/Attributes/HostedServiceAttribute.cs @@ -1,4 +1,4 @@ -namespace BUTR.Site.NexusMods.DependencyInjection; +namespace BUTR.Site.NexusMods.DependencyInjection; [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)] public sealed class HostedServiceAttribute : Attribute, IToRegister { } diff --git a/src/BUTR.Site.NexusMods.DependencyInjection/Attributes/ScopedServiceAttribute.cs b/src/BUTR.Site.NexusMods.DependencyInjection/Attributes/ScopedServiceAttribute.cs index 811f2f8a..ce64bd81 100644 --- a/src/BUTR.Site.NexusMods.DependencyInjection/Attributes/ScopedServiceAttribute.cs +++ b/src/BUTR.Site.NexusMods.DependencyInjection/Attributes/ScopedServiceAttribute.cs @@ -1,4 +1,4 @@ -namespace BUTR.Site.NexusMods.DependencyInjection; +namespace BUTR.Site.NexusMods.DependencyInjection; [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)] public sealed class ScopedServiceAttribute : Attribute, IToRegister { } \ No newline at end of file diff --git a/src/BUTR.Site.NexusMods.DependencyInjection/Attributes/SingletonServiceAttribute.cs b/src/BUTR.Site.NexusMods.DependencyInjection/Attributes/SingletonServiceAttribute.cs index 5ffd73cb..2b9d3103 100644 --- a/src/BUTR.Site.NexusMods.DependencyInjection/Attributes/SingletonServiceAttribute.cs +++ b/src/BUTR.Site.NexusMods.DependencyInjection/Attributes/SingletonServiceAttribute.cs @@ -1,4 +1,4 @@ -namespace BUTR.Site.NexusMods.DependencyInjection; +namespace BUTR.Site.NexusMods.DependencyInjection; [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)] public sealed class SingletonServiceAttribute : Attribute, IToRegister { } diff --git a/src/BUTR.Site.NexusMods.DependencyInjection/Attributes/TransientServiceAttribute.cs b/src/BUTR.Site.NexusMods.DependencyInjection/Attributes/TransientServiceAttribute.cs index e3ad881a..3fdfbd97 100644 --- a/src/BUTR.Site.NexusMods.DependencyInjection/Attributes/TransientServiceAttribute.cs +++ b/src/BUTR.Site.NexusMods.DependencyInjection/Attributes/TransientServiceAttribute.cs @@ -1,4 +1,4 @@ -namespace BUTR.Site.NexusMods.DependencyInjection; +namespace BUTR.Site.NexusMods.DependencyInjection; [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)] public sealed class TransientServiceAttribute : Attribute, IToRegister { } \ No newline at end of file diff --git a/src/BUTR.Site.NexusMods.DependencyInjection/Interfaces/IToRegister.cs b/src/BUTR.Site.NexusMods.DependencyInjection/Interfaces/IToRegister.cs index c612c5a7..041ca798 100644 --- a/src/BUTR.Site.NexusMods.DependencyInjection/Interfaces/IToRegister.cs +++ b/src/BUTR.Site.NexusMods.DependencyInjection/Interfaces/IToRegister.cs @@ -1,3 +1,3 @@ -namespace BUTR.Site.NexusMods.DependencyInjection; +namespace BUTR.Site.NexusMods.DependencyInjection; public interface IToRegister { } \ No newline at end of file diff --git a/src/BUTR.Site.NexusMods.DependencyInjection/SourceGenerator.cs b/src/BUTR.Site.NexusMods.DependencyInjection/SourceGenerator.cs index b9d1f968..7f38c82a 100644 --- a/src/BUTR.Site.NexusMods.DependencyInjection/SourceGenerator.cs +++ b/src/BUTR.Site.NexusMods.DependencyInjection/SourceGenerator.cs @@ -1,4 +1,4 @@ -using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Text; using System.Diagnostics.CodeAnalysis; @@ -44,7 +44,7 @@ partial void ConfigureServicesPartial(IServiceCollection services) { var attributeData = GetAttributeData(typeSymbol); if (attributeData?.AttributeClass is null) continue; - + var interfaceSymbols = attributeData.AttributeClass.TypeArguments; foreach (var interfaceSymbol in interfaceSymbols) @@ -62,7 +62,7 @@ partial void ConfigureServicesPartial(IServiceCollection services) """); } } - + stringBuilder.Append(""" } @@ -75,7 +75,7 @@ partial void ConfigureServicesPartial(IServiceCollection services) private IEnumerable GetTypesWithIToRegisterAttributes(Compilation compilation) { var allTypes = GetAllTypes(compilation.GlobalNamespace); - var types = allTypes.Where(x => + var types = allTypes.Where(x => x is { TypeKind: TypeKind.Class, IsAbstract: false } && x.GetAttributes().Any(a => a.AttributeClass?.Interfaces.Any(i => i.Name.Equals("IToRegister", StringComparison.OrdinalIgnoreCase)) == true)).ToList(); return types; @@ -84,22 +84,22 @@ private IEnumerable GetTypesWithIToRegisterAttributes(Compilat private IEnumerable GetAllTypes(INamespaceSymbol @namespace) { foreach (var type in @namespace.GetTypeMembers()) - foreach (var nestedType in GetNestedTypes(type)) - yield return nestedType; + foreach (var nestedType in GetNestedTypes(type)) + yield return nestedType; foreach (var nestedNamespace in @namespace.GetNamespaceMembers()) - foreach (var type in GetAllTypes(nestedNamespace)) - yield return type; + foreach (var type in GetAllTypes(nestedNamespace)) + yield return type; } private IEnumerable GetNestedTypes(INamedTypeSymbol type) { yield return type; - + foreach (var nestedType in type.GetTypeMembers().SelectMany(GetNestedTypes)) yield return nestedType; } - + private static string GetMethodName(INamedTypeSymbol attributeClass) { return attributeClass.Name switch @@ -111,7 +111,7 @@ var x when x.StartsWith("HostedService") => "AddHostedService", _ => throw new InvalidOperationException() }; } - + private static AttributeData? GetAttributeData(INamedTypeSymbol typeSymbol) { static IEnumerable GetAllInterfaces(INamedTypeSymbol? namedTypeSymbol) @@ -125,7 +125,7 @@ static IEnumerable GetAllInterfaces(INamedTypeSymbol? namedTyp typeSymbol = typeSymbol.BaseType; } } - + return typeSymbol.GetAttributes().Where(a => { return GetAllInterfaces(a.AttributeClass).Any(i => i.Name.Equals("IToRegister", StringComparison.OrdinalIgnoreCase)); diff --git a/src/BUTR.Site.NexusMods.Server.Tests/ApiResult/ApiResultActionResultTypeMapperTests.cs b/src/BUTR.Site.NexusMods.Server.Tests/ApiResult/ApiResultActionResultTypeMapperTests.cs index 0cb779c9..6df07354 100644 --- a/src/BUTR.Site.NexusMods.Server.Tests/ApiResult/ApiResultActionResultTypeMapperTests.cs +++ b/src/BUTR.Site.NexusMods.Server.Tests/ApiResult/ApiResultActionResultTypeMapperTests.cs @@ -1,4 +1,4 @@ -using BUTR.Site.NexusMods.Server.Utils.Http.ApiResults; +using BUTR.Site.NexusMods.Server.Utils.Http.ApiResults; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Infrastructure; diff --git a/src/BUTR.Site.NexusMods.Server.Tests/ApiResult/ApiResultProblemDetailsWriterTests.cs b/src/BUTR.Site.NexusMods.Server.Tests/ApiResult/ApiResultProblemDetailsWriterTests.cs index 764cdd59..8ed20bcb 100644 --- a/src/BUTR.Site.NexusMods.Server.Tests/ApiResult/ApiResultProblemDetailsWriterTests.cs +++ b/src/BUTR.Site.NexusMods.Server.Tests/ApiResult/ApiResultProblemDetailsWriterTests.cs @@ -1,4 +1,4 @@ -using BUTR.Site.NexusMods.Server.Utils.Http.ApiResults; +using BUTR.Site.NexusMods.Server.Utils.Http.ApiResults; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; @@ -14,7 +14,7 @@ namespace BUTR.Site.NexusMods.Server.Tests.ApiResult; public class ApiResultProblemDetailsWriterTests { private ApiResult ControllerMethod() => default!; - + [Fact] public void CanWrite_ReturnsTrue_WhenEndpointHasControllerActionDescriptor() { @@ -63,7 +63,7 @@ public void CanWrite_ReturnsFalse_WhenEndpointDoesNotHaveControllerActionDescrip } [Fact] - public async Task WriteAsync_ExecutesObjectResult_WhenCalled() + public async Task WriteAsync_ExecutesObjectResult_WhenCalledAsync() { // Arrange var actionResultExecutorMock = new Mock>(); diff --git a/src/BUTR.Site.NexusMods.Server.Tests/Csv/ExportOutputFormatterTests.cs b/src/BUTR.Site.NexusMods.Server.Tests/Csv/ExportOutputFormatterTests.cs index 6683adc5..95eac4ac 100644 --- a/src/BUTR.Site.NexusMods.Server.Tests/Csv/ExportOutputFormatterTests.cs +++ b/src/BUTR.Site.NexusMods.Server.Tests/Csv/ExportOutputFormatterTests.cs @@ -17,10 +17,10 @@ private class MockCsvFile : ICsvFile { [Name("Test"), Index(0)] public string Test { get; init; } - + public static string GenerateFilename() => "mock.csv"; } - + [Fact] public void CanWriteType_ReturnsTrue_ForAssignableTypes() { @@ -37,7 +37,7 @@ public void CanWriteType_ReturnsFalse_ForNonAssignableTypes() } [Fact] - public async void WriteResponseBodyAsync_WritesSingleEntry_ToResponseBody() + public async Task WriteResponseBodyAsync_WritesSingleEntry_ToResponseBodyAsync() { var formatter = new ExportOutputFormatter(); var context = new OutputFormatterWriteContext( @@ -52,7 +52,7 @@ public async void WriteResponseBodyAsync_WritesSingleEntry_ToResponseBody() } [Fact] - public async void WriteResponseBodyAsync_WritesEnumerable_ToResponseBody() + public async Task WriteResponseBodyAsync_WritesEnumerable_ToResponseBodyAsync() { var formatter = new ExportOutputFormatter(); var context = new OutputFormatterWriteContext( @@ -67,7 +67,7 @@ public async void WriteResponseBodyAsync_WritesEnumerable_ToResponseBody() } [Fact] - public async void WriteResponseBodyAsync_ThrowsException_ForInvalidObjectType() + public async Task WriteResponseBodyAsync_ThrowsException_ForInvalidObjectTypeAsync() { var formatter = new ExportOutputFormatter(); var context = new OutputFormatterWriteContext( diff --git a/src/BUTR.Site.NexusMods.Server/Extensions/ImmutableArrayExtensions.cs b/src/BUTR.Site.NexusMods.Server/Extensions/ImmutableArrayExtensions.cs index 64d8ab3a..9b56f31a 100644 --- a/src/BUTR.Site.NexusMods.Server/Extensions/ImmutableArrayExtensions.cs +++ b/src/BUTR.Site.NexusMods.Server/Extensions/ImmutableArrayExtensions.cs @@ -15,7 +15,7 @@ public static class ImmutableArrayExtensions /// The immutable array to convert. /// A regular array containing the same elements as the immutable array. public static T[] AsArray(this ImmutableArray immutableArray) => Unsafe.As, T[]>(ref immutableArray); - + /// /// Converts a regular array to an . /// diff --git a/src/BUTR.Site.NexusMods.Server/Extensions/ListExtensions.cs b/src/BUTR.Site.NexusMods.Server/Extensions/ListExtensions.cs index 6a05e3a4..6ade06da 100644 --- a/src/BUTR.Site.NexusMods.Server/Extensions/ListExtensions.cs +++ b/src/BUTR.Site.NexusMods.Server/Extensions/ListExtensions.cs @@ -29,7 +29,7 @@ public static int BinarySearch(this IList instance, TKey itemKey, Fu { var mid = (start + end) / 2; var result = keySelector(instance[mid]).CompareTo(itemKey); - + if (result == 0) return mid; if (result < 0) diff --git a/src/BUTR.Site.NexusMods.Server/Services/General/ICrashReportBatchedHandler.cs b/src/BUTR.Site.NexusMods.Server/Services/General/ICrashReportBatchedHandler.cs index 34b0b541..a2419541 100644 --- a/src/BUTR.Site.NexusMods.Server/Services/General/ICrashReportBatchedHandler.cs +++ b/src/BUTR.Site.NexusMods.Server/Services/General/ICrashReportBatchedHandler.cs @@ -1,4 +1,4 @@ -using BUTR.CrashReport.Bannerlord.Parser; +using BUTR.CrashReport.Bannerlord.Parser; using BUTR.CrashReport.Models; using BUTR.Site.NexusMods.DependencyInjection; using BUTR.Site.NexusMods.Server.Contexts; diff --git a/src/BUTR.Site.NexusMods.Server/Services/General/IDiffProvider.cs b/src/BUTR.Site.NexusMods.Server/Services/General/IDiffProvider.cs index 28e276f7..49ad70cf 100644 --- a/src/BUTR.Site.NexusMods.Server/Services/General/IDiffProvider.cs +++ b/src/BUTR.Site.NexusMods.Server/Services/General/IDiffProvider.cs @@ -1,4 +1,4 @@ -using BUTR.Site.NexusMods.DependencyInjection; +using BUTR.Site.NexusMods.DependencyInjection; using BUTR.Site.NexusMods.Server.Models; using BUTR.Site.NexusMods.Server.Utils; diff --git a/src/BUTR.Site.NexusMods.Server/Services/General/INexusModsModFileParser.cs b/src/BUTR.Site.NexusMods.Server/Services/General/INexusModsModFileParser.cs index 9a01b64d..6ff3ef3a 100644 --- a/src/BUTR.Site.NexusMods.Server/Services/General/INexusModsModFileParser.cs +++ b/src/BUTR.Site.NexusMods.Server/Services/General/INexusModsModFileParser.cs @@ -1,4 +1,4 @@ -using AsmResolver.DotNet; +using AsmResolver.DotNet; using AsmResolver.PE; using Bannerlord.ModuleManager; diff --git a/src/BUTR.Site.NexusMods.Server/Services/General/IQuartzEventProviderService.cs b/src/BUTR.Site.NexusMods.Server/Services/General/IQuartzEventProviderService.cs index 5bc4401d..fe6bbd7a 100644 --- a/src/BUTR.Site.NexusMods.Server/Services/General/IQuartzEventProviderService.cs +++ b/src/BUTR.Site.NexusMods.Server/Services/General/IQuartzEventProviderService.cs @@ -1,4 +1,4 @@ -using BUTR.Site.NexusMods.DependencyInjection; +using BUTR.Site.NexusMods.DependencyInjection; using BUTR.Site.NexusMods.Server.Models.Quartz; using Quartz; diff --git a/src/BUTR.Site.NexusMods.Server/Services/General/ISteamBinaryCache.cs b/src/BUTR.Site.NexusMods.Server/Services/General/ISteamBinaryCache.cs index 5010b468..52bb5855 100644 --- a/src/BUTR.Site.NexusMods.Server/Services/General/ISteamBinaryCache.cs +++ b/src/BUTR.Site.NexusMods.Server/Services/General/ISteamBinaryCache.cs @@ -1,4 +1,4 @@ -using BUTR.Site.NexusMods.DependencyInjection; +using BUTR.Site.NexusMods.DependencyInjection; using BUTR.Site.NexusMods.Server.Options; using Microsoft.Extensions.Caching.Distributed; diff --git a/src/BUTR.Site.NexusMods.Server/Services/General/ISteamDepotDownloader.cs b/src/BUTR.Site.NexusMods.Server/Services/General/ISteamDepotDownloader.cs index e41b25ae..e2a624f6 100644 --- a/src/BUTR.Site.NexusMods.Server/Services/General/ISteamDepotDownloader.cs +++ b/src/BUTR.Site.NexusMods.Server/Services/General/ISteamDepotDownloader.cs @@ -1,4 +1,4 @@ -using BUTR.Site.NexusMods.DependencyInjection; +using BUTR.Site.NexusMods.DependencyInjection; using BUTR.Site.NexusMods.Server.Options; using Microsoft.Extensions.Options; diff --git a/src/BUTR.Site.NexusMods.Server/Services/HttpClients/ICrashReporterClient.cs b/src/BUTR.Site.NexusMods.Server/Services/HttpClients/ICrashReporterClient.cs index 7475d1fc..45fa38b7 100644 --- a/src/BUTR.Site.NexusMods.Server/Services/HttpClients/ICrashReporterClient.cs +++ b/src/BUTR.Site.NexusMods.Server/Services/HttpClients/ICrashReporterClient.cs @@ -1,4 +1,4 @@ -using BUTR.CrashReport.Models; +using BUTR.CrashReport.Models; using BUTR.Site.NexusMods.Server.Models; using Microsoft.Extensions.Options; diff --git a/src/BUTR.Site.NexusMods.Server/Services/HttpClients/IDiscordClient.cs b/src/BUTR.Site.NexusMods.Server/Services/HttpClients/IDiscordClient.cs index 182f138b..6cc5e701 100644 --- a/src/BUTR.Site.NexusMods.Server/Services/HttpClients/IDiscordClient.cs +++ b/src/BUTR.Site.NexusMods.Server/Services/HttpClients/IDiscordClient.cs @@ -1,4 +1,4 @@ -using BUTR.Site.NexusMods.Server.Options; +using BUTR.Site.NexusMods.Server.Options; using Microsoft.Extensions.Options; diff --git a/src/BUTR.Site.NexusMods.Server/Services/HttpClients/IGOGAuthClient.cs b/src/BUTR.Site.NexusMods.Server/Services/HttpClients/IGOGAuthClient.cs index de3fc4a3..2dc02ac4 100644 --- a/src/BUTR.Site.NexusMods.Server/Services/HttpClients/IGOGAuthClient.cs +++ b/src/BUTR.Site.NexusMods.Server/Services/HttpClients/IGOGAuthClient.cs @@ -1,4 +1,4 @@ -using Microsoft.Extensions.Options; +using Microsoft.Extensions.Options; using System; using System.Net.Http; @@ -50,7 +50,7 @@ public GOGAuthClient(HttpClient httpClient) var data = JsonSerializer.Deserialize(await response.Content.ReadAsStreamAsync(ct)); if (data is null) return null; - + return new GOGOAuthTokens(data.UserId, data.AccessToken, data.RefreshToken, DateTimeOffset.UtcNow.AddMinutes(data.ExpiresIn ?? 0)); } @@ -65,7 +65,7 @@ public GOGAuthClient(HttpClient httpClient) var data = JsonSerializer.Deserialize(await response.Content.ReadAsStreamAsync(ct)); if (data is null) return null; - + return new GOGOAuthTokens(data.UserId, data.AccessToken, data.RefreshToken, DateTimeOffset.UtcNow.AddMinutes(data.ExpiresIn ?? 0)); } } \ No newline at end of file diff --git a/src/BUTR.Site.NexusMods.Server/Services/HttpClients/IGOGEmbedClient.cs b/src/BUTR.Site.NexusMods.Server/Services/HttpClients/IGOGEmbedClient.cs index 569ff781..449e56b4 100644 --- a/src/BUTR.Site.NexusMods.Server/Services/HttpClients/IGOGEmbedClient.cs +++ b/src/BUTR.Site.NexusMods.Server/Services/HttpClients/IGOGEmbedClient.cs @@ -1,4 +1,4 @@ -using Microsoft.Extensions.Options; +using Microsoft.Extensions.Options; using System; using System.Collections.Generic; diff --git a/src/BUTR.Site.NexusMods.Server/Services/HttpClients/IGitHubAPIClient.cs b/src/BUTR.Site.NexusMods.Server/Services/HttpClients/IGitHubAPIClient.cs index db09a150..7ca50f9e 100644 --- a/src/BUTR.Site.NexusMods.Server/Services/HttpClients/IGitHubAPIClient.cs +++ b/src/BUTR.Site.NexusMods.Server/Services/HttpClients/IGitHubAPIClient.cs @@ -1,4 +1,4 @@ -using Microsoft.Extensions.Options; +using Microsoft.Extensions.Options; using System; using System.Net.Http; diff --git a/src/BUTR.Site.NexusMods.Server/Services/HttpClients/IGitHubClient.cs b/src/BUTR.Site.NexusMods.Server/Services/HttpClients/IGitHubClient.cs index 63d8703d..bdecd2c5 100644 --- a/src/BUTR.Site.NexusMods.Server/Services/HttpClients/IGitHubClient.cs +++ b/src/BUTR.Site.NexusMods.Server/Services/HttpClients/IGitHubClient.cs @@ -1,4 +1,4 @@ -using BUTR.Site.NexusMods.Server.Options; +using BUTR.Site.NexusMods.Server.Options; using Microsoft.Extensions.Options; diff --git a/src/BUTR.Site.NexusMods.Server/Services/HttpClients/INexusModsAPIClient.cs b/src/BUTR.Site.NexusMods.Server/Services/HttpClients/INexusModsAPIClient.cs index 972dcc8f..0192da6d 100644 --- a/src/BUTR.Site.NexusMods.Server/Services/HttpClients/INexusModsAPIClient.cs +++ b/src/BUTR.Site.NexusMods.Server/Services/HttpClients/INexusModsAPIClient.cs @@ -1,4 +1,4 @@ -using BUTR.Site.NexusMods.Server.Models; +using BUTR.Site.NexusMods.Server.Models; using BUTR.Site.NexusMods.Server.Models.NexusModsAPI; using BUTR.Site.NexusMods.Server.Utils; diff --git a/src/BUTR.Site.NexusMods.Server/Services/HttpClients/INexusModsClient.cs b/src/BUTR.Site.NexusMods.Server/Services/HttpClients/INexusModsClient.cs index de519174..aeda427a 100644 --- a/src/BUTR.Site.NexusMods.Server/Services/HttpClients/INexusModsClient.cs +++ b/src/BUTR.Site.NexusMods.Server/Services/HttpClients/INexusModsClient.cs @@ -1,4 +1,4 @@ -using BUTR.Site.NexusMods.Server.Models; +using BUTR.Site.NexusMods.Server.Models; using HtmlAgilityPack; diff --git a/src/BUTR.Site.NexusMods.Server/Services/HttpClients/ISteamAPIClient.cs b/src/BUTR.Site.NexusMods.Server/Services/HttpClients/ISteamAPIClient.cs index 3943ba4c..5b8c4c8c 100644 --- a/src/BUTR.Site.NexusMods.Server/Services/HttpClients/ISteamAPIClient.cs +++ b/src/BUTR.Site.NexusMods.Server/Services/HttpClients/ISteamAPIClient.cs @@ -1,4 +1,4 @@ -using BUTR.Site.NexusMods.Server.Options; +using BUTR.Site.NexusMods.Server.Options; using Microsoft.Extensions.Options; @@ -86,7 +86,7 @@ public SteamAPIClient(HttpClient httpClient, IOptions options) var data = JsonSerializer.Deserialize(await response.Content.ReadAsStreamAsync(ct)); if (data is null) return null; - + return new SteamUserInfo(data.Response.Players[0].Steamid, data.Response.Players[0].Personaname); } @@ -98,7 +98,7 @@ public async Task IsOwningGameAsync(string steamId, uint appId, Cancellati var data = JsonSerializer.Deserialize(await response.Content.ReadAsStreamAsync(ct)); if (data is null) return false; - + return data.Response.GameCount == 1; } } \ No newline at end of file diff --git a/src/BUTR.Site.NexusMods.Server/Services/HttpClients/ISteamCommunityClient.cs b/src/BUTR.Site.NexusMods.Server/Services/HttpClients/ISteamCommunityClient.cs index df3e53f8..70fa14aa 100644 --- a/src/BUTR.Site.NexusMods.Server/Services/HttpClients/ISteamCommunityClient.cs +++ b/src/BUTR.Site.NexusMods.Server/Services/HttpClients/ISteamCommunityClient.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Net.Http; using System.Threading; diff --git a/src/BUTR.Site.NexusMods.Server/Startup.cs b/src/BUTR.Site.NexusMods.Server/Startup.cs index 15da3a2b..e2897557 100644 --- a/src/BUTR.Site.NexusMods.Server/Startup.cs +++ b/src/BUTR.Site.NexusMods.Server/Startup.cs @@ -90,7 +90,7 @@ public Startup(IConfiguration configuration) } partial void ConfigureServicesPartial(IServiceCollection services); - + public void ConfigureServices(IServiceCollection services) { var userAgent = $"{_assemblyName.Name ?? "ERROR"} v{_assemblyName.Version?.ToString() ?? "ERROR"} (github.com/BUTR)"; @@ -172,7 +172,7 @@ public void ConfigureServices(IServiceCollection services) client.BaseAddress = new Uri("https://embed.gog.com/"); client.DefaultRequestHeaders.Add("User-Agent", userAgent); }).AddPolicyHandler(GetRetryPolicy()); - + services.AddQuartz(opt => { opt.AddJobListener(sp => sp.GetRequiredService()); @@ -217,7 +217,7 @@ public void ConfigureServices(IServiceCollection services) services.TryAddEnumerable(ServiceDescriptor.Scoped(typeof(IEntityConfiguration), type)); foreach (var type in types.Where(x => x.BaseType!.GetGenericTypeDefinition() == typeof(BaseEntityConfiguration<>))) services.TryAddEnumerable(ServiceDescriptor.Scoped(typeof(IEntityConfiguration), type)); - + services.AddDbContext(ServiceLifetime.Scoped); services.AddDbContextFactory(lifetime: ServiceLifetime.Scoped); services.AddDbContextFactory(lifetime: ServiceLifetime.Scoped); diff --git a/src/BUTR.Site.NexusMods.Server/Utils/Http/ApiResults/ApiResultUtils.cs b/src/BUTR.Site.NexusMods.Server/Utils/Http/ApiResults/ApiResultUtils.cs index d4ad6ce2..6e15c02d 100644 --- a/src/BUTR.Site.NexusMods.Server/Utils/Http/ApiResults/ApiResultUtils.cs +++ b/src/BUTR.Site.NexusMods.Server/Utils/Http/ApiResults/ApiResultUtils.cs @@ -9,7 +9,7 @@ public static class ApiResultUtils public static bool IsReturnTypeApiResult(MethodInfo? methodInfo) { if (methodInfo is null) return false; - + var returnType = GetReturnType(methodInfo); return returnType == typeof(ApiResult) || returnType.GetGenericTypeDefinition() == typeof(ApiResult<>);