summaryrefslogtreecommitdiff
path: root/audioconversion.sh
diff options
context:
space:
mode:
authorJoshua Drake <joshua.drake@ditchwitch.com>2023-04-21 07:58:16 -0500
committerJoshua Drake <joshua.drake@ditchwitch.com>2023-04-21 07:58:16 -0500
commitb26b769691e8b130d6f1dab0bb943b44a9f5d82f (patch)
tree4b411484609fdc1644638f169104f050d3057364 /audioconversion.sh
parent9f9ddf0342e44c66815fffa4eef2e69d2f38f222 (diff)
Script now removes potentially invalid characters after conversion.
Diffstat (limited to 'audioconversion.sh')
-rw-r--r--audioconversion.sh19
1 files changed, 10 insertions, 9 deletions
diff --git a/audioconversion.sh b/audioconversion.sh
index 1b29f86..6f41fd6 100644
--- a/audioconversion.sh
+++ b/audioconversion.sh
@@ -13,14 +13,6 @@ d1=${dir#"$1"}
mkdir -v "$2$d1"
done
-#Remove potential charset conflicts
-find "$1" -type f -iname '*.flac' -o -iname '*.m4a' -o -iname '*.wav' -o -iname '*.mp4' -o -iname '*.mp3' | while read -r track;
-do
- song=$(basename "$track")
- path=$(dirname "$track")
- mv "$track" "$path/$(echo "$song" | sed -e 's/[^A-Za-z0-9._-]/\ /g')"
-done
-
#Link to all pictures, lyric files, etcetera.
echo "Creating Links for non-audio files..."
find "$1" -iname '*.png' -o -iname '*.jpg' -o -iname '*html' -o -iname '*.lrc' -o -iname '*.txt' -o -iname '*.cue' -o -iname '*.exe' -o -iname '*.mpg' -o -iname '*.bmp' -o -iname '*.ico' | while read -r file;
@@ -80,9 +72,18 @@ find "$1" -type f -iname '*.flac' -printf '%h\n' | sort -u | while read -r dir
echo "$2${dir#"$1"} Contains an equal number of mp3s..."
fi
done
-
+ echo "File Conversion Done! Starting renaming process..."
#Rename files in accordance with our template
find "$2" -mindepth 1 -iname '*.flac' -o -iname '*.m4a' -o -iname '*.wav' -o -iname '*.mp4' -o -iname '*.mp3' | while read -r track;
do
trackrename "--format=%(track_number)2.2d - %(track_name)s.%(suffix)s" "$track"
+done
+
+echo "Resolving character conflicts..."
+#Remove potential charset conflicts
+find "$2" -type f -iname '*.flac' -o -iname '*.m4a' -o -iname '*.wav' -o -iname '*.mp4' -o -iname '*.mp3' | while read -r track;
+do
+ song=$(basename "$track")
+ path=$(dirname "$track")
+ mv "$track" "$path/$(echo "$song" | sed -e 's/[^A-Za-z0-9._-]/\ /g')"
done \ No newline at end of file