summaryrefslogtreecommitdiff
path: root/audioconversion.sh
diff options
context:
space:
mode:
Diffstat (limited to 'audioconversion.sh')
-rw-r--r--audioconversion.sh16
1 files changed, 8 insertions, 8 deletions
diff --git a/audioconversion.sh b/audioconversion.sh
index 6f41fd6..b70f1d0 100644
--- a/audioconversion.sh
+++ b/audioconversion.sh
@@ -10,20 +10,20 @@ fi
find "$1" -mindepth 1 -type d -print0| while read -d '' -r dir;
do
d1=${dir#"$1"}
-mkdir -v "$2$d1"
+mkdir -v "$2$d1" 2> /dev/null
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;
do
-ln -P "$file" "$2${file#"$1"}"
+ln -P "$file" "$2${file#"$1"}" 2> /dev/null
done
echo "Copying pre-existing mp3s and unlinkable files..."
find "$1" -iname '*.mp3' -o -iname '*.log' -o -iname '*.m3u' -o -iname '*.m3u8' -o -iname '*.accurip' -o -iname '*pdf' -o -iname '*.rtf'| while read -r file;
do
-cp "$file" "$2${file#"$1"}"
+cp "$file" "$2${file#"$1"}" 2> /dev/null
done
find "$1" -iname 'desktop.ini' -o -iname 'Thumbs.db' -o -iname '*nfo'| while read -r file;
@@ -34,7 +34,7 @@ done
echo "Converting audio... Please be Patient!"
find "$1" -type f -iname '*.flac' -printf '%h\n' | sort -u | while read -r dir
do
- if [ $(( $(find "$dir"/*.flac | wc -l) )) -gt $(( $(find "$2${dir#"$1"}"/*.mp3 | wc -l) )) ]
+ if [ $(( $(find "$dir"/*.flac | wc -l) )) -gt $(( $(find "$2${dir#"$1"}"/*.mp3 2> /dev/null | wc -l) )) ]
then
track2track -t mp3 -q extreme -j 20 -d "$2${dir#"$1"}" "$dir"/*.flac
#ffmpeg -i "$track" -vn -n -loglevel panic -threads 20 -map 0:a "${path%.*}".mp3
@@ -45,7 +45,7 @@ find "$1" -type f -iname '*.flac' -printf '%h\n' | sort -u | while read -r dir
find "$1" -type f -iname '*.m4a' -printf '%h\n' | sort -u | while read -r dir
do
- if [ $(( $(find "$dir"/*.m4a | wc -l) )) -gt $(( $(find "$2${dir#"$1"}"/*.mp3 | wc -l) )) ]
+ if [ $(( $(find "$dir"/*.m4a | wc -l) )) -gt $(( $(find "$2${dir#"$1"}"/*.mp3 2> /dev/null | wc -l) )) ]
then
track2track -t mp3 -q extreme -j 20 -d "$2${dir#"$1"}" "$dir"/*.m4a
else
@@ -55,7 +55,7 @@ find "$1" -type f -iname '*.flac' -printf '%h\n' | sort -u | while read -r dir
find "$1" -type f -iname '*.mp4' -printf '%h\n' | sort -u | while read -r dir
do
- if [ $(( $(find "$dir"/*.mp4 | wc -l) )) -gt $(( $(find "$2${dir#"$1"}"/*.mp3 | wc -l) )) ]
+ if [ $(( $(find "$dir"/*.mp4 | wc -l) )) -gt $(( $(find "$2${dir#"$1"}"/*.mp3 2> /dev/null | wc -l) )) ]
then
track2track -t mp3 -q extreme -j 20 -d "$2${dir#"$1"}" "$dir"/*.mp4
else
@@ -65,7 +65,7 @@ find "$1" -type f -iname '*.flac' -printf '%h\n' | sort -u | while read -r dir
find "$1" -type f -iname '*.wav' -printf '%h\n' | sort -u | while read -r dir
do
- if [ $(( $(find "$dir"/*.wav | wc -l) )) -gt $(( $(find "$2${dir#"$1"}"/*.mp3 | wc -l) )) ]
+ if [ $(( $(find "$dir"/*.wav | wc -l) )) -gt $(( $(find "$2${dir#"$1"}"/*.mp3 2> /dev/null | wc -l) )) ]
then
track2track -t mp3 -q extreme -j 20 -d "$2${dir#"$1"}" "$dir"/*.wav
else
@@ -86,4 +86,4 @@ 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
+done