diff --git a/lib/files/getDestDir b/lib/files/getDestDir index 81b6839..787adaf 100644 --- a/lib/files/getDestDir +++ b/lib/files/getDestDir @@ -1,7 +1,34 @@ #!/bin/bash getDestDir() { destdir="${destinationpath[$destination]}/" - if [ -n "${destinationrenamepath[$destination]}" ] + if [ -n "${destinationrenamepath[$destination]}" ] \ + && ( + ( + ! [[ ${destinationrenamepath[$destination]} =~ %{album} ]] \ + || [ -n "$album" ] + ) && ( + ! [[ ${destinationrenamepath[$destination]} =~ %{albumartist} ]] \ + || [ -n "$albumartist" ] + ) && ( + ! [[ ${destinationrenamepath[$destination]} =~ %{artist} ]] \ + || [ -n "$artist" ] + ) && ( + ! [[ ${destinationrenamepath[$destination]} =~ %{genre} ]] \ + || [ -n "$genre" ] + ) && ( + ! [[ ${destinationrenamepath[$destination]} =~ %{title} ]] \ + || [ -n "$title" ] + ) && ( + ! [[ ${destinationrenamepath[$destination]} =~ %{track} ]] \ + || [ -n "$track" ] + ) && ( + ! [[ ${destinationrenamepath[$destination]} =~ %{year} ]] \ + || [ -n "$year" ] + ) && ( + ! [[ ${destinationrenamepath[$destination]} =~ %{disc} ]] \ + || [ -n "$disc" ] + ) + ) then replace=$(sanitizeFile "$album" dir) destdir+="${destinationrenamepath[$destination]//%\{album\}/$replace}" diff --git a/lib/files/getDestFile b/lib/files/getDestFile index 7730b48..e943b41 100644 --- a/lib/files/getDestFile +++ b/lib/files/getDestFile @@ -1,6 +1,33 @@ #!/bin/bash getDestFile() { - if [ -n "${destinationrename[$destination]}" ] + if [ -n "${destinationrename[$destination]}" ] \ + && ( + ( + ! [[ ${destinationrename[$destination]} =~ %{album} ]] \ + || [ -n "$album" ] + ) && ( + ! [[ ${destinationrename[$destination]} =~ %{albumartist} ]] \ + || [ -n "$albumartist" ] + ) && ( + ! [[ ${destinationrename[$destination]} =~ %{artist} ]] \ + || [ -n "$artist" ] + ) && ( + ! [[ ${destinationrename[$destination]} =~ %{genre} ]] \ + || [ -n "$genre" ] + ) && ( + ! [[ ${destinationrename[$destination]} =~ %{title} ]] \ + || [ -n "$title" ] + ) && ( + ! [[ ${destinationrename[$destination]} =~ %{track} ]] \ + || [ -n "$track" ] + ) && ( + ! [[ ${destinationrename[$destination]} =~ %{year} ]] \ + || [ -n "$year" ] + ) && ( + ! [[ ${destinationrename[$destination]} =~ %{disc} ]] \ + || [ -n "$disc" ] + ) + ) then destfile="${destinationrename[$destination]//%\{album\}/$album}" destfile="${destfile//%\{albumartist\}/$albumartist}"