Compare commits
No commits in common. "da4462b46ad94254c9c650b5143ded1abd41db8b" and "0f83256e05a61d167b21b59361782f1948d843d0" have entirely different histories.
da4462b46a
...
0f83256e05
@ -66,18 +66,11 @@ mkdir -pv "$NEW" "$INT"
|
|||||||
|
|
||||||
## Convert Media ##
|
## Convert Media ##
|
||||||
|
|
||||||
echo "* Ensure all files are mp3."
|
echo "* Convert all files to mp3."
|
||||||
find "$OLD" -type f ! -name "*".mp3 | while read file; do
|
find "$OLD" ! -name "*".mp3 | while read file; do
|
||||||
echo "** Working on '$file'."
|
|
||||||
ffmpeg -nostdin -hide_banner -loglevel quiet -i "$file" "$file".converted.mp3
|
ffmpeg -nostdin -hide_banner -loglevel quiet -i "$file" "$file".converted.mp3
|
||||||
status="$?"
|
|
||||||
if [[ $status != 0 ]]; then
|
|
||||||
echo "*** FAILED: Exited with status '$status'."
|
|
||||||
else
|
|
||||||
echo "*** Success!"
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
echo "** Done converting any mp3s."
|
echo "** Done converting mp3s."
|
||||||
|
|
||||||
## Transform Media ##
|
## Transform Media ##
|
||||||
|
|
||||||
@ -85,7 +78,7 @@ function migrate_music {
|
|||||||
file="$1"
|
file="$1"
|
||||||
command="$2"
|
command="$2"
|
||||||
|
|
||||||
if [[ -z "$file" ]]; then
|
if [[ -z $file ]]; then
|
||||||
echo "ERROR: No filename retrieved, cannot migrate."
|
echo "ERROR: No filename retrieved, cannot migrate."
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
@ -150,7 +143,7 @@ function migrate_music {
|
|||||||
echo "*** Year=$year"
|
echo "*** Year=$year"
|
||||||
|
|
||||||
parent=""
|
parent=""
|
||||||
if [[ -n $year && -n $album ]]; then
|
if [[ -s $year && -s $album ]]; then
|
||||||
parent="$year - $album"
|
parent="$year - $album"
|
||||||
else
|
else
|
||||||
parent="$year$album"
|
parent="$year$album"
|
||||||
@ -194,11 +187,11 @@ function migrate_music {
|
|||||||
|
|
||||||
# Prefer Artist, then Band, then Albumartist
|
# Prefer Artist, then Band, then Albumartist
|
||||||
grandparent=""
|
grandparent=""
|
||||||
if [[ -n $album ]]; then
|
if [[ -s $album ]]; then
|
||||||
grandparent="$album"
|
grandparent="$album"
|
||||||
elif [[ -n $band ]]; then
|
elif [[ -s $band ]]; then
|
||||||
grandparent="$band"
|
grandparent="$band"
|
||||||
elif [[ -n $album_artist ]]; then
|
elif [[ -s $album_artist ]]; then
|
||||||
grandparent="$album_artist"
|
grandparent="$album_artist"
|
||||||
else
|
else
|
||||||
grandparent="Unknown"
|
grandparent="Unknown"
|
||||||
@ -206,9 +199,6 @@ function migrate_music {
|
|||||||
|
|
||||||
new_file="$grandparent/$new_file"
|
new_file="$grandparent/$new_file"
|
||||||
|
|
||||||
# Create the new directories if they do not already exist.
|
|
||||||
mkdir -pv "$NEW/$grandparent/$parent"
|
|
||||||
|
|
||||||
# Move the file.
|
# Move the file.
|
||||||
new_file="$NEW/$new_file"
|
new_file="$NEW/$new_file"
|
||||||
$command -v "$file" "$new_file"
|
$command -v "$file" "$new_file"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user