Skip to content

Commit 3e7b27e

Browse files
committed
fix(Device::Name): Fix the regex used to clean the name of device to not match custom naming.
Fixes #909
1 parent 2cc4911 commit 3e7b27e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

SoundSwitch.Common/Framework/Audio/Device/DeviceInfo.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ namespace SoundSwitch.Common.Framework.Audio.Device
77
{
88
public class DeviceInfo : IEquatable<DeviceInfo>
99
{
10-
private static readonly Regex NameSplitterRegex = new Regex(@"(?<friendlyName>[\w\s-_\.\/\\]+)\s\([\d\s\-|]*(?<deviceName>.+)\)", RegexOptions.Compiled);
10+
private static readonly Regex NameSplitterRegex = new(@"(?<friendlyName>.+)\s\([\d\s\-|]*(?<deviceName>.+)\)", RegexOptions.Compiled);
1111

12-
private static readonly Regex NameCleanerRegex = new Regex(@"^\d+\s?-\s?", RegexOptions.Compiled | RegexOptions.Singleline);
12+
private static readonly Regex NameCleanerRegex = new(@"\s?\(\d\)|^\d+\s?-\s?", RegexOptions.Compiled | RegexOptions.Singleline);
1313

1414
private string _nameClean;
1515

0 commit comments

Comments
 (0)