summaryrefslogtreecommitdiff
path: root/contrib/vdr-getcountryfrominfo.sh
diff options
context:
space:
mode:
authorAndreas Mair <amair.sob@googlemail.com>2011-03-19 11:35:37 +0100
committerAndreas Mair <amair.sob@googlemail.com>2011-03-19 11:35:37 +0100
commit25987e83a85d0f86300da97a6d41f2ba6fc0ea36 (patch)
tree6234f13b42340dd09f756f462acceda76888dcef /contrib/vdr-getcountryfrominfo.sh
parent64fbf013359f29c4e611e04daf136dca8cc29317 (diff)
downloadvdr-plugin-extrecmenu-25987e83a85d0f86300da97a6d41f2ba6fc0ea36.tar.gz
vdr-plugin-extrecmenu-25987e83a85d0f86300da97a6d41f2ba6fc0ea36.tar.bz2
Merged from v1.3-devel branch: added ability to configure items that should be shown in recording list.
Diffstat (limited to 'contrib/vdr-getcountryfrominfo.sh')
-rwxr-xr-xcontrib/vdr-getcountryfrominfo.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/contrib/vdr-getcountryfrominfo.sh b/contrib/vdr-getcountryfrominfo.sh
new file mode 100755
index 0000000..ae4d3d0
--- /dev/null
+++ b/contrib/vdr-getcountryfrominfo.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+# old info file
+infofile="$1/info.vdr"
+
+# use new info file if available
+if [ -e "$1/info" ]; then
+ infofile="$1/info"
+fi
+
+# try "Land: XXX 2010" first
+country=`cat "${infofile}" | grep '|Land:' | sed -e 's/.*|Land: \([^ ]*\).*/\1/g'`
+#echo "country1:>${country}<"
+
+if [ "$country" == "" ]; then
+ country=`cat ${infofile} | grep '|Country:' | sed -e 's/.*|Country: \([^|]*\).*/\1/g'`
+ #echo "country2:>${country}<"
+fi
+
+if [ "$country" == "" ]; then
+ country=`cat ${infofile} | grep -e '^D .*' | sed -e 's/^D [^, ]*[, ]*\([A-Z/]*\).*/\1/g'`
+ #echo "country3:>${country}<"
+fi
+
+if [ ! "$country" == "" ]; then
+ echo "${country}" > "$1/country.vdr"
+ echo "${country}"
+fi