ix Get-Frame.ps1 parameter forwarding to use preference variable splatting instead of manual array building, preventing positional binding issues, update Get-FramesRange.ps1 to add -y flag for automatic overwrite of existing PNG files, fix Create-ShortClip.ps1 to skip clearing default Frames directory when -Render is used (frames are input not output) and add null checks before Test-Path in cleanup logic, and update documentation in Create-FullSubtitle.ps1 and Create-ShortClip.ps1 to clarify existing

This commit is contained in:
guru committed 2026-11-01 16:58:24 -05:00
1 parent 373efac4af
commit c79451b373
4 files changed
+12 -9

No files matched your search

+7 -3
View File
@@ -25,6 +25,10 @@
.DESCRIPTION
Creates a short clip video file from a 16:9 video file using the specified plan.
See Create-ShortClip.ini for details about the INI format and supported entries for the plan file.
Existing files: with the default -Images (the 'Frames' folder next to the video), files directly in that folder are
deleted before extraction (not with -Render, where they are the input). With an explicit -Images, existing frames matching that pattern are deleted before extraction,
and the Frames folder is not touched. An existing output video is overwritten. The temporary extraction directory is
always removed. The Frames folder is removed after the video is created unless -Keep is given.
Supports -WhatIf and -Confirm for safe execution.
#>
[CmdletBinding(SupportsShouldProcess)]
@@ -498,7 +502,7 @@ try {
if ($videoDir -eq '') { $videoDir = '.' }
$framesDir = Join-Path $videoDir 'Frames'
if (Test-Path $framesDir) {
if ($PSCmdlet.ShouldProcess($framesDir, 'Clear existing frames directory')) {
if (-not $Render -and $PSCmdlet.ShouldProcess($framesDir, 'Clear existing frames directory')) {
Get-ChildItem -Path $framesDir -File | Remove-Item -Force
}
}
@@ -719,11 +723,11 @@ try {
}
# Clean up frames directory after video is successfully created
if ((-not $Keep) -and (Test-Path $framesDir) -and ($PSCmdlet.ShouldProcess($framesDir, 'Remove frames directory'))) {
if ((-not $Keep) -and $framesDir -and (Test-Path $framesDir) -and ($PSCmdlet.ShouldProcess($framesDir, 'Remove frames directory'))) {
Remove-Item -Path $framesDir -Recurse -Force
Write-Host "Frames directory removed: $framesDir"
}
elseif ($Keep -and (Test-Path $framesDir)) {
elseif ($Keep -and $framesDir -and (Test-Path $framesDir)) {
Write-Host "Frames directory preserved: $framesDir"
}
}