mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-12 16:21:28 +00:00
Fix number of returned slots being capped at 30
This commit is contained in:
parent
0c1e350fa3
commit
2ec6bff8e2
3 changed files with 25 additions and 4 deletions
|
@ -92,9 +92,6 @@ public static class ControllerExtensions
|
|||
}
|
||||
}
|
||||
|
||||
if (bool.TryParse(controller.Request.Query["move"], out bool movePack) && !movePack)
|
||||
queryBuilder.AddFilter(new ExcludeMovePackFilter());
|
||||
|
||||
if (bool.TryParse(controller.Request.Query["crosscontrol"], out bool crossControl) && crossControl)
|
||||
queryBuilder.AddFilter(new CrossControlFilter());
|
||||
|
||||
|
|
|
@ -179,6 +179,29 @@ public class ControllerExtensionTests
|
|||
Assert.NotEmpty(queryBuilder.GetFilters(typeof(FirstUploadedFilter)));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void FilterFromRequest_ShouldNotAddFirstUploadedFilter_WhenDateFilterInvalid()
|
||||
{
|
||||
GameTokenEntity token = MockHelper.GetUnitTestToken();
|
||||
token.GameVersion = GameVersion.LittleBigPlanet2;
|
||||
SlotsController controller = new(null!)
|
||||
{
|
||||
ControllerContext =
|
||||
{
|
||||
HttpContext = new DefaultHttpContext
|
||||
{
|
||||
Request =
|
||||
{
|
||||
QueryString = new QueryString("?dateFilterType=thisMillenium"),
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
SlotQueryBuilder queryBuilder = controller.FilterFromRequest(token);
|
||||
Assert.Empty(queryBuilder.GetFilters(typeof(FirstUploadedFilter)));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void FilterFromRequest_ShouldAddExcludeMoveFilter_WhenMoveEqualsFalse()
|
||||
{
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using LBPUnion.ProjectLighthouse.Configuration;
|
||||
|
||||
namespace LBPUnion.ProjectLighthouse.Types.Filter;
|
||||
|
||||
|
@ -10,7 +11,7 @@ public struct PaginationData
|
|||
public int PageStart { get; init; } = 0;
|
||||
public int PageSize { get; init; } = 0;
|
||||
public int TotalElements { get; set; } = 0;
|
||||
public int MaxElements { get; set; } = 30;
|
||||
public int MaxElements { get; set; } = ServerConfiguration.Instance.UserGeneratedContentLimits.EntitledSlots;
|
||||
|
||||
public int HintStart => this.PageStart + Math.Min(this.PageSize, this.MaxElements);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue