Skip to content

Commit

Permalink
mitigate compatitblity issue with 0.11.x client version
Browse files Browse the repository at this point in the history
  • Loading branch information
SSchulze1989 committed Jul 14, 2024
1 parent 34fd397 commit 1a0ce7c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Microsoft.Extensions.Logging;
using System.Text.Json.Serialization;
using System.Text.Json;
using iRLeagueApiCore.Common.Converters;

namespace Microsoft.Extensions.DependencyInjection;
public static class IRLeagueApiClientServiceExtensions
Expand All @@ -15,6 +16,7 @@ public static IServiceCollection AddLeagueApiClient(this IServiceCollection serv

var jsonOptions = new JsonSerializerOptions(JsonSerializerDefaults.Web);
jsonOptions.Converters.Add(new JsonStringEnumConverter());
jsonOptions.Converters.Add(new JsonTimeSpanConverter());
jsonOptions.DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull;

services.TryAddScoped<HttpClientWrapperFactory>(sp => new(
Expand Down
2 changes: 1 addition & 1 deletion src/iRLeagueApiCore.Client/iRLeagueApiCore.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<OutputType>Library</OutputType>
<TargetFrameworks>net6.0</TargetFrameworks>
<PackageId>iRLeagueApiCore.Client</PackageId>
<Version>0.12.0</Version>
<Version>0.12.1-dev.1</Version>
<Authors>Simon Schulze</Authors>
<Company>Simon Schulze</Company>
<PackageDescription>This package contains shared objects for all members of the iRLeagueDatabase-iRLeagueApi stack</PackageDescription>
Expand Down
1 change: 1 addition & 0 deletions src/iRLeagueApiCore.Server/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public void ConfigureServices(IServiceCollection services)
.AddJsonOptions(options =>
{
options.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter());
options.JsonSerializerOptions.Converters.Add(new JsonTimeSpanConverter());
options.JsonSerializerOptions.DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull;
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ protected static TimeSpan GetAverageLapValue<T>(IEnumerable<T> rows, Func<T, Tim

protected static bool LapIsValid(TimeSpan lap)
{
return lap > TimeSpan.Zero;
return lap > TimeSpan.Zero.Add(TimeSpan.FromMilliseconds(1));
}

protected static bool HardChargerEligible(ResultRowCalculationResult row)
Expand Down

0 comments on commit 1a0ce7c

Please sign in to comment.