Improved ExtensionData checks, moved closer to source

This commit is contained in:
Chomp
2025-06-05 08:28:13 +01:00
parent df16088a73
commit ecad23cd31
5 changed files with 20 additions and 13 deletions
@@ -275,11 +275,6 @@ public class HealthController(
foreach (var bodyPartKvP in healthTreatmentRequest.Difference.BodyParts.GetAllPropsAsDict())
{
if (string.Equals(bodyPartKvP.Key, "extensiondata", StringComparison.InvariantCultureIgnoreCase))
{
continue;
}
// Get body part from request + from pmc profile
var partRequest = (BodyPartEffects) bodyPartKvP.Value;
var profilePart = pmcData.Health.BodyParts[bodyPartKvP.Key];
@@ -62,7 +62,9 @@ public class LauncherController(
{
var result = new Dictionary<string, string>();
var dbProfiles = _databaseService.GetProfiles();
foreach (var templatesProperty in typeof(ProfileTemplates).GetProperties().Where(p => p.CanWrite && p.Name != "ExtensionData"))
foreach (var templatesProperty in typeof(ProfileTemplates).GetProperties()
.Where(p => p.CanWrite
&& !string.Equals(p.Name, "extensiondata", StringComparison.InvariantCultureIgnoreCase)))
{
var propertyValue = templatesProperty.GetValue(dbProfiles);
if (propertyValue == null)
@@ -48,7 +48,9 @@ public class LauncherV2Controller(
var result = new Dictionary<string, string>();
var dbProfiles = _databaseService.GetProfiles();
foreach (var templatesProperty in typeof(ProfileTemplates).GetProperties().Where(p => p.CanWrite && p.Name != "ExtensionData"))
foreach (var templatesProperty in typeof(ProfileTemplates).GetProperties()
.Where(p => p.CanWrite
&& !string.Equals(p.Name, "extensiondata", StringComparison.InvariantCultureIgnoreCase)))
{
var propertyValue = templatesProperty.GetValue(dbProfiles);
if (propertyValue == null)