summaryrefslogtreecommitdiffstats
path: root/kaudiocreator/upgrade-kaudiocreator-metadata.sh
diff options
context:
space:
mode:
Diffstat (limited to 'kaudiocreator/upgrade-kaudiocreator-metadata.sh')
-rwxr-xr-xkaudiocreator/upgrade-kaudiocreator-metadata.sh77
1 files changed, 77 insertions, 0 deletions
diff --git a/kaudiocreator/upgrade-kaudiocreator-metadata.sh b/kaudiocreator/upgrade-kaudiocreator-metadata.sh
new file mode 100755
index 00000000..a288c411
--- /dev/null
+++ b/kaudiocreator/upgrade-kaudiocreator-metadata.sh
@@ -0,0 +1,77 @@
+#! /usr/bin/env bash
+
+while read; do
+ if [ "${REPLY#\[}" != "$REPLY" ] ; then # group name
+ GROUP="${REPLY:1:${#REPLY}-2}"
+ continue;
+ fi
+ # normal key=value pair:
+ KEY="${REPLY%%=*}"
+ VALUE="${REPLY#*=}"
+
+ case "$GROUP/$KEY" in
+ encoderconfig/fileFormat)
+ VALUE=`echo $VALUE | sed -e s/%album/%{albumtitle}/g`;
+ VALUE=`echo $VALUE | sed -e s/%artist/%{albumartist}/g`;
+ VALUE=`echo $VALUE | sed -e s/%song/%{title}/g`;
+ VALUE=`echo $VALUE | sed -e s/%track/%{number}/g`;
+ VALUE=`echo $VALUE | sed -e s/%genre/%{genre}/g`;
+ VALUE=`echo $VALUE | sed -e s/%extension/%{extension}/g`;
+ VALUE=`echo $VALUE | sed -e s/%year/%{year}/g`;
+ echo "[encoderconfig]";
+ echo "fileFormat=$VALUE"
+ echo "# DELETE [encoderconfig]fileFormat"
+ ;;
+
+ Encoder_0/commandLine)
+ VALUE=`echo $VALUE | sed -e s/%album/%{albumtitle}/g`;
+ VALUE=`echo $VALUE | sed -e s/%artist/%{albumartist}/g`;
+ VALUE=`echo $VALUE | sed -e s/%song/%{title}/g`;
+ VALUE=`echo $VALUE | sed -e s/%track/%{number}/g`;
+ VALUE=`echo $VALUE | sed -e s/%genre/%{genre}/g`;
+ VALUE=`echo $VALUE | sed -e s/%extension/%{extension}/g`;
+ VALUE=`echo $VALUE | sed -e s/%year/%{year}/g`;
+ echo "[Encoder_0]";
+ echo "commandLine=$VALUE"
+ echo "# DELETE [Encoder_0]commandLine"
+ ;;
+
+ Encoder_1/commandLine)
+ VALUE=`echo $VALUE | sed -e s/%album/%{albumtitle}/g`;
+ VALUE=`echo $VALUE | sed -e s/%artist/%{albumartist}/g`;
+ VALUE=`echo $VALUE | sed -e s/%song/%{title}/g`;
+ VALUE=`echo $VALUE | sed -e s/%track/%{number}/g`;
+ VALUE=`echo $VALUE | sed -e s/%genre/%{genre}/g`;
+ VALUE=`echo $VALUE | sed -e s/%extension/%{extension}/g`;
+ VALUE=`echo $VALUE | sed -e s/%year/%{year}/g`;
+ echo "[Encoder_1]";
+ echo "commandLine=$VALUE"
+ echo "# DELETE [Encoder_1]commandLine"
+ ;;
+
+ Encoder_2/commandLine)
+ VALUE=`echo $VALUE | sed -e s/%album/%{albumtitle}/g`;
+ VALUE=`echo $VALUE | sed -e s/%artist/%{albumartist}/g`;
+ VALUE=`echo $VALUE | sed -e s/%song/%{title}/g`;
+ VALUE=`echo $VALUE | sed -e s/%track/%{number}/g`;
+ VALUE=`echo $VALUE | sed -e s/%genre/%{genre}/g`;
+ VALUE=`echo $VALUE | sed -e s/%extension/%{extension}/g`;
+ VALUE=`echo $VALUE | sed -e s/%year/%{year}/g`;
+ echo "[Encoder_2]";
+ echo "commandLine=$VALUE"
+ echo "# DELETE [Encoder_2]commandLine"
+ ;;
+ Encoder_3/commandLine)
+ VALUE=`echo $VALUE | sed -e s/%album/%{albumtitle}/g`;
+ VALUE=`echo $VALUE | sed -e s/%artist/%{albumartist}/g`;
+ VALUE=`echo $VALUE | sed -e s/%song/%{title}/g`;
+ VALUE=`echo $VALUE | sed -e s/%track/%{number}/g`;
+ VALUE=`echo $VALUE | sed -e s/%genre/%{genre}/g`;
+ VALUE=`echo $VALUE | sed -e s/%extension/%{extension}/g`;
+ VALUE=`echo $VALUE | sed -e s/%year/%{year}/g`;
+ echo "[Encoder_3]";
+ echo "commandLine=$VALUE"
+ echo "# DELETE [Encoder_3]commandLine"
+ ;;
+ esac
+done