Use the variable in all applicable locations.

This commit is contained in:
Hyperling 2025-04-03 11:51:27 -07:00
parent 8d40f45732
commit 778770c18b

View File

@ -74,7 +74,7 @@ mkdir -pv "$NEW_DIR" "$INT_DIR"
# TODO: Use the INTERIM folder folder, or remove references to it entirely. # TODO: Use the INTERIM folder folder, or remove references to it entirely.
echo "* Ensure all files are mp3." echo "* Ensure all files are mp3."
find "$OLD_DIR" -type f ! -name "*".mp3 | sort | while read file; do find "$OLD_DIR" -type f ! -name "*".$EXT | sort | while read file; do
echo "** Working on '$file'." echo "** Working on '$file'."
TEMP_DIR="`dirname "$file"`" TEMP_DIR="`dirname "$file"`"
@ -94,12 +94,12 @@ find "$OLD_DIR" -type f ! -name "*".mp3 | sort | while read file; do
# Actual conversion. # Actual conversion.
ffmpeg -y \ ffmpeg -y \
-nostdin -hide_banner -loglevel quiet \ -nostdin -hide_banner -loglevel quiet \
-i "$file" "${file//$OLD/$INT}".mp3 -i "$file" "${file//$OLD/$INT}".$EXT
status="$?" status="$?"
if [[ $status != 0 ]]; then if [[ $status != 0 ]]; then
echo "*** FAILED: Exited with status '$status'." echo "*** FAILED: Exited with status '$status'."
echo "**** To troubleshoot, try running this:" echo "**** To troubleshoot, try running this:"
echo "ffmpeg -y -i \"$file\" \"${file//$OLD/$INT}\".mp3" echo "ffmpeg -y -i \"$file\" \"${file//$OLD/$INT}\".$EXT"
else else
echo "*** Success!" echo "*** Success!"
fi fi
@ -266,7 +266,7 @@ function migrate_music {
} }
echo "* Moving INTERIM files to NEW." echo "* Moving INTERIM files to NEW."
find "$INT_DIR" -name "*".mp3 | sort | while read file; do find "$INT_DIR" -name "*".$EXT | sort | while read file; do
migrate_music "$file" mv migrate_music "$file" mv
done done
@ -274,6 +274,6 @@ echo "** Done with INTERIM, deleting."
rm -rfv "$INT_DIR" rm -rfv "$INT_DIR"
echo "* Copying OLD files to NEW." echo "* Copying OLD files to NEW."
find "$OLD_DIR" -name "*".mp3 | sort | while read file; do find "$OLD_DIR" -name "*".$EXT | sort | while read file; do
migrate_music "$file" cp migrate_music "$file" cp
done done