Compare commits
2 Commits
da4462b46a
...
94c387faba
Author | SHA1 | Date | |
---|---|---|---|
94c387faba | |||
b4c5fa64cc |
@ -67,12 +67,14 @@ mkdir -pv "$NEW" "$INT"
|
||||
## Convert Media ##
|
||||
|
||||
echo "* Ensure all files are mp3."
|
||||
find "$OLD" -type f ! -name "*".mp3 | while read file; do
|
||||
find "$OLD" -type f ! -name "*".mp3 | sort | while read file; do
|
||||
echo "** Working on '$file'."
|
||||
ffmpeg -nostdin -hide_banner -loglevel quiet -i "$file" "$file".converted.mp3
|
||||
ffmpeg -y -nostdin -hide_banner -loglevel quiet -i "$file" "$file".converted.mp3
|
||||
status="$?"
|
||||
if [[ $status != 0 ]]; then
|
||||
echo "*** FAILED: Exited with status '$status'."
|
||||
echo "**** To troubleshoot, try running this:"
|
||||
echo "ffmpeg -i '$file' '$file'.converted.mp3"
|
||||
else
|
||||
echo "*** Success!"
|
||||
fi
|
||||
@ -195,7 +197,7 @@ function migrate_music {
|
||||
# Prefer Artist, then Band, then Albumartist
|
||||
grandparent=""
|
||||
if [[ -n $album ]]; then
|
||||
grandparent="$album"
|
||||
grandparent="$artist"
|
||||
elif [[ -n $band ]]; then
|
||||
grandparent="$band"
|
||||
elif [[ -n $album_artist ]]; then
|
||||
@ -217,7 +219,7 @@ function migrate_music {
|
||||
}
|
||||
|
||||
echo "* Moving INTERIM files to NEW."
|
||||
find "$INT" -name "*".mp3 | while read file; do
|
||||
find "$INT" -name "*".mp3 | sort | while read file; do
|
||||
migrate_music "$file" mv
|
||||
done
|
||||
|
||||
@ -225,6 +227,6 @@ echo "** Done with INTERIM, deleting."
|
||||
rm -rfv "$INT"
|
||||
|
||||
echo "* Copying OLD files to NEW."
|
||||
find "$OLD" -name "*".mp3 | while read file; do
|
||||
find "$OLD" -name "*".mp3 | sort | while read file; do
|
||||
migrate_music "$file" cp
|
||||
done
|
||||
|
Loading…
x
Reference in New Issue
Block a user