- New tag-album task: renames tracks to NNN format, sets ID3 tags via mutagen - New clean-playlist-files task: deletes .cue, .m3u, .nfo and similar junk files - Pipeline executor now supports script-mode steps (runs directly, no agent) - Build discography pipeline: convert-audio → clean-playlist-files → prepare → fetch → tag - Fix stop button: abort signal now kills running agent processes - Fix job manager: broadcast stopped/error events to WebSocket viewers - Fix file browser rename: delay focus to avoid context menu close race, left-align input Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
32 lines
674 B
Bash
32 lines
674 B
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
EXTENSIONS="cue|m3u|m3u8|pls|wpl|xspf|nfo|txt|log|accurip|sfv|md5"
|
|
|
|
TARGET="${1:-${INPUT_FILE_PATH:-}}"
|
|
|
|
if [[ -z "$TARGET" ]]; then
|
|
echo "Error: No directory path provided" >&2
|
|
exit 1
|
|
fi
|
|
|
|
if [[ ! -d "$TARGET" ]]; then
|
|
echo "Error: Not a directory: $TARGET" >&2
|
|
exit 1
|
|
fi
|
|
|
|
deleted=0
|
|
|
|
while IFS= read -r -d '' file; do
|
|
echo "Deleting: $file"
|
|
rm "$file"
|
|
deleted=$((deleted + 1))
|
|
done < <(find "$TARGET" -type f -regextype posix-extended -iregex ".*\.($EXTENSIONS)" -print0 | sort -z)
|
|
|
|
if [[ $deleted -eq 0 ]]; then
|
|
echo "No playlist/cue files found in: $TARGET"
|
|
else
|
|
echo ""
|
|
echo "Summary: $deleted files deleted"
|
|
fi
|