Skip to content

Investigate whether the TODO in Get-VmsCameraReport referencing TFS 447559 can be resolved #164

@Tarterman

Description

@Tarterman

In Get-VmsCameraReport, there is a TODO comment for some code that says the code can be removed once TFS 447559 is resolved. That TFS bug report was resolved in October 2021, so we need to verify that the issue is resolved and that we can remove the extra code. Here is the whole code block:

# TODO: Remove this after TFS 447559 is addressed. The StreamFolder.Streams collection is empty after using FillChildren
# So this entire foreach block is only necessary to flush the children of StreamFolder and force another query for every
# camera so we can fill the collection up in this background task before enumerating over everything at the end.
foreach ($hw in $recorder.hardwarefolder.hardwares) {
    if ($getPasswords) {
        $password = $hw.ReadPasswordHardware().GetProperty('Password')
        $cache.Passwords[[guid]$hw.Id] = $password
    }
    foreach ($cam in $hw.camerafolder.cameras) {
        try {
            if ($null -ne $cam.StreamFolder -and $cam.StreamFolder.Streams.Count -eq 0) {
                $cam.StreamFolder.ClearChildrenCache()
                $null = $cam.StreamFolder.Streams
            }
        } catch {
            Write-Error $_
        }
    }
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions