Track cleanup progress and polish profile/system flows

This commit is contained in:
cesnimda
2026-03-23 19:49:41 +01:00
parent fcafda6f52
commit 90fdd8e1a5
14 changed files with 156 additions and 49 deletions
@@ -20,7 +20,7 @@ public sealed class ProfileCvController : ControllerBase
".docx",
};
private const long MaxFileSizeBytes = 512 * 1024;
private const long MaxFileSizeBytes = 5 * 1024 * 1024;
private readonly UserManager<ApplicationUser> _users;
@@ -36,7 +36,7 @@ public sealed class ProfileCvController : ControllerBase
var user = await _users.GetUserAsync(User);
if (user is null) return Unauthorized();
if (file is null || file.Length == 0) return BadRequest("Select a CV file to upload.");
if (file.Length > MaxFileSizeBytes) return BadRequest("CV import file is too large.");
if (file.Length > MaxFileSizeBytes) return BadRequest("CV import file is too large. Keep it under 5 MB.");
var extension = Path.GetExtension(file.FileName ?? string.Empty);
if (!AllowedExtensions.Contains(extension))
@@ -78,7 +78,10 @@ public sealed class ProfileCvController : ControllerBase
var raw = Encoding.UTF8.GetString(bytes);
var textMatches = Regex.Matches(raw, @"\((.*?)\)Tj", RegexOptions.Singleline)
.Select(match => match.Groups[1].Value)
.Concat(Regex.Matches(raw, @"\[(.*?)\]TJ", RegexOptions.Singleline)
.SelectMany(match => Regex.Matches(match.Groups[1].Value, @"\((.*?)\)", RegexOptions.Singleline).Select(x => x.Groups[1].Value)))
.Where(value => !string.IsNullOrWhiteSpace(value))
.Select(value => Regex.Unescape(value))
.ToList();
var joined = textMatches.Count > 0 ? string.Join(" ", textMatches) : raw;