From 48ff40a7ad013678e13b35088d5914778b21c9d7 Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Tue, 24 Feb 2026 21:11:26 +0100 Subject: fix(core): pass filename as separate argument to msg/error calls Aligns with the two-argument calling convention used elsewhere in the script, where the bold label and the highlighted value are passed as separate arguments. Also moves the preset name out of the error string in load_preset for the same reason. --- transcode.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/transcode.sh b/transcode.sh index 1067bc0..507384d 100755 --- a/transcode.sh +++ b/transcode.sh @@ -372,13 +372,13 @@ load_preset() { # This prevents path traversal, shell metacharacter injection, and symlink-based # attacks more reliably than a blocklist approach. if [[ -z "$preset" || ! "$preset" =~ ^[a-zA-Z0-9_-]+$ ]]; then - error "Invalid preset name: $preset (only alphanumerics, hyphens, underscores allowed)" + error "Invalid preset name (only alphanumerics, hyphens, underscores allowed):" "$preset" exit $EXIT_USAGE_ERROR fi local file="$PRESET_DIR/$preset.sh" [[ -f "$file" ]] || { - error "Preset not found: $file" + error "Preset not found:" "$file" exit $EXIT_CONFIG_ERROR } @@ -698,7 +698,7 @@ encode_one() { return $EXIT_OK fi - msg "Encoding: $file" + msg "Encoding:" "$file" debug "Nice value:" "$NICE_VALUE" if nice -n "$NICE_VALUE" "${cmd[@]}"; then @@ -727,9 +727,9 @@ encode_one() { fi mv -f -- "$tmp" "$file" - msg "Replaced: $file" + msg "Replaced:" "$file" else - error "Encode FAILED: $file" + error "Encode FAILED:" "$file" if [[ $CONTINUE_ON_FAIL -eq 1 ]]; then return $EXIT_RUNTIME_FAILURE # fail this but keep going else -- cgit v1.3.1