Files
platform/seed/tasks/clean-playlist-files/run.sh
T
pastilhasandClaude Opus 4.6 53c78c76cb add tag-album and clean-playlist-files tasks, script step support, stop fix, rename fix
- 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>
2026-03-10 04:10:14 +00:00

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