config parser, setup for ascii-only
This commit is contained in:
parent
94c149e184
commit
e16b8ff4a9
1
atom
1
atom
@ -13,6 +13,7 @@ EFMTINVPARM=49
|
||||
|
||||
# config structures
|
||||
declare -A \
|
||||
destinationascii \
|
||||
destinationchannels \
|
||||
destinationfat32compat \
|
||||
destinationcopymime \
|
||||
|
||||
@ -154,6 +154,22 @@ getConfigDestination() {
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
'ascii-only')
|
||||
case $value in
|
||||
'true'|'on'|'yes')
|
||||
destinationascii["$destination"]=1
|
||||
textunidecodeneeded=1
|
||||
;;
|
||||
'false'|'off'|'no')
|
||||
destinationascii["$destination"]=0
|
||||
;;
|
||||
*)
|
||||
echo "ascii-only takes values:" \
|
||||
"'yes' ,'true' ,'on', 'no', 'false',"\
|
||||
"'off'"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
'skip_mime-type')
|
||||
destinationskipmime[$destination]="${destinationskipmime[$destination]:+${destinationskipmime[$destination]}|}$value"
|
||||
;;
|
||||
|
||||
@ -42,6 +42,7 @@ printConfig() {
|
||||
|Frequency|${destinationfrequency["$destination"]}
|
||||
|Higher than|${destinationmaxbps["$destination"]}
|
||||
|Fat32 Compat.|${destinationfat32compat["$destination"]}
|
||||
|ASCII Compat.|${destinationascii["$destination"]}
|
||||
|Path Change|${destinationrenamepath["$destination"]}
|
||||
|File Rename|${destinationrename["$destination"]}
|
||||
EOF
|
||||
|
||||
@ -168,6 +168,17 @@ bitrate ${destinationquality["$destination"]}
|
||||
fi
|
||||
cat <<-EOCfg
|
||||
|
||||
# * ascii-only <yes>/<no>: Rename files for compatibility with ASCII-only
|
||||
# systems.
|
||||
EOCfg
|
||||
if (( ${destinationascii["$destination"]} ))
|
||||
then
|
||||
echo $'ascii-only\t\tyes'
|
||||
else
|
||||
echo $'ascii-only\t\tno'
|
||||
fi
|
||||
cat <<-EOCfg
|
||||
|
||||
# * skip_mime-type <mime-type>: Files with mime-type <mime-type> will not
|
||||
# be included in that destination. For more than one mime-type, use multiple
|
||||
# times, as needed. The '*' character is a wildcard.
|
||||
|
||||
@ -23,5 +23,4 @@ checkDatabaseVersion() {
|
||||
else
|
||||
Insert atom 1 <<<"version $currentdbversion"
|
||||
fi
|
||||
exit
|
||||
}
|
||||
|
||||
@ -295,6 +295,36 @@ setupDestination() {
|
||||
comeagain
|
||||
cat <<-EODesc
|
||||
|
||||
ASCII-only filenames (boolean):
|
||||
Rename files for compatibility with ASCII-only systems (most car
|
||||
radios).
|
||||
EODesc
|
||||
case ${destinationascii["$destination"]} in
|
||||
0) initialvalue=n ;;
|
||||
1) initialvalue=y ;;
|
||||
*) unset initialvalue ;;
|
||||
esac
|
||||
comeagain() {
|
||||
read \
|
||||
-e \
|
||||
${initialvalue+-i $initialvalue}\
|
||||
-p'ASCII-only filenames (y/N): '\
|
||||
value
|
||||
case $value in
|
||||
[yY])
|
||||
destinationascii["$destination"]=1
|
||||
;;
|
||||
''|[nN])
|
||||
destinationascii["$destination"]=0
|
||||
;;
|
||||
*)
|
||||
comeagain
|
||||
;;
|
||||
esac
|
||||
}
|
||||
comeagain
|
||||
cat <<-EODesc
|
||||
|
||||
Skip mime-type (mime-type, string):
|
||||
Files with mime-type <mime-type> will not be included in that
|
||||
destination. The '*' character is a wildcard.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user