diff --git a/atom b/atom index 671f4f5..da7258c 100755 --- a/atom +++ b/atom @@ -1030,6 +1030,44 @@ copyFile() { progressSpin } +getDestDir() { + destdir="${destinationpath[$destination]}/" + if [ -n "${destinationrenamepath[$destination]}" ] + then + destdir+="${destinationrenamepath[$destination]//%\{album\}/$album}" + destdir="${destdir//%\{albumartist\}/$albumartist}" + destdir="${destdir//%\{artist\}/$artist}" + destdir="${destdir//%\{genre\}/$genre}" + destdir="${destdir//%\{title\}/$title}" + tracknumber="${track%/*}" + destdir="${destdir//%\{track\}/$tracknumber}" + destdir="${destdir//%\{year\}/$year}" + else + destdir+="${filename%/*}" + fi + if ! [ -d "$destdir" ] + then + mkdir -p "$destdir" + fi +} + +getDestFile() { + if [ -n "${destinationrename[$destination]}" ] + then + destfile="${destinationrename[$destination]//%\{album\}/$album}" + destfile="${destfile//%\{albumartist\}/$albumartist}" + destfile="${destfile//%\{artist\}/$artist}" + destfile="${destfile//%\{genre\}/$genre}" + destfile="${destfile//%\{title\}/$title}" + tracknumber="${track%/*}" + destfile="${destfile//%\{track\}/$tracknumber}" + destfile="${destfile//%\{year\}/$year}" + else + destfile="${filename##*/}" + destfile="${destfile%.*}" + fi +} + transcodeFile() { #sox -> wav for format in $targets["format"]