From 3e1b6bc1c05ca997f5c7ba9078eb14ec99fd3d97 Mon Sep 17 00:00:00 2001 From: Vincent Riquer Date: Thu, 14 Mar 2013 14:10:29 +0100 Subject: [PATCH] implement renaming --- atom | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) 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"]