fat32compat: no . at beginning or end of dirname
This commit is contained in:
parent
b7ae6bb5ad
commit
9ab92b60a2
@ -3,28 +3,29 @@ getDestDir() {
|
|||||||
destdir="${destinationpath[$destination]}/"
|
destdir="${destinationpath[$destination]}/"
|
||||||
if [ -n "${destinationrenamepath[$destination]}" ]
|
if [ -n "${destinationrenamepath[$destination]}" ]
|
||||||
then
|
then
|
||||||
destdir+="${destinationrenamepath[$destination]//%\{album\}/$album}"
|
replace=$(sanitizeFile "$album" dir)
|
||||||
replace=$(sanitizeFile "$albumartist")
|
destdir+="${destinationrenamepath[$destination]//%\{album\}/$replace}"
|
||||||
|
replace=$(sanitizeFile "$albumartist" dir)
|
||||||
destdir="${destdir//%\{albumartist\}/$replace}"
|
destdir="${destdir//%\{albumartist\}/$replace}"
|
||||||
replace=$(sanitizeFile "$artist")
|
replace=$(sanitizeFile "$artist" dir)
|
||||||
destdir="${destdir//%\{artist\}/$replace}"
|
destdir="${destdir//%\{artist\}/$replace}"
|
||||||
replace=$(sanitizeFile "$genre")
|
replace=$(sanitizeFile "$genre" dir)
|
||||||
destdir="${destdir//%\{genre\}/$replace}"
|
destdir="${destdir//%\{genre\}/$replace}"
|
||||||
replace=$(sanitizeFile "$title")
|
replace=$(sanitizeFile "$title" dir)
|
||||||
destdir="${destdir//%\{title\}/$replace}"
|
destdir="${destdir//%\{title\}/$replace}"
|
||||||
tracknumber="${track%/*}"
|
tracknumber="${track%/*}"
|
||||||
replace=$(sanitizeFile "$tracknumber")
|
replace=$(sanitizeFile "$tracknumber" dir)
|
||||||
destdir="${destdir//%\{track\}/$replace}"
|
destdir="${destdir//%\{track\}/$replace}"
|
||||||
replace=$(sanitizeFile "$year")
|
replace=$(sanitizeFile "$year" dir)
|
||||||
destdir="${destdir//%\{year\}/$replace}"
|
destdir="${destdir//%\{year\}/$replace}"
|
||||||
replace=$(sanitizeFile "$disc")
|
replace=$(sanitizeFile "$disc" dir)
|
||||||
destdir="${destdir//%\{disc\}/$replace}"
|
destdir="${destdir//%\{disc\}/$replace}"
|
||||||
else
|
else
|
||||||
destdir+=$(sanitizeFile "${filename%%/*}")
|
destdir+=$(sanitizeFile "${filename%%/*}" dir)
|
||||||
part=${filename#*/}
|
part=${filename#*/}
|
||||||
while [[ $part =~ / ]]
|
while [[ $part =~ / ]]
|
||||||
do
|
do
|
||||||
destdir+="/$(sanitizeFile "${part%%/*}")"
|
destdir+="/$(sanitizeFile "${part%%/*}" dir)"
|
||||||
part=${part#*/}
|
part=${part#*/}
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -19,6 +19,13 @@ sanitizeFile() {
|
|||||||
# Filenames can't begin or end with ' '
|
# Filenames can't begin or end with ' '
|
||||||
string=${string/#+( )/}
|
string=${string/#+( )/}
|
||||||
string=${string/%+( )/}
|
string=${string/%+( )/}
|
||||||
|
|
||||||
|
# Directory names can't begin or end with '.'
|
||||||
|
if [[ $2 == dir ]]
|
||||||
|
then
|
||||||
|
string=${string/#+(.)/}
|
||||||
|
string=${string/%+(.)/}
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
echo "$string"
|
echo "$string"
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user