Add compact JSON formatting for single-element arrays in video info display

This commit is contained in:
2026-06-04 08:58:31 -04:00
parent a687bb5348
commit 201cc2625f
+6
View File
@@ -161,11 +161,17 @@ try {
$valueDisplay = ('{0} frames ({1}s, {2} fps)' -f $frames, $durationSeconds, $fps)
}
elseif ($fieldValue -is [array]) {
if ($fieldValue.Count -gt 1) {
# Pretty-print array values as JSON, prefixed with a newline so the
# multi-line output starts cleanly under the field label.
$jsonArray = $fieldValue | ConvertTo-Json -Depth 10
$valueDisplay = [Environment]::NewLine + $jsonArray
}
else {
$jsonArray = $fieldValue | ConvertTo-Json -Depth 10 -Compress
$valueDisplay = $jsonArray
}
}
else {
$valueDisplay = $fieldValue
# If the value looks like a WxH resolution string and ffprobe