Compare commits
2 Commits
da4462b46a
...
94c387faba
Author | SHA1 | Date | |
---|---|---|---|
94c387faba | |||
b4c5fa64cc |
@ -67,12 +67,14 @@ mkdir -pv "$NEW" "$INT"
|
|||||||
## Convert Media ##
|
## Convert Media ##
|
||||||
|
|
||||||
echo "* Ensure all files are mp3."
|
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'."
|
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="$?"
|
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 "ffmpeg -i '$file' '$file'.converted.mp3"
|
||||||
else
|
else
|
||||||
echo "*** Success!"
|
echo "*** Success!"
|
||||||
fi
|
fi
|
||||||
@ -195,7 +197,7 @@ function migrate_music {
|
|||||||
# Prefer Artist, then Band, then Albumartist
|
# Prefer Artist, then Band, then Albumartist
|
||||||
grandparent=""
|
grandparent=""
|
||||||
if [[ -n $album ]]; then
|
if [[ -n $album ]]; then
|
||||||
grandparent="$album"
|
grandparent="$artist"
|
||||||
elif [[ -n $band ]]; then
|
elif [[ -n $band ]]; then
|
||||||
grandparent="$band"
|
grandparent="$band"
|
||||||
elif [[ -n $album_artist ]]; then
|
elif [[ -n $album_artist ]]; then
|
||||||
@ -217,7 +219,7 @@ function migrate_music {
|
|||||||
}
|
}
|
||||||
|
|
||||||
echo "* Moving INTERIM files to NEW."
|
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
|
migrate_music "$file" mv
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -225,6 +227,6 @@ echo "** Done with INTERIM, deleting."
|
|||||||
rm -rfv "$INT"
|
rm -rfv "$INT"
|
||||||
|
|
||||||
echo "* Copying OLD files to NEW."
|
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
|
migrate_music "$file" cp
|
||||||
done
|
done
|
||||||
|
Loading…
x
Reference in New Issue
Block a user