fix(practice-opponents): guard duplicate ids + cover edge cases

This commit is contained in:
gamer147
2026-05-26 13:52:12 -04:00
parent 40b0de1d51
commit 0b41474968
2 changed files with 59 additions and 1 deletions

View File

@@ -43,7 +43,12 @@ public class PracticeOpponentImporter
entry.IsMaintenance = s.IsMaintenance;
entry.IsCampaignPractice = s.IsCampaignPractice;
if (ex is null) { context.PracticeOpponents.Add(entry); created++; }
if (ex is null)
{
context.PracticeOpponents.Add(entry);
existing[s.PracticeId] = entry;
created++;
}
else updated++;
}