mirror of
https://github.com/onyx-and-iris/voicemeeter-api-powershell.git
synced 2026-03-20 08:59:10 +00:00
clean up IODevice.driver
'none' -> '' early return if name is empty
This commit is contained in:
parent
8d267078ff
commit
6b2031de99
@ -120,6 +120,8 @@ class IODevice : IRemote {
|
||||
|
||||
hidden $_driver = $($this | Add-Member ScriptProperty 'driver' `
|
||||
{
|
||||
if ([string]::IsNullOrEmpty($this.name)) { return '' }
|
||||
|
||||
$path = $this.remote.workingconfig
|
||||
$oldTime = if (Test-Path $path) { (Get-Item $path).LastWriteTime } else { [DateTime]::MinValue }
|
||||
|
||||
@ -141,15 +143,12 @@ class IODevice : IRemote {
|
||||
}
|
||||
Start-Sleep -Milliseconds 20
|
||||
} while ($sw.elapsed -lt $timeout)
|
||||
|
||||
if (-not $line) { return 'unknown' }
|
||||
|
||||
$type = $null
|
||||
if ($line.ToString() -match "type='(?<type>\d+)'") {
|
||||
if ($line -and $line.ToString() -match "type='(?<type>\d+)'") {
|
||||
$type = $matches['type']
|
||||
}
|
||||
|
||||
if ($null -eq $type) { return 'none' }
|
||||
if ($type -notin $this.drivers.Keys) { return 'unknown' }
|
||||
return $this.drivers[$type]
|
||||
} `
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user