diff options
author | Christian Wieninger <cwieninger@gmx.de> | 2011-01-16 13:22:47 +0100 |
---|---|---|
committer | Christian Wieninger <cwieninger@gmx.de> | 2011-01-16 13:22:47 +0100 |
commit | abd6071f10cb3f4452827f6df361bc0c6daa9510 (patch) | |
tree | f3d6fd483907c4bf495611da593c6bf7f89fc5dc /scripts/recrep.sh | |
parent | dfdbb614650d774aed24baee08faa6ced3b62ded (diff) | |
download | vdr-plugin-epgsearch-abd6071f10cb3f4452827f6df361bc0c6daa9510.tar.gz vdr-plugin-epgsearch-abd6071f10cb3f4452827f6df361bc0c6daa9510.tar.bz2 |
updated recrep.sh script with less configuration
Diffstat (limited to 'scripts/recrep.sh')
-rwxr-xr-x | scripts/recrep.sh | 59 |
1 files changed, 21 insertions, 38 deletions
diff --git a/scripts/recrep.sh b/scripts/recrep.sh index 93fa50a..597d4b2 100755 --- a/scripts/recrep.sh +++ b/scripts/recrep.sh @@ -1,57 +1,44 @@ #!/bin/bash #------------------------------------------------------------------------------ -# this script allows searching for a repeat of recording using epgsearch (>=0.9.3) +# this script allows searching for a repeat of a recording using epgsearch # add the following lines to your reccmds.conf # # Search for repeat : /path_to_this_script/recrep.sh 0 # Search for repeat with subtitle (same episode): /path_to_this_script/recrep.sh 1 # # Author: Christian Wieninger (cwieninger@gmx.de) +# Version: 1.1 - 2011-01-16 +# +# requirements: grep #------------------------------------------------------------------------------ # adjust the following lines to your config -# your video dir -VIDEODIR=/video + # your plugins config dir -PLUGINCONFDIR=/video/plugins/epgsearch +PLUGINCONFDIR=/var/lib/vdr/plugins/epgsearch # path to svdrpsend.pl -SVDRPSEND=/usr/local/src/VDR/svdrpsend.pl -# if you are using special subfolders for some recordings, please add them here -FOLDERS="docu,series,magazines" +SVDRPSEND=svdrpsend # the key used to call epgsearch EPGSEARCHKEY=green # do not edit below this line cat << EOM >/tmp/cmd.sh -SEARCHTERM='$2' -#cut a trailing / -SEARCHTERM=\${SEARCHTERM%*/} -#cut leading video dir -SEARCHTERM=\${SEARCHTERM#$VIDEODIR} -#cut leading / -SEARCHTERM=\${SEARCHTERM#/} -#cut leading special folders -i=0; -FOLDERS=$FOLDERS; -while [ "\$LASTWORD" != "\$FOLDERS" ]; -do - LASTWORD=\${FOLDERS%%,*}; - SEARCHTERM=\${SEARCHTERM#*\$LASTWORD/}; - i=\$i+1; - FOLDERS=\${FOLDERS#*,}; -done -#cut last subdir -SEARCHTERM=\${SEARCHTERM%/*.rec} -#cut trailing dummy subtitle created by epgsearch -SEARCHTERM=\${SEARCHTERM%/???_??.??.????-??:??} -if [ "$1" -eq "0" ]; then - SEARCHTERM=\${SEARCHTERM%/*}; +INFOFILE="$2/info"; + +TITLE=\$(grep '^T ' \$INFOFILE); +#cut leading 'T ' +TITLE=\${TITLE#*\$T }; + +EPISODE=\$(grep '^S ' \$INFOFILE) +#cut leading 'S ' +EPISODE=\${EPISODE#*\$S }; + +SEARCHTERM=\$TITLE; + +if [ "$1" -eq "1" ]; then +SEARCHTERM=\$TITLE~\$EPISODE; fi -#replace / with ~ as word delimiter -SEARCHTERM=\${SEARCHTERM//\//~} -#replace _ with blank -SEARCHTERM=\${SEARCHTERM//_/ } RCFILE=$PLUGINCONFDIR/.epgsearchrc echo Search=\$SEARCHTERM > \$RCFILE @@ -65,7 +52,3 @@ $SVDRPSEND HITK $EPGSEARCHKEY EOM echo ". /tmp/cmd.sh; rm /tmp/cmd.sh" | at now -#/tmp/cmd.sh; -#cat /video/plugins/.epgsearchrc - - |