Handling special char names
This commit is contained in:
parent
ad6bc38c02
commit
a0d0d30989
@ -167,7 +167,8 @@ CreateFileList() {
|
|||||||
# ${2} /mnt/mtp/Example-Artist/Example-Album
|
# ${2} /mnt/mtp/Example-Artist/Example-Album
|
||||||
# ${3} Example-Artist/Example-Album
|
# ${3} Example-Artist/Example-Album
|
||||||
IFS=""
|
IFS=""
|
||||||
sourcepath="${1}/*"
|
sourcepath="${1/\[/\\\[}/*"
|
||||||
|
sourcepath="${sourcepath/\]/\\\]}"
|
||||||
for file in $sourcepath; do
|
for file in $sourcepath; do
|
||||||
relfile="${file#"$1/"}"
|
relfile="${file#"$1/"}"
|
||||||
if [[ -d "${1}/$relfile" ]]; then
|
if [[ -d "${1}/$relfile" ]]; then
|
||||||
@ -187,6 +188,7 @@ ConvertFiles() {
|
|||||||
percentage=0
|
percentage=0
|
||||||
while read -r line
|
while read -r line
|
||||||
do
|
do
|
||||||
|
|
||||||
if [[ ! -f "${source}/$line" ]]; then
|
if [[ ! -f "${source}/$line" ]]; then
|
||||||
VerboseOutput 5 "Source-file ${source}/$line Unreachable"
|
VerboseOutput 5 "Source-file ${source}/$line Unreachable"
|
||||||
ExecTime
|
ExecTime
|
||||||
@ -218,13 +220,13 @@ CopyFiles() {
|
|||||||
percentage=0
|
percentage=0
|
||||||
while read -r line
|
while read -r line
|
||||||
do
|
do
|
||||||
if [[ ! -f "$dest" ]]; then
|
if [[ ! -d "$dest" ]]; then
|
||||||
VerboseOutput 5 "Destination unreachable"
|
VerboseOutput 5 "Destination unreachable"
|
||||||
ExecTime
|
ExecTime
|
||||||
exit 4
|
exit 4
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! -f "$line" ]]; then
|
if [[ ! -f "${temp}/$line" ]]; then
|
||||||
VerboseOutput 5 "Source-file ${temp}/$line Unreachable"
|
VerboseOutput 5 "Source-file ${temp}/$line Unreachable"
|
||||||
ExecTime
|
ExecTime
|
||||||
exit 3
|
exit 3
|
||||||
@ -234,6 +236,7 @@ CopyFiles() {
|
|||||||
total=$(cat /tmp/music-sync-filelist | wc -l)
|
total=$(cat /tmp/music-sync-filelist | wc -l)
|
||||||
percentage=$(echo "scale=4;${curline}/${total}" | bc)
|
percentage=$(echo "scale=4;${curline}/${total}" | bc)
|
||||||
percentage=$(echo "scale=2;${percentage}*100" | bc)
|
percentage=$(echo "scale=2;${percentage}*100" | bc)
|
||||||
|
|
||||||
VerboseOutput 1 "Copying: $line"
|
VerboseOutput 1 "Copying: $line"
|
||||||
VerboseOutput 2 "Progress: $curline / $total (${percentage%00}%) Step 2 of 2"
|
VerboseOutput 2 "Progress: $curline / $total (${percentage%00}%) Step 2 of 2"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user