From 26e78547a81ff0f9de4955c769a247511186df80 Mon Sep 17 00:00:00 2001 From: ipax77 Date: Wed, 17 Jul 2024 07:30:55 +0200 Subject: [PATCH] fix maui builds --- .../Builds/BuildService.Players.cs | 54 ++++++++++++------- .../dsstats.maui8/Services/ReplaysService.cs | 5 ++ .../pax.dsstats.parser.csproj | 2 +- src/dsstats.ratings/Program.cs | 2 +- 4 files changed, 43 insertions(+), 20 deletions(-) diff --git a/src/dsstats.db8services/Builds/BuildService.Players.cs b/src/dsstats.db8services/Builds/BuildService.Players.cs index fc5b2710..23479591 100644 --- a/src/dsstats.db8services/Builds/BuildService.Players.cs +++ b/src/dsstats.db8services/Builds/BuildService.Players.cs @@ -14,24 +14,42 @@ public async Task ProducePlayerBuilds(BuildRequest request, Cance bool noEnd = end >= DateTime.Today.AddDays(-2); var ratingTypes = GetRatingTypes(request); - var query = from r in context.Replays - from rp in r.ReplayPlayers - from sp in rp.Spawns - from su in sp.Units - join rr in context.ReplayRatings on r.ReplayId equals rr.ReplayId - join rpr in context.ComboReplayPlayerRatings on rp.ReplayPlayerId equals rpr.ReplayPlayerId - where r.GameTime >= start - && (noEnd || r.GameTime < end) - && rp.Race == request.Interest - && (request.Versus == Commander.None || rp.OppRace == request.Versus) - && rr.LeaverType == LeaverType.None - && ratingTypes.Contains(rr.RatingType) - && sp.Breakpoint == request.Breakpoint - select new PlayerUnitGroup() - { - p = rp.Player, - su = su - }; + var query = IsSqlite ? + from r in context.Replays + from rp in r.ReplayPlayers + from sp in rp.Spawns + from su in sp.Units + join rr in context.ReplayRatings on r.ReplayId equals rr.ReplayId + where r.GameTime >= start + && (noEnd || r.GameTime < end) + && rp.Race == request.Interest + && (request.Versus == Commander.None || rp.OppRace == request.Versus) + && rr.LeaverType == LeaverType.None + && ratingTypes.Contains(rr.RatingType) + && sp.Breakpoint == request.Breakpoint + select new PlayerUnitGroup() + { + p = rp.Player, + su = su + } + : from r in context.Replays + from rp in r.ReplayPlayers + from sp in rp.Spawns + from su in sp.Units + join rr in context.ReplayRatings on r.ReplayId equals rr.ReplayId + join rpr in context.ComboReplayPlayerRatings on rp.ReplayPlayerId equals rpr.ReplayPlayerId + where r.GameTime >= start + && (noEnd || r.GameTime < end) + && rp.Race == request.Interest + && (request.Versus == Commander.None || rp.OppRace == request.Versus) + && rr.LeaverType == LeaverType.None + && ratingTypes.Contains(rr.RatingType) + && sp.Breakpoint == request.Breakpoint + select new PlayerUnitGroup() + { + p = rp.Player, + su = su + }; var predicate = PredicateBuilder.New(); diff --git a/src/dsstats.maui/dsstats.maui8/Services/ReplaysService.cs b/src/dsstats.maui/dsstats.maui8/Services/ReplaysService.cs index 4bbe2809..ab7f87c1 100644 --- a/src/dsstats.maui/dsstats.maui8/Services/ReplaysService.cs +++ b/src/dsstats.maui/dsstats.maui8/Services/ReplaysService.cs @@ -75,4 +75,9 @@ public async Task GetReplaysCount(ReplaysRequest request, CancellationToken { return await remoteReplaysService.GetArcadeReplay(hash, token); } + + public Task GetDssstatsArcadeReplay(string replayHash, CancellationToken token = default) + { + throw new NotImplementedException(); + } } diff --git a/src/dsstats.maui/pax.dsstats.parser/pax.dsstats.parser.csproj b/src/dsstats.maui/pax.dsstats.parser/pax.dsstats.parser.csproj index cd79426c..7b4f8fab 100644 --- a/src/dsstats.maui/pax.dsstats.parser/pax.dsstats.parser.csproj +++ b/src/dsstats.maui/pax.dsstats.parser/pax.dsstats.parser.csproj @@ -10,7 +10,7 @@ - + diff --git a/src/dsstats.ratings/Program.cs b/src/dsstats.ratings/Program.cs index 675c137a..fcab23e2 100644 --- a/src/dsstats.ratings/Program.cs +++ b/src/dsstats.ratings/Program.cs @@ -35,7 +35,7 @@ static void Main(string[] args) services.AddLogging(options => { options.SetMinimumLevel(LogLevel.Information); - options.AddFilter("Microsoft.EntityFrameworkCore", LogLevel.Information); + options.AddFilter("Microsoft.EntityFrameworkCore", LogLevel.Warning); options.AddConsole(); });