diff --git a/atom b/atom index d141199..1984bb2 100755 --- a/atom +++ b/atom @@ -13,6 +13,7 @@ EFMTINVPARM=49 # config structures declare -A \ + destinationascii \ destinationchannels \ destinationfat32compat \ destinationcopymime \ diff --git a/lib/config/getDestination b/lib/config/getDestination index 6620dff..1e239c4 100644 --- a/lib/config/getDestination +++ b/lib/config/getDestination @@ -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" ;; diff --git a/lib/config/print b/lib/config/print index bd296e6..06d65b3 100644 --- a/lib/config/print +++ b/lib/config/print @@ -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 diff --git a/lib/config/write b/lib/config/write index 6564832..0891648 100644 --- a/lib/config/write +++ b/lib/config/write @@ -168,6 +168,17 @@ bitrate ${destinationquality["$destination"]} fi cat <<-EOCfg +# * ascii-only /: 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 : Files with 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. diff --git a/lib/database/checkVersion b/lib/database/checkVersion index 8fe090b..3491709 100644 --- a/lib/database/checkVersion +++ b/lib/database/checkVersion @@ -23,5 +23,4 @@ checkDatabaseVersion() { else Insert atom 1 <<<"version $currentdbversion" fi - exit } diff --git a/lib/setup/destination b/lib/setup/destination index 40f4ed1..e9402a1 100644 --- a/lib/setup/destination +++ b/lib/setup/destination @@ -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 will not be included in that destination. The '*' character is a wildcard.