Add PhotosQuota

This commit is contained in:
jvyden 2021-12-11 12:10:40 -05:00
commit 52b4cc8ada
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
2 changed files with 6 additions and 1 deletions

View file

@ -9,6 +9,7 @@ using Kettu;
using LBPUnion.ProjectLighthouse.Logging;
using LBPUnion.ProjectLighthouse.Serialization;
using LBPUnion.ProjectLighthouse.Types;
using LBPUnion.ProjectLighthouse.Types.Settings;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
@ -32,6 +33,8 @@ namespace LBPUnion.ProjectLighthouse.Controllers
User? user = await this.database.UserFromGameRequest(this.Request);
if (user == null) return this.StatusCode(403, "");
if (user.PhotosByMe >= ServerSettings.Instance.PhotosQuota) return this.BadRequest();
this.Request.Body.Position = 0;
string bodyString = await new StreamReader(this.Request.Body).ReadToEndAsync();

View file

@ -63,7 +63,7 @@ namespace LBPUnion.ProjectLighthouse.Types.Settings
}
}
public const int CurrentConfigVersion = 11; // MUST BE INCREMENTED FOR EVERY CONFIG CHANGE!
public const int CurrentConfigVersion = 12; // MUST BE INCREMENTED FOR EVERY CONFIG CHANGE!
#region Meta
@ -103,6 +103,8 @@ namespace LBPUnion.ProjectLighthouse.Types.Settings
public int ListsQuota { get; set; } = 50;
public int PhotosQuota { get; set; } = 500;
public bool GoogleAnalyticsEnabled { get; set; } = false;
public string GoogleAnalyticsId { get; set; } = "";