force some fields as text

This commit is contained in:
Vincent Riquer 2013-05-27 12:44:39 +02:00
parent 0f4ea73ae6
commit 47e8f1dc22
5 changed files with 20 additions and 8 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
*.ex
*.EX
trace.log

View File

@ -15,6 +15,10 @@ Insert() {
insert_keys+='`'"$key"'`' insert_keys+='`'"$key"'`'
(( ${#insert_values} )) && insert_values+="," (( ${#insert_values} )) && insert_values+=","
case $value in case $value in
'::AtOM:FT::'*)
value="${value//::AtOM:FT::/}"
insert_values+='"'"${value//\"/\"\"}"'"'
;;
'NULL') 'NULL')
insert_values+="NULL" insert_values+="NULL"
;; ;;

View File

@ -25,7 +25,8 @@ InsertIfUnset() {
Select "$table" "$column" < <( Select "$table" "$column" < <(
for key in ${!keys[@]} for key in ${!keys[@]}
do do
echo "${keys[$key]}" = "${values[$key]}" echo "${keys[$key]}" = \
"${values[$key]//::AtOM:FT::}"
done done
) )
) )

View File

@ -26,6 +26,10 @@ Update() {
;; ;;
value) value)
case $argument in case $argument in
'::AtOM:FT::'*)
argument="${argument//::AtOM:FT::/}"
set_statement+=" = "'"'"${argument//\"/\"\"}"'"'
;;
'NULL') 'NULL')
set_statement+=" = NULL" set_statement+=" = NULL"
;; ;;

View File

@ -108,15 +108,15 @@ updateTags() {
[[ $oldchannels != "$channels" ]]&& uch=1 [[ $oldchannels != "$channels" ]]&& uch=1
[[ $oldbitrate != "$bitrate" ]]&& ubi=1 [[ $oldbitrate != "$bitrate" ]]&& ubi=1
Update tags \ Update tags \
${ual:+album "${album:-NULL}"} \ ${ual:+album "::AtOM:FT::${album:-NULL}"}\
${uaa:+albumartist "${albumartist:-NULL}"} \ ${uaa:+albumartist "::AtOM:FT::${albumartist:-NULL}"}\
${uar:+artist "${artist:-NULL}"} \ ${uar:+artist "::AtOM:FT::${artist:-NULL}"}\
${uco:+composer "${composer:-NULL}"} \ ${uco:+composer "::AtOM:FT::${composer:-NULL}"}\
${udi:+disc "${disc:-NULL}"} \ ${udi:+disc "${disc:-NULL}"} \
${uge:+genre "${genre:-NULL}"} \ ${uge:+genre "${genre:-NULL}"} \
${upe:+performer "${performer:-NULL}"} \ ${upe:+performer "::AtOM:FT::${performer:-NULL}"}\
${uti:+title "${title:-NULL}"} \ ${uti:+title "::AtOM:FT::${title:-NULL}"}\
${utr:+track "${tracknum:-NULL}"} \ ${utr:+track "::AtOM:FT::${tracknum:-NULL}"}\
${uye:+year "${year:-NULL}"} \ ${uye:+year "${year:-NULL}"} \
last_change "$lastchange" \ last_change "$lastchange" \
${ura:+rate "${rate:-NULL}"} \ ${ura:+rate "${rate:-NULL}"} \