aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Fink2026-02-24 21:11:26 +0100
committerDennis Fink2026-02-24 21:11:26 +0100
commit48ff40a7ad013678e13b35088d5914778b21c9d7 (patch)
treea780daca0efec5838271e29b71cae4753661ee4f
parent7c302ecee9bdb7a53b2fc03d9d63693996566010 (diff)
downloadtranscode.sh-48ff40a7ad013678e13b35088d5914778b21c9d7.tar.gz
transcode.sh-48ff40a7ad013678e13b35088d5914778b21c9d7.zip
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.
-rwxr-xr-xtranscode.sh10
1 files 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