diff options
author | Joshua Drake <joshua.ellis.drake@gmail.com> | 2022-11-30 20:40:52 -0600 |
---|---|---|
committer | Joshua Drake <joshua.ellis.drake@gmail.com> | 2022-11-30 20:40:52 -0600 |
commit | b94338fa3bcfade26fc0872d1d584fa68166a36e (patch) | |
tree | 8eb07f7be33542326365dc0b3117e57da70e89a8 | |
parent | a406a9291527c9c155a0b3747c6b6a50d5ad7f0f (diff) |
Script now renames converted files using tags.
-rw-r--r-- | audioconversion.sh | 9 | ||||
-rw-r--r-- | readme.txt | 1 |
2 files changed, 7 insertions, 3 deletions
diff --git a/audioconversion.sh b/audioconversion.sh index daf3dd1..496869b 100644 --- a/audioconversion.sh +++ b/audioconversion.sh @@ -2,8 +2,11 @@ if [ -z "$1" ] || [ -z "$2" ] then echo "Enter an input directory followed by an output directory!" +exit else echo "Copying Directories..." +fi + find $1 -mindepth 1 -type d -print0| while read -d '' -r dir; do #echo $dir; @@ -30,12 +33,12 @@ done echo "Converting audio... Please be Patient!" find $1 -mindepth 2 -type d -print0| while read -d '' -r dir; do - #echo $(( $(find "$dir"/*.flac | wc -l) + $(find "$dir"/*.m4a | wc -l) + $(find "$dir"/*.wav | wc -l) )) - if [ $(( $(find "$dir"/*.flac | wc -l) + $(find "$dir"/*.m4a | wc -l) + $(find "$dir"/*.wav | wc -l) + $(find "$dir"/*.mp3 | wc -l) )) == $(find "$2${dir#$1}"/*mp3 | wc -l) ] && [ $(find "$2${dir#$1}"/*.mp3 | wc -l) > 0 ] + if [ $(( $(find "$dir"/*.flac | wc -l) + $(find "$dir"/*.m4a | wc -l) + $(find "$dir"/*.wav | wc -l) + $(find "$dir"/*.mp3 | wc -l) )) -le $(find "$2${dir#$1}"/*mp3 | wc -l) ] && [ $(find "$2${dir#$1}"/*.mp3 | wc -l) > 0 ] then echo "$2${dir#$1} already contains converted files!" else track2track -t mp3 -q extreme -j 20 -d "$2${dir#$1}" "$dir"/*.flac "$dir"/*.wav "$dir"/*.mp4 "$dir"/*.m4a "$dir"/*.wv "$dir"/*.ape fi + exiftool '-Filename<${TrackNumber;} - $Title.%e' "$2${dir#$1}"/*.mp3 #Included for files obtained from itunes... + exiftool '-Filename<${Track} - $Title.%e' "$2${dir#$1}"/*.mp3 done -fi
\ No newline at end of file @@ -2,5 +2,6 @@ This is a bash script for taking a directory and its contents and creating a dup ************ Dependencies: 1. track2track +2. exiftools ************ I've never written this kind of script before. Please contact me with advice or suggestions regarding syntax, functionality, etcetera.
\ No newline at end of file |