Merge branch 'main' into recent-activity

# Conflicts:
#	.config/dotnet-tools.json
#	ProjectLighthouse.Servers.Website/Pages/Partials/ReviewPartial.cshtml
This commit is contained in:
Slendy 2024-04-01 14:45:59 -05:00
commit 8f91875f7c
No known key found for this signature in database
GPG key ID: 7288D68361B91428
54 changed files with 459 additions and 48 deletions

View file

@ -37,6 +37,9 @@ public class PhotosController : ControllerBase
{
GameTokenEntity token = this.GetToken();
// Deny request if in read-only mode
if (ServerConfiguration.Instance.UserGeneratedContentLimits.ReadOnlyMode) return this.BadRequest();
int photoCount = await this.database.Photos.CountAsync(p => p.CreatorId == token.UserId);
if (photoCount >= ServerConfiguration.Instance.UserGeneratedContentLimits.PhotosQuota) return this.BadRequest();
@ -90,7 +93,7 @@ public class PhotosController : ControllerBase
case SlotType.Developer:
{
SlotEntity? slot = await this.database.Slots.FirstOrDefaultAsync(s => s.Type == photoSlot.SlotType && s.InternalSlotId == photoSlot.SlotId);
if (slot != null)
if (slot != null)
photoSlot.SlotId = slot.SlotId;
else
photoSlot.SlotId = await SlotHelper.GetPlaceholderSlotId(this.database, photoSlot.SlotId, photoSlot.SlotType);