add task input form and improve script runner output
- fetch task input definitions from API and render configurable inputs - boolean inputs render as No/Yes toggle (e.g. delete_source) - auto-filled inputs (file_path) are hidden from the form - wrap script output in dark pre/code block with copy button - fix ffmpeg -nostdin for batch directory processing Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -26,6 +26,10 @@ inputs:
|
||||
file_path:
|
||||
type: string
|
||||
description: Path to an audio file or directory to convert.
|
||||
delete_source:
|
||||
type: boolean
|
||||
description: Delete source files after successful conversion.
|
||||
default: false
|
||||
args: [file_path]
|
||||
---
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ set -euo pipefail
|
||||
# ── Task: Convert To MP3 ──
|
||||
|
||||
EXTENSIONS="flac|wav|ogg|wma|aac|m4a|opus|aiff|aif|ape|wv|alac|dsf|dff"
|
||||
DELETE_SOURCE="${INPUT_DELETE_SOURCE:-false}"
|
||||
|
||||
process_file() {
|
||||
local input="$1"
|
||||
@@ -25,8 +26,12 @@ process_file() {
|
||||
fi
|
||||
|
||||
echo "Converting: $input → $output"
|
||||
if ffmpeg -i "$input" -codec:a libmp3lame -b:a 320k -map_metadata 0 -id3v2_version 3 -y "$output" 2>/dev/null; then
|
||||
if ffmpeg -nostdin -i "$input" -codec:a libmp3lame -b:a 320k -map_metadata 0 -id3v2_version 3 -y "$output" 2>/dev/null; then
|
||||
echo " Done"
|
||||
if [[ "$DELETE_SOURCE" == "true" ]]; then
|
||||
rm "$input"
|
||||
echo " Deleted source"
|
||||
fi
|
||||
else
|
||||
echo " Failed" >&2
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user