From 24f311489ea64811a19d2c0e6e38343a71b62cea Mon Sep 17 00:00:00 2001 From: jvyden Date: Sun, 16 Jan 2022 13:54:43 -0500 Subject: [PATCH] Fix cool levels regression for LBP1 & LBPV Closes #118 --- .../Controllers/SlotsController.cs | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/ProjectLighthouse/Controllers/SlotsController.cs b/ProjectLighthouse/Controllers/SlotsController.cs index ba047e86..27f918db 100644 --- a/ProjectLighthouse/Controllers/SlotsController.cs +++ b/ProjectLighthouse/Controllers/SlotsController.cs @@ -95,9 +95,9 @@ namespace LBPUnion.ProjectLighthouse.Controllers ( [FromQuery] int pageStart, [FromQuery] int pageSize, - [FromQuery] string gameFilterType, - [FromQuery] int players, - [FromQuery] Boolean move, + [FromQuery] string? gameFilterType = null, + [FromQuery] int? players = null, + [FromQuery] bool? move = null, [FromQuery] int? page = null ) { @@ -218,9 +218,9 @@ namespace LBPUnion.ProjectLighthouse.Controllers ( [FromQuery] int pageStart, [FromQuery] int pageSize, - [FromQuery] string gameFilterType, - [FromQuery] int players, - [FromQuery] Boolean move, + [FromQuery] string? gameFilterType = null, + [FromQuery] int? players = null, + [FromQuery] bool? move = null, [FromQuery] string? dateFilterType = null ) { @@ -243,9 +243,9 @@ namespace LBPUnion.ProjectLighthouse.Controllers ( [FromQuery] int pageStart, [FromQuery] int pageSize, - [FromQuery] string gameFilterType, - [FromQuery] int players, - [FromQuery] Boolean move, + [FromQuery] string? gameFilterType = null, + [FromQuery] int? players = null, + [FromQuery] bool? move = null, [FromQuery] string? dateFilterType = null ) { @@ -282,9 +282,9 @@ namespace LBPUnion.ProjectLighthouse.Controllers ( [FromQuery] int pageStart, [FromQuery] int pageSize, - [FromQuery] string gameFilterType, - [FromQuery] int players, - [FromQuery] Boolean move, + [FromQuery] string? gameFilterType = null, + [FromQuery] int? players = null, + [FromQuery] bool? move = null, [FromQuery] string? dateFilterType = null ) { @@ -302,7 +302,7 @@ namespace LBPUnion.ProjectLighthouse.Controllers return this.Ok(LbpSerializer.TaggedStringElement("slots", response, "hint_start", pageStart + Math.Min(pageSize, 30))); } - public GameVersion GetGameFilter(string gameFilterType) + public GameVersion GetGameFilter(string? gameFilterType) { return gameFilterType switch { @@ -310,11 +310,12 @@ namespace LBPUnion.ProjectLighthouse.Controllers "lbp2" => GameVersion.LittleBigPlanet2, "lbp3" => GameVersion.LittleBigPlanet3, "both" => GameVersion.LittleBigPlanet2, // LBP2 default option + null => GameVersion.LittleBigPlanet1, _ => GameVersion.Unknown, }; } - public IQueryable FilterByRequest(string gameFilterType, string? dateFilterType) + public IQueryable FilterByRequest(string? gameFilterType, string? dateFilterType) { string _dateFilterType = dateFilterType ?? "";