Fix file renaming

This commit is contained in:
Vincent Riquer 2013-05-03 17:25:07 +02:00
parent 7c8617d713
commit 8b3f121179
3 changed files with 19 additions and 16 deletions

View File

@ -6,6 +6,7 @@ copyFiles_action() {
source_files.filename, source_files.filename,
source_files.last_change, source_files.last_change,
destinations.id, destinations.id,
destinations.name,
destination_files.id destination_files.id
FROM source_files FROM source_files
INNER JOIN destination_files INNER JOIN destination_files
@ -38,6 +39,8 @@ copyFiles_action() {
rest=${rest#*::AtOM:SQL:Sep::} rest=${rest#*::AtOM:SQL:Sep::}
destinationid=${rest%%::AtOM:SQL:Sep::*} destinationid=${rest%%::AtOM:SQL:Sep::*}
rest=${rest#*::AtOM:SQL:Sep::} rest=${rest#*::AtOM:SQL:Sep::}
destination=${rest%%::AtOM:SQL:Sep::*}
rest=${rest#*::AtOM:SQL:Sep::}
destfileid=${rest%%::AtOM:SQL:Sep::*} destfileid=${rest%%::AtOM:SQL:Sep::*}
rest=${rest#*::AtOM:SQL:Sep::} rest=${rest#*::AtOM:SQL:Sep::}
echo 'SELECT IFNULL( ( echo 'SELECT IFNULL( (

View File

@ -4,28 +4,28 @@ getDestDir() {
if [ -n "${destinationrenamepath[$destination]}" ] \ if [ -n "${destinationrenamepath[$destination]}" ] \
&& ( && (
( (
! [[ ${destinationrenamepath[$destination]} =~ %{album} ]] \ ! [[ ${destinationrenamepath[$destination]} =~ %\{album\} ]] \
|| [ -n "$album" ] || [ -n "$album" ]
) && ( ) && (
! [[ ${destinationrenamepath[$destination]} =~ %{albumartist} ]] \ ! [[ ${destinationrenamepath[$destination]} =~ %\{albumartist\} ]] \
|| [ -n "$albumartist" ] || [ -n "$albumartist" ]
) && ( ) && (
! [[ ${destinationrenamepath[$destination]} =~ %{artist} ]] \ ! [[ ${destinationrenamepath[$destination]} =~ %\{artist\} ]] \
|| [ -n "$artist" ] || [ -n "$artist" ]
) && ( ) && (
! [[ ${destinationrenamepath[$destination]} =~ %{genre} ]] \ ! [[ ${destinationrenamepath[$destination]} =~ %\{genre\} ]] \
|| [ -n "$genre" ] || [ -n "$genre" ]
) && ( ) && (
! [[ ${destinationrenamepath[$destination]} =~ %{title} ]] \ ! [[ ${destinationrenamepath[$destination]} =~ %\{title\} ]] \
|| [ -n "$title" ] || [ -n "$title" ]
) && ( ) && (
! [[ ${destinationrenamepath[$destination]} =~ %{track} ]] \ ! [[ ${destinationrenamepath[$destination]} =~ %\{track\} ]] \
|| [ -n "$track" ] || [ -n "$track" ]
) && ( ) && (
! [[ ${destinationrenamepath[$destination]} =~ %{year} ]] \ ! [[ ${destinationrenamepath[$destination]} =~ %\{year\} ]] \
|| [ -n "$year" ] || [ -n "$year" ]
) && ( ) && (
! [[ ${destinationrenamepath[$destination]} =~ %{disc} ]] \ ! [[ ${destinationrenamepath[$destination]} =~ %\{disc\} ]] \
|| [ -n "$disc" ] || [ -n "$disc" ]
) )
) )

View File

@ -3,28 +3,28 @@ getDestFile() {
if [ -n "${destinationrename[$destination]}" ] \ if [ -n "${destinationrename[$destination]}" ] \
&& ( && (
( (
! [[ ${destinationrename[$destination]} =~ %{album} ]] \ ! [[ ${destinationrename[$destination]} =~ %\{album\} ]] \
|| [ -n "$album" ] || [ -n "$album" ]
) && ( ) && (
! [[ ${destinationrename[$destination]} =~ %{albumartist} ]] \ ! [[ ${destinationrename[$destination]} =~ %\{albumartist\} ]] \
|| [ -n "$albumartist" ] || [ -n "$albumartist" ]
) && ( ) && (
! [[ ${destinationrename[$destination]} =~ %{artist} ]] \ ! [[ ${destinationrename[$destination]} =~ %\{artist\} ]] \
|| [ -n "$artist" ] || [ -n "$artist" ]
) && ( ) && (
! [[ ${destinationrename[$destination]} =~ %{genre} ]] \ ! [[ ${destinationrename[$destination]} =~ %\{genre\} ]] \
|| [ -n "$genre" ] || [ -n "$genre" ]
) && ( ) && (
! [[ ${destinationrename[$destination]} =~ %{title} ]] \ ! [[ ${destinationrename[$destination]} =~ %\{title\} ]] \
|| [ -n "$title" ] || [ -n "$title" ]
) && ( ) && (
! [[ ${destinationrename[$destination]} =~ %{track} ]] \ ! [[ ${destinationrename[$destination]} =~ %\{track\} ]] \
|| [ -n "$track" ] || [ -n "$track" ]
) && ( ) && (
! [[ ${destinationrename[$destination]} =~ %{year} ]] \ ! [[ ${destinationrename[$destination]} =~ %\{year\} ]] \
|| [ -n "$year" ] || [ -n "$year" ]
) && ( ) && (
! [[ ${destinationrename[$destination]} =~ %{disc} ]] \ ! [[ ${destinationrename[$destination]} =~ %\{disc\} ]] \
|| [ -n "$disc" ] || [ -n "$disc" ]
) )
) )