Implement LBP1 tags, stricter resource checking, and more (#463)

* Add LBP1 tags, more strict resource checking, and more.

* Fix unit tests

* Add more length checking to dependency parser

* Online editor problems

* Fix tests pt 2

* Self code review and fixed digest bugs

* Don't add content length if it was already set

* Fix status endpoint

* Fix review bug and simplify review serialization

* Fix a typo in review serialization

* Remove duplicated code and fix search

* Remove duplicate database call
This commit is contained in:
Josh 2022-08-31 20:38:58 -05:00 committed by GitHub
parent 58c340aff8
commit d640c000aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 735 additions and 209 deletions

View file

@ -1,4 +1,5 @@
#nullable enable
using LBPUnion.ProjectLighthouse.Extensions;
using LBPUnion.ProjectLighthouse.Levels;
using LBPUnion.ProjectLighthouse.PlayerData;
using LBPUnion.ProjectLighthouse.Serialization;
@ -20,7 +21,7 @@ public class SearchController : ControllerBase
[HttpGet("searchLBP3")]
public Task<IActionResult> SearchSlotsLBP3([FromQuery] int pageSize, [FromQuery] int pageStart, [FromQuery] string textFilter)
=> SearchSlots(textFilter, pageSize, pageStart, "results");
=> this.SearchSlots(textFilter, pageSize, pageStart, "results");
[HttpGet("search")]
public async Task<IActionResult> SearchSlots(
@ -41,8 +42,8 @@ public class SearchController : ControllerBase
string[] keywords = query.Split(" ");
IQueryable<Slot> dbQuery = this.database.Slots.Include(s => s.Creator)
.Include(s => s.Location)
IQueryable<Slot> dbQuery = this.database.Slots.ByGameVersion(gameToken.GameVersion, false, true)
.Where(s => s.Type == SlotType.User)
.OrderBy(s => !s.TeamPick)
.ThenByDescending(s => s.FirstUploaded)
.Where(s => s.SlotId >= 0); // dumb query to conv into IQueryable