Deconstructed dict KvP to improve readabiltiy + string to mongoId conversions

This commit is contained in:
Chomp
2025-07-20 11:57:15 +01:00
parent 776c5454ad
commit 59d33d2621
9 changed files with 28 additions and 25 deletions
@@ -50,9 +50,9 @@ public class InsuranceController(
public void ProcessReturn()
{
// Process each installed profile.
foreach (var sessionId in saveServer.GetProfiles())
foreach (var (sessionId, _) in saveServer.GetProfiles())
{
ProcessReturnByProfile(sessionId.Key);
ProcessReturnByProfile(sessionId);
}
}
@@ -444,17 +444,17 @@ public class InsuranceController(
HashSet<MongoId> toDelete
)
{
foreach (var parentObj in mainParentToAttachmentsMap)
foreach (var (key, attachments) in mainParentToAttachmentsMap)
{
// Skip processing if parentId is already marked for deletion, as all attachments for that parent will
// already be marked for deletion as well.
if (toDelete.Contains(parentObj.Key))
if (toDelete.Contains(key))
{
continue;
}
// Log the parent item's name.
itemsMap.TryGetValue(parentObj.Key, out var parentItem);
itemsMap.TryGetValue(key, out var parentItem);
var parentName = itemHelper.GetItemName(parentItem.Template);
if (logger.IsLogEnabled(LogLevel.Debug))
{
@@ -462,7 +462,7 @@ public class InsuranceController(
}
// Process the attachments for this individual parent item.
ProcessAttachmentByParent(parentObj.Value, insuredTraderId.Value, toDelete);
ProcessAttachmentByParent(attachments, insuredTraderId.Value, toDelete);
}
}