summaryrefslogtreecommitdiff
path: root/commands
diff options
context:
space:
mode:
authorKeine_Ahnung <no@mail.com>2012-12-29 21:09:02 +0100
committerKeine_Ahnung <no@mail.com>2012-12-29 21:09:02 +0100
commit9d8e29c65d7e42f2fd90617800ae4f66faf13c60 (patch)
tree6161b3617186106dd4bd79743126c4b878802e28 /commands
parent5273ed5096773c7bc348cb633ef2db1a3270699b (diff)
downloadvdr-plugin-ripit-9d8e29c65d7e42f2fd90617800ae4f66faf13c60.tar.gz
vdr-plugin-ripit-9d8e29c65d7e42f2fd90617800ae4f66faf13c60.tar.bz2
Added Prefix PLUGIN_RIPIT_ again.
Bring back the global config to the Makefiles. Added Desciptions in Make.config.template Added i18n to vdr-ripit script. Check for optical drive presence in vdr-ripit
Diffstat (limited to 'commands')
-rw-r--r--commands/po/vdr-ripit.de.po64
-rw-r--r--commands/po/vdr-ripit.fr.po59
-rw-r--r--commands/po/vdr-ripit.it.po59
-rw-r--r--commands/vdr-opticaldrive6
-rw-r--r--commands/vdr-ripit69
5 files changed, 234 insertions, 23 deletions
diff --git a/commands/po/vdr-ripit.de.po b/commands/po/vdr-ripit.de.po
new file mode 100644
index 0000000..d0c72be
--- /dev/null
+++ b/commands/po/vdr-ripit.de.po
@@ -0,0 +1,64 @@
+# vdr-ripit-plugin plugin language source file.
+# This file is distributed under the same license as the vdr-ripit-plugin package.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: vdr-ripit-plugin 0.1.0pre\n"
+"Report-Msgid-Bugs-To: <see README>\n"
+"POT-Creation-Date: 2012-01-18 17:02+0100\n"
+"PO-Revision-Date: 2012-12-27 20:51+0100\n"
+"Last-Translator: \n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: German\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid ""
+"Usage: $s -M <mode start|kill> -d <target directory> [-n <nicelevel -20..19>] [-v <verbosity 0..5>]\\n"
+" [-t <encoding type 0..5>] [-o <encoding quality -1..10>] [-l <low bitrate 32..320>]\\n"
+" [-m <max. bitrate 32..320>] [-e <encoder options>] [-c <crc 0|1>] [-r <rip options>]\\n"
+" [-f <fast rip 0|1>] [ -x <excludes special chars _|NTFS|HFS>] [-u <underscores 0|1>]\\n"
+" [-p <create playlist 0|1>] -X <lockfile> -L <logfile> -A <stopfile>"
+msgstr ""
+"Nutzung: $s -M <Modus start|kill> -d <Speicherort> [-n <Priorität -20..19>] [-v <Log Detailtiefe 0..5>]\\n"
+" [-t <Zielformat 0..5>] [-o <Qualität -1..10>] [-l <Minimale Bitrate 32..320>]\\n"
+" [-m <Maximale Bitrate 32..320>] [-e <Encoder Optionen>] [-c <Prüfsummen 0|1>] [-r <Ripper Optionen>]\\n"
+" [-f <Schnelles Rippen 0|1>] [ -x <Dateisystem Zeichen Maskieren _|NTFS|HFS>] [-u <Leerzeichen 0|1>]\\n"
+" [-p <Playlist erstellen 0|1>] -X <lockfile> -L <logfile> -A <stopfile>"
+
+msgid "Error: Error parsing Commandline"
+msgstr "Fehler: Falsch formatierte Kommandozeilenparameter"
+
+msgid "Error: Missing or wrong Mode (-M)"
+msgstr "Fehler: Fehlender oder falscher Modusparameter (-M)"
+
+msgid "Error: Missing Directory Parameter (-d)"
+msgstr "Fehler: Fehlender Verzeichnisparameter (-d)"
+
+msgid "Error: Missing -X, -L or -A"
+msgstr "Fehler: Felhlende Argument -X, -L oder -A"
+
+msgid "PROCESS MANUALLY ABORTED\\nPlease Wait (max. $d Seconds)..."
+msgstr "VORGANG MANUELL ABGEBROCHEN\\nBitte warten (maximal $d Sekunden)..."
+
+msgid "Opticaldrive Drive not present. Aborting!"
+msgstr "Optisches Laufwerk nicht vorhanden. Abbruch!"
+
+msgid "Error, Directory $s not writable"
+msgstr "Fehler, keine Schreibrechte im Verzeichnis \"$s\""
+
+msgid "Please insert CD... (start in $d Seconds)"
+msgstr "Bitte CD einlegen... (starte in $d Sekunden)"
+
+msgid "Ripping process started...."
+msgstr "Rippen gestartet...."
+
+msgid "Execute: $s"
+msgstr "Starte: $s"
+
+msgid "ABORTED!"
+msgstr "ABGEBROCHEN!"
+
+msgid "ALL DONE!"
+msgstr "FERTIG!"
diff --git a/commands/po/vdr-ripit.fr.po b/commands/po/vdr-ripit.fr.po
new file mode 100644
index 0000000..6b90226
--- /dev/null
+++ b/commands/po/vdr-ripit.fr.po
@@ -0,0 +1,59 @@
+# vdr-ripit-plugin plugin language source file.
+# This file is distributed under the same license as the vdr-ripit-plugin package.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: vdr-ripit-plugin 0.1.0pre\n"
+"Report-Msgid-Bugs-To: <see README>\n"
+"POT-Creation-Date: 2012-01-18 17:02+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: http://www.vdr-portal.de/board1-news/board2-vdr-news/p541892-announce-update-ripit-plugin-version-0-0-2/#post541892\n"
+"Language-Team: http://www.vdr-portal.de/board1-news/board2-vdr-news/p541892-announce-update-ripit-plugin-version-0-0-2/#post541892\n"
+"Language: French\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid ""
+"Usage: $s -M <mode start|kill> -d <target directory> [-n <nicelevel -20..19>] [-v <verbosity 0..5>]\\n"
+" [-t <encoding type 0..5>] [-o <encoding quality -1..10>] [-l <low bitrate 32..320>]\\n"
+" [-m <max. bitrate 32..320>] [-e <encoder options>] [-c <crc 0|1>] [-r <rip options>]\\n"
+" [-f <fast rip 0|1>] [ -x <excludes special chars _|NTFS|HFS>] [-u <underscores 0|1>]\\n"
+" [-p <create playlist 0|1>] -X <lockfile> -L <logfile> -A <stopfile>"
+msgstr ""
+
+msgid "Error: Error parsing Commandline"
+msgstr ""
+
+msgid "Error: Missing or wrong Mode (-M)"
+msgstr ""
+
+msgid "Error: Missing Directory Parameter (-d)"
+msgstr ""
+
+msgid "Error: Missing -X, -L or -A"
+msgstr ""
+
+msgid "PROCESS MANUALLY ABORTED\\nPlease Wait (max. $d Seconds)..."
+msgstr ""
+
+msgid "Opticaldrive Drive not present. Aborting!"
+msgstr ""
+
+msgid "Error, Directory $s not writable"
+msgstr ""
+
+msgid "Please insert CD... (start in $d Seconds)"
+msgstr ""
+
+msgid "Ripping process started...."
+msgstr ""
+
+msgid "Execute: $s"
+msgstr ""
+
+msgid "ABORTED!"
+msgstr ""
+
+msgid "ALL DONE!"
+msgstr ""
diff --git a/commands/po/vdr-ripit.it.po b/commands/po/vdr-ripit.it.po
new file mode 100644
index 0000000..cf05c47
--- /dev/null
+++ b/commands/po/vdr-ripit.it.po
@@ -0,0 +1,59 @@
+# vdr-ripit-plugin plugin language source file.
+# This file is distributed under the same license as the vdr-ripit-plugin package.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: vdr-ripit-plugin 0.1.0pre\n"
+"Report-Msgid-Bugs-To: <see README>\n"
+"POT-Creation-Date: 2012-01-18 17:02+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: http://www.vdr-portal.de/board1-news/board2-vdr-news/p745194-announce-update-ripit-plugin-version-0-0-2/#post745194\n"
+"Language-Team: http://www.vdr-portal.de/board1-news/board2-vdr-news/p745194-announce-update-ripit-plugin-version-0-0-2/#post745194\n"
+"Language: Italian\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid ""
+"Usage: $s -M <mode start|kill> -d <target directory> [-n <nicelevel -20..19>] [-v <verbosity 0..5>]\\n"
+" [-t <encoding type 0..5>] [-o <encoding quality -1..10>] [-l <low bitrate 32..320>]\\n"
+" [-m <max. bitrate 32..320>] [-e <encoder options>] [-c <crc 0|1>] [-r <rip options>]\\n"
+" [-f <fast rip 0|1>] [ -x <excludes special chars _|NTFS|HFS>] [-u <underscores 0|1>]\\n"
+" [-p <create playlist 0|1>] -X <lockfile> -L <logfile> -A <stopfile>"
+msgstr ""
+
+msgid "Error: Error parsing Commandline"
+msgstr ""
+
+msgid "Error: Missing or wrong Mode (-M)"
+msgstr ""
+
+msgid "Error: Missing Directory Parameter (-d)"
+msgstr ""
+
+msgid "Error: Missing -X, -L or -A"
+msgstr ""
+
+msgid "PROCESS MANUALLY ABORTED\\nPlease Wait (max. $d Seconds)..."
+msgstr ""
+
+msgid "Opticaldrive Drive not present. Aborting!"
+msgstr ""
+
+msgid "Error, Directory $s not writable"
+msgstr ""
+
+msgid "Please insert CD... (start in $d Seconds)"
+msgstr ""
+
+msgid "Ripping process started...."
+msgstr ""
+
+msgid "Execute: $s"
+msgstr ""
+
+msgid "ABORTED!"
+msgstr ""
+
+msgid "ALL DONE!"
+msgstr ""
diff --git a/commands/vdr-opticaldrive b/commands/vdr-opticaldrive
index 2c2f1f9..18a4985 100644
--- a/commands/vdr-opticaldrive
+++ b/commands/vdr-opticaldrive
@@ -17,17 +17,17 @@ case "$mode" in
;;
startburn)
eject -t "$DEV"
- eject -i on "$DEV"
+ eject -i on "$DEV" > /dev/null
;;
stopburn)
- eject -i off "$DEV"
+ eject -i off "$DEV" > /dev/null
eject "$DEV"
;;
getopentime)
printf "%s\n" "$OPENTIME"
;;
getdev)
- printf "$DEV\n"
+ printf "%s\n" "$DEV"
;;
present)
if [ -n "$(realpath "$DEV" 2> /dev/null)" ]; then
diff --git a/commands/vdr-ripit b/commands/vdr-ripit
index 3cfbee6..19cf9d3 100644
--- a/commands/vdr-ripit
+++ b/commands/vdr-ripit
@@ -1,8 +1,22 @@
#!/bin/sh
+export TEXTDOMAIN="$(basename $0)"
+. gettext.sh 2> /dev/null
+if [ $? -eq 1 ]; then
+ eval_gettext () {
+ gettext_eval="printf '%s' \"$1\""
+ printf "%s" "`eval \"$gettext_eval\"`"
+ }
+ gettext() {
+ printf "%s" "$1";
+ }
+fi
+
usage(){
- printf "Usage: $(basename $0) -M <mode start|kill> -d <target directory> [-n <nicelevel -20..19>] [-v <verbosity 0..5>]\n [-t <encoding type 0..5>] [-o <encoding quality -1..10>] [-l <low bitrate 32..320>]\n [-m <max. bitrate 32..320>] [-e <encoder options>] [-c <crc 0|1>] [-r <rip options>]\n [-f <fast rip 0|1>] [ -x <excludes special chars> _|NTFS|HFS] [-u <underscores 0|1>]\n [-p <crate playlist 0|1>] -X <lockfile> -L <logfile> -A <stopfile>\n"
- [ -n "$cmd_error" ] && echo "$cmd_error"
+ s="$(basename $0)"
+ printf "$(eval_gettext 'Usage: $s -M <mode start|kill> -d <target directory> [-n <nicelevel -20..19>] [-v <verbosity 0..5>]\n [-t <encoding type 0..5>] [-o <encoding quality -1..10>] [-l <low bitrate 32..320>]\n [-m <max. bitrate 32..320>] [-e <encoder options>] [-c <crc 0|1>] [-r <rip options>]\n [-f <fast rip 0|1>] [ -x <excludes special chars _|NTFS|HFS>] [-u <underscores 0|1>]\n [-p <create playlist 0|1>] -X <lockfile> -L <logfile> -A <stopfile>')\n"
+ [ -n "$cmd_error" ] && printf "\n$cmd_error"
+ exit 1
}
debug(){
@@ -21,12 +35,12 @@ debug(){
echo "PARAM_UNDERSCORES : >$PARAM_UNDERSCORES<"
echo "PARAM_PLAYLIST : >$PARAM_PLAYLIST<"
echo "PARAM_RIPOPTS : >$PARAM_RIPOPTS<"
- echo "LOCK_FILE : >$LOCK_FILE<"
- echo "LOG_FILE : >$LOG_FILE<"
- echo "ABORT_FILE : >$ABORT_FILE<"
+ echo "LOCK_FILE : >$LOCK_FILE<"
+ echo "LOG_FILE : >$LOG_FILE<"
+ echo "ABORT_FILE : >$ABORT_FILE<"
}
-error=""
+cmd_error=""
while getopts ":M:d:n:v:t:o:l:m:e:c:r:f:x:u:p:X:L:A:" opt; do
case "$opt" in
M) PARAM_MODE="$OPTARG";;
@@ -48,17 +62,17 @@ while getopts ":M:d:n:v:t:o:l:m:e:c:r:f:x:u:p:X:L:A:" opt; do
L) LOG_FILE="$OPTARG";;
A) ABORT_FILE="$OPTARG";;
--) break;;
- \?) cmd_error="Error: Error parsing Commandline\n"; break;;
+ \?) cmd_error="$(gettext 'Error: Error parsing Commandline')\n"; break;;
esac
done
-([ "$PARAM_MODE" = "start" ] || [ "$PARAM_MODE" = "kill" ]) || cmd_error="${cmd_error}Error: Missing or wrong Mode (-M)\n"
-([ "$PARAM_MODE" = "start" ] && [ -z "$PARAM_DIR" ]) && cmd_error="${cmd_error}Error: Missing Directory Parameter (-d)\n"
+([ "$PARAM_MODE" = "start" ] || [ "$PARAM_MODE" = "kill" ]) || cmd_error="${cmd_error}$(gettext 'Error: Missing or wrong Mode (-M)')\n"
+([ "$PARAM_MODE" = "start" ] && [ -z "$PARAM_DIR" ]) && cmd_error="${cmd_error}$(gettext 'Error: Missing Directory Parameter (-d)')\n"
[ -n "$cmd_error" ] && usage
if ([ -z "$LOCK_FILE" ] || [ -z "$LOG_FILE" ] || [ -z "$ABORT_FILE" ] ); then
- cmd_error="${cmd_error}Error: Missing -X, -L or -A\n"
+ cmd_error="${cmd_error}$(gettext 'Error: Missing -X, -L or -A')\n"
usage
rm -f "$LOCK_FILE"
exit 1
@@ -78,7 +92,8 @@ fi
case "$PARAM_MODE" in
kill)
touch "$ABORT_FILE"
- printf "PROCESS MANUALLY ABORTED\nPlease Wait (max. %s Seconds)...\n" "$(vdr-opticaldrive getopentime)"
+ d="$(vdr-opticaldrive getopentime)"
+ printf "$(eval_gettext 'PROCESS MANUALLY ABORTED\nPlease Wait (max. $d Seconds)...')\n"
for pid in $(pidof perl); do
#echo "$(cat /proc/$pid/cmdline | sed 's/\x00/ /g'|sed 's/^perl //')" > /tmp/a
#echo "$(cat $LOCK_FILE|sed "s/'//g"|sed 's/^nice -n [[:digit:]]\{2\} //') " > /tmp/b
@@ -88,14 +103,26 @@ case "$PARAM_MODE" in
start)
touch "$LOCK_FILE"
rm -f "$ABORT_FILE"
- [ ! -d "$PARAM_DIR" ] && mkdir -p "$PARAM_DIR"
+
+ if ! vdr-opticaldrive present > /dev/null; then
+ printf "%s\n" "$(gettext 'Opticaldrive Drive not present. Aborting!')"
+ rm -f "$LOCK_FILE"
+ exit 1
+ fi
+
+ [ ! -d "$PARAM_DIR" ] && mkdir -p "$PARAM_DIR" 2> /dev/zero
if [ ! -w "$PARAM_DIR" ]; then
- printf "Error, Directory %s not writable\n" "$PARAM_DIR"
- touch "$ABORT_FILE"
+ s="$PARAM_DIR"
+ printf "%s\n" "$(eval_gettext 'Error, Directory $s not writable')"
+ rm -f "$LOCK_FILE"
+ exit 1
fi
+
vdr-opticaldrive open
- printf "Please insert CD... (start in %s Seconds)\n" "$(vdr-opticaldrive getopentime)"
+ d="$(vdr-opticaldrive getopentime)"
+ printf "%s\n" "$(eval_gettext 'Please insert CD... (start in $d Seconds)')"
sleep $(vdr-opticaldrive getopentime)
+
if [ ! -f "$ABORT_FILE" ]; then
vdr-opticaldrive startburn
@@ -155,14 +182,16 @@ case "$PARAM_MODE" in
[ "$PARAM_PLAYLIST" = "1" ] && commandline="${commandline}$(printf " -p '%s'" "2")" \
|| commandline="${commandline}$(printf " -p '%s'" "0")" \
- printf "Ripping process started....\n"
- printf "Execute: $commandline\n----------------------------------------\n"
- echo "$commandline" > "$LOCK_FILE"
+ printf "%s\n" "$(gettext 'Ripping process started....')"
+ s="$commandline"
+ printf "%s\n" "$(eval_gettext 'Execute: $s')"
+ printf "%s\n" "----------------------------------------"
+ printf "%s\n" "$commandline" > "$LOCK_FILE"
export USER="$(whoami)"
eval "$commandline"
- [ -f "$ABORT_FILE" ] && printf "ABORTED!\n"
+ [ -f "$ABORT_FILE" ] && printf "%s\n" "$(gettext 'ABORTED!')" || printf "%s\n" "$(gettext 'ALL DONE!')"
else
- printf "ABORTED!\n"
+ printf "%s\n" "$(gettext 'ABORTED!')"
fi
vdr-opticaldrive stopburn
rm -f "$ABORT_FILE"