summaryrefslogtreecommitdiffstats
path: root/kioslave/audiocd/upgrade-metadata.sh
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commite2de64d6f1beb9e492daf5b886e19933c1fa41dd (patch)
tree9047cf9e6b5c43878d5bf82660adae77ceee097a /kioslave/audiocd/upgrade-metadata.sh
downloadtdemultimedia-e2de64d6f1beb9e492daf5b886e19933c1fa41dd.tar.gz
tdemultimedia-e2de64d6f1beb9e492daf5b886e19933c1fa41dd.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kioslave/audiocd/upgrade-metadata.sh')
-rwxr-xr-xkioslave/audiocd/upgrade-metadata.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/kioslave/audiocd/upgrade-metadata.sh b/kioslave/audiocd/upgrade-metadata.sh
new file mode 100755
index 00000000..000323b1
--- /dev/null
+++ b/kioslave/audiocd/upgrade-metadata.sh
@@ -0,0 +1,28 @@
+#! /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
+ FileName/file_name_template)
+ #
+ # Swap
+ #
+ VALUE=`echo $VALUE | sed -e s/%a/%{albumtitle}/g`;
+ VALUE=`echo $VALUE | sed -e s/%t/%{title}/g`;
+ VALUE=`echo $VALUE | sed -e s/%n/%{number}/g`;
+ VALUE=`echo $VALUE | sed -e s/%g/%{genre}/g`;
+ VALUE=`echo $VALUE | sed -e s/%y/%{year}/g`;
+ VALUE=`echo $VALUE | sed -e s/%A/%{albumartist}/g`;
+ echo "[FileName]";
+ echo "file_name_template=$VALUE"
+ echo "# DELETE [FileName]file_name_template"
+ ;;
+ esac
+done