From 61894433d9e7a132d29e39ef6d3742d978bd1c43 Mon Sep 17 00:00:00 2001 From: Claude Toupin Date: Sun, 1 Nov 2026 09:24:14 -0500 Subject: [PATCH] Add -Suffix parameter to Create-Clip.ps1 for optional text appended to derived -Target name after "-Clip" and before file extension (e.g. -Suffix "-Shot-1" makes P01.mp4 become P01-Clip-Shot-1.mp4), with '.skip' marker preservation so suffix is inserted before marker (e.g. P01.skip.mp4 -> P01-Clip-Shot-1.skip.mp4), and update documentation to exclude -Suffix from forwarded parameters to Clone-Video.ps1 --- Create-Clip.ps1 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Create-Clip.ps1 b/Create-Clip.ps1 index 066545a..39ad3a6 100644 --- a/Create-Clip.ps1 +++ b/Create-Clip.ps1 @@ -3,7 +3,7 @@ Creates a new clipped video file using Clone-Video.ps1, requiring the -Video and -Frames parameters. The filename used for the -Target parameter is automatically derived from the -Video filename, with "-Clip" inserted before the video file extension (e.g., P01.mp4 becomes P01-Clip.mp4). When the video name carries a '.skip' marker before its extension, "-Clip" is inserted before that marker so it stays last (e.g., P01.skip.mp4 becomes P01-Clip.skip.mp4). - Any extra parameters will be pass directly to Clone-Video.ps1, except for parameters -Video, -Frames and -Target. + Any extra parameters will be pass directly to Clone-Video.ps1, except for parameters -Video, -Frames, -Suffix and -Target. .PARAMETER Video Path to the input video file. Can be absolute or relative to current directory. If the path has no extension, .mp4, .webm and .mkv are tried in turn. .PARAMETER Frames @@ -13,6 +13,9 @@ - -negative_number: Extract last N frames (e.g., "-10") - %: Represents the last frame index. Can be used alone or in ranges (e.g., "%", "10-%", "-%") - all: Extract all frames (same as "0-%") +.PARAMETER Suffix + Optional text appended to the derived -Target name after "-Clip" and before the file extension + (e.g. -Suffix "-Shot-1" makes P01.mp4 become P01-Clip-Shot-1.mp4). A '.skip' marker still stays last. #> [CmdletBinding(SupportsShouldProcess)] param( @@ -22,6 +25,9 @@ param( [Parameter(Mandatory = $true)] [string]$Frames, + [Parameter(Mandatory = $false)] + [string]$Suffix = '', + [Parameter(ValueFromRemainingArguments)] [object[]]$ExtraArgs ) @@ -58,7 +64,7 @@ if ($sourceBase -match '^(.*)(\.skip)$') { $skipMarker = $Matches[2] } -$targetName = "$sourceBase-Clip$skipMarker$sourceExt" +$targetName = "$sourceBase-Clip$Suffix$skipMarker$sourceExt" $targetPath = if ([string]::IsNullOrEmpty($sourceDir)) { $targetName } else { Join-Path $sourceDir $targetName } $scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path