mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-05-14 22:02:26 +00:00
Lots of bug fixes and performance improvements (#410)
* Many bug fixes and performance enhancements * Fix warnings and speed up photos with me * Finish refactoring user serialization * Finish refactoring user serialization Use GameTokens instead of User when possible Prevent negative page sizes * Fix debug compilation * Add gzip compression to example nginx config * Remove deflate changes * Add UsernameFromWebToken Co-authored-by: Jayden <jvyden@jvyden.xyz>
This commit is contained in:
parent
8dbd0e63ff
commit
d23a264b8a
43 changed files with 625 additions and 505 deletions
|
@ -185,10 +185,6 @@ public class PublishController : ControllerBase
|
|||
slot.PlaysLBP3Complete = oldSlot.PlaysLBP3Complete;
|
||||
slot.PlaysLBP3Unique = oldSlot.PlaysLBP3Unique;
|
||||
|
||||
slot.PlaysLBPVita = oldSlot.PlaysLBPVita;
|
||||
slot.PlaysLBPVitaComplete = oldSlot.PlaysLBPVitaComplete;
|
||||
slot.PlaysLBPVitaUnique = oldSlot.PlaysLBPVitaUnique;
|
||||
|
||||
#endregion
|
||||
|
||||
slot.FirstUploaded = oldSlot.FirstUploaded;
|
||||
|
@ -249,15 +245,15 @@ public class PublishController : ControllerBase
|
|||
[HttpPost("unpublish/{id:int}")]
|
||||
public async Task<IActionResult> Unpublish(int id)
|
||||
{
|
||||
User? user = await this.database.UserFromGameRequest(this.Request);
|
||||
if (user == null) return this.StatusCode(403, "");
|
||||
GameToken? token = await this.database.GameTokenFromRequest(this.Request);
|
||||
if (token == null) return this.StatusCode(403, "");
|
||||
|
||||
Slot? slot = await this.database.Slots.Include(s => s.Location).FirstOrDefaultAsync(s => s.SlotId == id);
|
||||
if (slot == null) return this.NotFound();
|
||||
|
||||
if (slot.Location == null) throw new ArgumentNullException();
|
||||
|
||||
if (slot.CreatorId != user.UserId) return this.StatusCode(403, "");
|
||||
if (slot.CreatorId != token.UserId) return this.StatusCode(403, "");
|
||||
|
||||
this.database.Locations.Remove(slot.Location);
|
||||
this.database.Slots.Remove(slot);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue