Also remove double whitespace.

This commit is contained in:
Hyperling 2024-06-07 19:18:30 -07:00
parent 0a55a188bf
commit 5fe5e8106c

View File

@ -95,7 +95,7 @@ avg_time=0
total_time=0 total_time=0
time_count=0 time_count=0
est_guess=0 est_guess=0
time find $DIR -name "*${EXT}" | while read file; do time find $DIR -name "*${EXT}" | sort | while read file; do
count=$(( count + 1 )) count=$(( count + 1 ))
echo -e "\n$file" echo -e "\n$file"
@ -122,6 +122,9 @@ time find $DIR -name "*${EXT}" | while read file; do
title="${title// : /}" title="${title// : /}"
title="${title//[^[:alnum:][:space:].]/}" title="${title//[^[:alnum:][:space:].]/}"
title="`echo $title`" title="`echo $title`"
while [[ "$title" == *" "* ]]; do
title="${title// / }"
done
echo "Title=$title" echo "Title=$title"
# Create the new file with the correct filename. # Create the new file with the correct filename.
@ -138,7 +141,8 @@ time find $DIR -name "*${EXT}" | while read file; do
echo "No Track# found, leaving Title alone." echo "No Track# found, leaving Title alone."
continue continue
else else
error "File does not have Track or Title metadata. Are you sure you're running this on music?" 3 echo "File does not have Track or Title metadata."
continue
fi fi
# Confirm the new file exists and remove the old file if so # Confirm the new file exists and remove the old file if so