From 3826e9bd2c38334abd51c782d929083f53ba3d71 Mon Sep 17 00:00:00 2001 From: Antoine Aflalo Date: Sat, 25 Jun 2022 21:09:59 -0400 Subject: [PATCH] boost(Configuration): Cleanup configuration of any duplicated device by name clean Only need to do this once, after that we do support that use case Fixes #943 --- .../Framework/Configuration/SoundSwitchConfiguration.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/SoundSwitch/Framework/Configuration/SoundSwitchConfiguration.cs b/SoundSwitch/Framework/Configuration/SoundSwitchConfiguration.cs index 5b92d29b9c..22ced56a75 100644 --- a/SoundSwitch/Framework/Configuration/SoundSwitchConfiguration.cs +++ b/SoundSwitch/Framework/Configuration/SoundSwitchConfiguration.cs @@ -209,6 +209,13 @@ public bool Migrate() migrated = true; } + if (!MigratedFields.Contains("CleanupSelectedDevices")) + { + SelectedDevices = SelectedDevices.DistinctBy(info => info.NameClean).ToHashSet(); + MigratedFields.Add("CleanupSelectedDevices"); + migrated = true; + } + return migrated; #pragma warning restore 612 }