summaryrefslogtreecommitdiff
path: root/plugins/extrecmenu
diff options
context:
space:
mode:
authorroot <root@elwms02.(none)>2010-04-06 16:13:08 +0200
committerroot <root@elwms02.(none)>2010-04-06 16:13:08 +0200
commit0e7005fcc7483c01aa102fbea358c5ac65a48d62 (patch)
tree11517ce0d3d2977c6732b3aa583b0008083e0bd3 /plugins/extrecmenu
downloadx-vdr-0e7005fcc7483c01aa102fbea358c5ac65a48d62.tar.gz
x-vdr-0e7005fcc7483c01aa102fbea358c5ac65a48d62.tar.bz2
hello world
Diffstat (limited to 'plugins/extrecmenu')
-rw-r--r--plugins/extrecmenu/dvdarchive.sh116
-rw-r--r--plugins/extrecmenu/patches/extrecmenu-1.2_gcc43.diff10
-rw-r--r--plugins/extrecmenu/patches/extrecmenu-1.2_pin.diff29
-rw-r--r--plugins/extrecmenu/plugin.sh59
4 files changed, 214 insertions, 0 deletions
diff --git a/plugins/extrecmenu/dvdarchive.sh b/plugins/extrecmenu/dvdarchive.sh
new file mode 100644
index 0000000..f7bf066
--- /dev/null
+++ b/plugins/extrecmenu/dvdarchive.sh
@@ -0,0 +1,116 @@
+#!/bin/bash
+#
+# Version 1.5 2006-04-17
+#
+# Exitcodes:
+#
+# exit 0 - no error
+# exit 1 - mount/umount error
+# exit 2 - no dvd in drive
+# exit 3 - wrong dvd in drive / recording not found
+# exit 4 - error while linking [0-9]*.vdr
+#
+# Errorhandling/Symlinking: vejoun@vdr-portal
+#
+# For dvd-in-drive detection download isodetect.c, compile it and put it into the PATH,
+# usually /usr/local/bin/
+#
+# Tools needed: mount, awk, find, test
+# Optional tools: isodetect
+
+#<Configuration>
+
+MOUNTCMD="/usr/bin/sudo /bin/mount"
+UMOUNTCMD="/usr/bin/sudo /bin/umount"
+
+MOUNTPOINT="/media/cdrom" # no trailing '/'!
+
+# Eject DVD for exit-codes 2 and 3 (no or wrong dvd). 1 = yes, 0 = no.
+EJECTWRONG=0
+# Eject DVD after unmounting. 1 = yes, 0 = no.
+EJECTUMOUNT=0
+
+#</Configuration>
+
+DEVICE="$(awk '( $1 !~ /^#/ ) && ( $2 == "'$MOUNTPOINT'" ) { printf("%s", $1); exit; }' /etc/fstab)" # dvd-device, used by isodetect if exists
+
+REC="$2"
+NAME="$3"
+
+call() {
+ echo -e "\nScript $0 needs three parameters for mount and two for umount. The first must be mount or umount, the second is the full path.\n"
+ echo -e "Only for mounting the script needs a third parameter, the last part of the recording path.\n"
+ echo -e "Example: dvdarchive.sh mount '/video1.0/Music/%Riverdance/2004-06-06.00:10.50.99.rec' '2004-06-06.00:10.50.99.rec'\n"
+ echo -e "Example: dvdarchive.sh umount '/video1.0/Music/%Riverdance/2004-06-06.00:10.50.99.rec'\n"
+}
+
+[ "$1" = "mount" -o "$1" = "umount" ] || { call; exit 10; }
+[ -z "$2" ] && { call; exit 10; }
+[ "$1" = mount -a -z "$3" ] && { call; exit 10; }
+
+case "$1" in
+mount)
+ # check if dvd is in drive, only if isodetect exists
+ if [ -n "$(which isodetect)" -a -n "$DEVICE" ]; then
+ isodetect -d "$DEVICE" >/dev/null 2>&1
+ if [ $? -ne 0 ]; then
+ echo "no dvd in drive"
+ [ $EJECTWRONG -eq 1 ] && { eject "$DEVICE"; }
+ exit 2
+ fi
+ fi
+ # check if not mounted
+ $MOUNTCMD | grep "$MOUNTPOINT" >/dev/null && { echo "dvd already mounted"; exit 1; }
+ # mount dvd
+ $MOUNTCMD "$MOUNTPOINT" || { echo "dvd mount error"; exit 1; }
+ # is mounted?
+ # find recording on dvd
+ DIR="$(find "${MOUNTPOINT}/" -name "$NAME")"
+ # if not found, umount
+ if [ -z "$DIR" ]; then
+ $UMOUNTCMD "$MOUNTPOINT" || { echo "dvd umount error"; exit 1; }
+ echo "wrong dvd in drive / recording not found on dvd"
+ [ $EJECTWRONG -eq 1 ] && { eject "$DEVICE"; }
+ exit 3
+ fi
+ # link index.vdr if not exist
+ if [ ! -e "${REC}/index.vdr" ]; then
+ cp -s "${DIR}/index.vdr" "${REC}/"
+ fi
+ # link [0-9]*.vdr files
+ cp -s "${DIR}/"[0-9]*.vdr "${REC}/"
+ # error while linking [0-9]*.vdr files?
+ if [ $? -ne 0 ]; then
+ # umount dvd bevor unlinking
+ $UMOUNTCMD "$MOUNTPOINT" || { echo "dvd umount error"; exit 1; }
+ # unlink broken links
+ for LINK in "${REC}/"*.vdr; do
+ if [ -L "$LINK" -a ! -s "$LINK" ]; then
+ rm "$LINK"
+ fi
+ done
+ echo "error while linking [0-9]*.vdr"
+ exit 4
+ fi
+ ;;
+umount)
+ # check if dvd is mounted
+ $MOUNTCMD | grep "$MOUNTPOINT" >/dev/null || { echo "dvd not mounted"; exit 1; }
+ # is mounted?
+ # umount dvd bevor unlinking
+ $UMOUNTCMD "$MOUNTPOINT" || { echo "dvd umount error"; exit 1; }
+ # unlink broken links
+ for LINK in "${REC}/"*.vdr; do
+ if [ -L "$LINK" -a ! -s "$LINK" ]; then
+ rm "$LINK"
+ fi
+ done
+ [ $EJECTUMOUNT -eq 1 ] && { eject "$DEVICE"; }
+ ;;
+ *)
+ echo -e "\nWrong action."
+ call
+ ;;
+esac
+
+exit 0
diff --git a/plugins/extrecmenu/patches/extrecmenu-1.2_gcc43.diff b/plugins/extrecmenu/patches/extrecmenu-1.2_gcc43.diff
new file mode 100644
index 0000000..ffee003
--- /dev/null
+++ b/plugins/extrecmenu/patches/extrecmenu-1.2_gcc43.diff
@@ -0,0 +1,10 @@
+--- extrecmenu-1.1/tools.c
++++ extrecmenu-1.1/tools.c
+@@ -5,6 +5,7 @@
+ #include <string>
+ #include <fstream>
+ #include <iostream>
++#include <langinfo.h>
+ #include <vdr/plugin.h>
+ #include <vdr/videodir.h>
+ #include <vdr/recording.h>
diff --git a/plugins/extrecmenu/patches/extrecmenu-1.2_pin.diff b/plugins/extrecmenu/patches/extrecmenu-1.2_pin.diff
new file mode 100644
index 0000000..60ed84d
--- /dev/null
+++ b/plugins/extrecmenu/patches/extrecmenu-1.2_pin.diff
@@ -0,0 +1,29 @@
+--- mymenurecordings.c~
++++ mymenurecordings.c
+@@ -582,7 +582,7 @@
+ if(!base||(strstr(listitem->recording->Name(),base)==listitem->recording->Name()&&listitem->recording->Name()[strlen(base)]=='~'))
+ {
+ myMenuRecordingsItem *recitem=new myMenuRecordingsItem(listitem->recording,level);
+-#ifdef WITHPINPLUGIN
++#ifdef USE_PINPLUGIN
+ bool hidepinprotectedrecs=false;
+ cPlugin *pinplugin=cPluginManager::GetPlugin("pin");
+ if(pinplugin)
+@@ -672,7 +672,7 @@
+ myMenuRecordingsItem *item=(myMenuRecordingsItem*)Get(Current());
+ if(item)
+ {
+-#ifdef WITHPINPLUGIN
++#ifdef USE_PINPLUGIN
+ if(cStatus::MsgReplayProtected(GetRecording(item),item->Name(),base,item->IsDirectory())==true)
+ return osContinue;
+ #endif
+@@ -1059,7 +1059,7 @@
+ cRecording *rec=GetRecording(item);
+ if(rec)
+ {
+-#ifdef WITHPINPLUGIN
++#ifdef USE_PINPLUGIN
+ if(cStatus::MsgReplayProtected(rec,item->Name(),base,item->IsDirectory())==true)
+ break;
+ #endif
diff --git a/plugins/extrecmenu/plugin.sh b/plugins/extrecmenu/plugin.sh
new file mode 100644
index 0000000..dee6348
--- /dev/null
+++ b/plugins/extrecmenu/plugin.sh
@@ -0,0 +1,59 @@
+#!/bin/sh
+
+# x-vdr (Installations-Skript fuer einen VDR mit Debian als Basis)
+# von Marc Wernecke - www.zulu-entertainment.de
+# 11.09.2008
+#
+# vdr-extrecmenu
+
+# defaults
+source ./../../x-vdr.conf
+source ./../../setup.conf
+source ./../../functions
+
+WEB="http://martins-kabuff.de/download/vdr-extrecmenu-1.2-test1.tgz"
+VERSION="extrecmenu-1.2"
+LINK="extrecmenu"
+
+VAR=`basename $WEB`
+DIR=`pwd`
+
+# plugin entfernen
+function clean_plugin() {
+ cd $SOURCEDIR/VDR/PLUGINS/src
+ rm -rf $LINK*
+ rm -f $VDRLIBDIR/libvdr-$LINK*
+ rm -f $VDRBINDIR/dvdarchive.sh
+ log "cleaning $LINK"
+}
+
+# plugin installieren
+function install_plugin() {
+ download_plugin
+ extract_plugin
+ cd $SOURCEDIR/VDR/PLUGINS/src
+ rm -f $LINK
+ ln -vfs $VERSION $LINK
+
+ patch_plugin
+
+ ## plugin specials - start ##
+ if [ -f $DIR/dvdarchive.sh ]; then
+ cp -f $DIR/dvdarchive.sh $VDRBINDIR
+ else
+ cp -f $SOURCEDIR/VDR/PLUGINS/src/$LINK/scripts/dvdarchive.sh $VDRBINDIR
+ fi
+ chmod 0755 $VDRBINDIR/dvdarchive.sh
+ ## plugin specials - ende ##
+}
+
+# plugin commands
+if [ $# \> 0 ]; then
+ cmd=$1
+ cmd_plugin
+else
+ install_plugin
+ log "install-plugin fuer $VERSION ist fertig"
+fi
+
+exit 0