Skip to content

Commit

Permalink
Fix case insensitive issue with cleaning up command groups
Browse files Browse the repository at this point in the history
  • Loading branch information
TyrenDe committed Oct 7, 2023
1 parent adb0092 commit 4283fa5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions MixItUp.Base/Model/Settings/SettingsV3Model.cs
Original file line number Diff line number Diff line change
Expand Up @@ -785,14 +785,14 @@ await ServiceManager.Get<IDatabaseService>().Read(this.DatabaseFilePath, "SELECT

// Clear out unused Cooldown Groups and Command Groups
var allUsedCooldownGroupNames = this.Commands.Values.ToList().Select(c => c.Requirements?.Cooldown?.GroupName).Distinct();
var allUnusedCooldownGroupNames = this.CooldownGroupAmounts.ToList().Where(c => !allUsedCooldownGroupNames.Contains(c.Key, StringComparer.InvariantCultureIgnoreCase));
var allUnusedCooldownGroupNames = this.CooldownGroupAmounts.ToList().Where(c => !allUsedCooldownGroupNames.Contains(c.Key, StringComparer.CurrentCulture));
foreach (var unused in allUnusedCooldownGroupNames)
{
this.CooldownGroupAmounts.Remove(unused.Key);
}

var allUsedCommandGroupNames = this.Commands.Values.ToList().Select(c => c.GroupName).Distinct();
var allUnusedCommandGroupNames = this.CommandGroups.ToList().Where(c => !allUsedCommandGroupNames.Contains(c.Key, StringComparer.InvariantCultureIgnoreCase));
var allUnusedCommandGroupNames = this.CommandGroups.ToList().Where(c => !allUsedCommandGroupNames.Contains(c.Key, StringComparer.CurrentCulture));
foreach (var unused in allUnusedCommandGroupNames)
{
this.CommandGroups.Remove(unused.Key);
Expand Down

0 comments on commit 4283fa5

Please sign in to comment.