diff options
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/README | 4 | ||||
-rwxr-xr-x | contrib/vdr-getcountryfrominfo.sh | 28 | ||||
-rwxr-xr-x | contrib/vdr-getyearfrominfo.sh | 19 |
3 files changed, 51 insertions, 0 deletions
diff --git a/contrib/README b/contrib/README index adba3b3..1fc62d6 100644 --- a/contrib/README +++ b/contrib/README @@ -24,3 +24,7 @@ see rating/README. reclist ------------------------------------------------------------------------------- see reclist/README + +vdr-getcountryfrominfo.sh + vdr-getyearfrominfo.sh +------------------------------------------------------------------------------- +sample scripts to get the country/year out of the info file 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 diff --git a/contrib/vdr-getyearfrominfo.sh b/contrib/vdr-getyearfrominfo.sh new file mode 100755 index 0000000..9ffa913 --- /dev/null +++ b/contrib/vdr-getyearfrominfo.sh @@ -0,0 +1,19 @@ +#!/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 "|Year: XXXX|" first +year=`cat "${infofile}" | grep '|Year:' | sed -e 's/.*|Year: \([0-9]*\)|.*/\1/g'` +#echo "year1:>${year}<" + + +if [ ! "$year" == "" ]; then + echo "${year}" > "$1/year.vdr" + echo "${year}" +fi |