summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndreas Brachold <vdr07@deltab.de>2007-09-17 15:58:23 +0000
committerAndreas Brachold <vdr07@deltab.de>2007-09-17 15:58:23 +0000
commit3a869354f086761b3a647121c07be61dc52b071c (patch)
tree4cd36afdf9c60410ae0ebd7f8cf491e9f3960fb3 /lib
parentcfd92fa45d5b86a70b094cc9df9124faa15386e1 (diff)
downloadxxv-3a869354f086761b3a647121c07be61dc52b071c.tar.gz
xxv-3a869354f086761b3a647121c07be61dc52b071c.tar.bz2
* RECORDS Fix singlequote
* Fix some typos
Diffstat (limited to 'lib')
-rw-r--r--lib/XXV/MODULES/MEDIALIB.pm2
-rw-r--r--lib/XXV/MODULES/MUSIC.pm18
-rw-r--r--lib/XXV/MODULES/RECORDS.pm66
3 files changed, 49 insertions, 37 deletions
diff --git a/lib/XXV/MODULES/MEDIALIB.pm b/lib/XXV/MODULES/MEDIALIB.pm
index cac031e..b0f78f6 100644
--- a/lib/XXV/MODULES/MEDIALIB.pm
+++ b/lib/XXV/MODULES/MEDIALIB.pm
@@ -295,7 +295,7 @@ FROM
my $erg = $obj->{dbh}->selectrow_arrayref($sql);
return {
- message => sprintf(gettext('Media Library has stored %d medias'), $erg->[0]),
+ message => sprintf(gettext('Media library has stored %d medias'), $erg->[0]),
};
}
diff --git a/lib/XXV/MODULES/MUSIC.pm b/lib/XXV/MODULES/MUSIC.pm
index ea6ebe6..ea66421 100644
--- a/lib/XXV/MODULES/MUSIC.pm
+++ b/lib/XXV/MODULES/MUSIC.pm
@@ -59,24 +59,24 @@ sub module {
required => gettext('This is required!'),
},
proxy => {
- description => gettext('Proxy URL to music server. e.g. (http://vdr/xxv) Please remember you must write the Port to icecast server in your Proxy Konfiguration!'),
+ description => gettext('Proxy URL to music server. e.g. (http://vdr/xxv) Please remember you must write the port to icecast server in your proxy configuration!'),
default => '',
type => 'string',
},
clients => {
- description => gettext('Maximum Clients to connect at the same time.'),
+ description => gettext('Maximum clients to connect at the same time'),
default => 5,
type => 'integer',
required => gettext('This is required!'),
},
coverimages => {
- description => gettext('common directory for cover images'),
+ description => gettext('Common directory for cover images'),
default => '/var/cache/xxv/cover',
type => 'dir',
required => gettext('This is required!'),
},
muggle => {
- description => gettext('DSN for muggle Database'),
+ description => gettext('DSN for muggle database'),
default => 'DBI:mysql:database=GiantDisc;host=localhost;port=3306',
type => 'string',
check => sub{
@@ -107,25 +107,25 @@ sub module {
DenyClass => 'mlist',
},
mplay => {
- description => gettext("play music file 'fid'"),
+ description => gettext("Play music file 'fid'"),
short => 'mp',
callback => sub{ $obj->play(@_) },
DenyClass => 'stream',
},
mplaylist => {
- description => gettext("get a m3u playlist for 'fid'"),
+ description => gettext("Get a m3u playlist for 'fid'"),
short => 'm3',
callback => sub{ $obj->playlist(@_) },
DenyClass => 'stream',
},
mlist => {
- description => gettext("list music 'dir'"),
+ description => gettext("Shows music 'dir'"),
short => 'ml',
callback => sub{ $obj->list(@_) },
DenyClass => 'mlist',
},
msearch => {
- description => gettext("search music 'txt'"),
+ description => gettext("Search music 'txt'"),
short => 'mf',
callback => sub{ $obj->search(@_) },
DenyClass => 'mlist',
@@ -511,7 +511,7 @@ sub search {
my $obj = shift || return error('No object defined!');
my $watcher = shift || return error('No watcher defined!');
my $console = shift || return error('No console defined!');
- my $text = shift || return $console->err(gettext("No Text to search! Please use msearch 'text'"));
+ my $text = shift || return $console->err(gettext("No text to search! Please use msearch 'text'"));
return $obj->list($watcher,$console,"search:".$text);
}
diff --git a/lib/XXV/MODULES/RECORDS.pm b/lib/XXV/MODULES/RECORDS.pm
index b92fe88..5352849 100644
--- a/lib/XXV/MODULES/RECORDS.pm
+++ b/lib/XXV/MODULES/RECORDS.pm
@@ -83,7 +83,7 @@ sub module {
type => 'confirm',
},
previewimages => {
- description => gettext('common directory for preview images'),
+ description => gettext('Common directory for preview images'),
default => '/var/cache/xxv/preview',
type => 'dir',
required => gettext('This is required!'),
@@ -191,7 +191,7 @@ sub module {
my $epg = main::getModule('EPG')->getId($record->{eventid}, 'title, subtitle, description');
- my $title = sprintf(gettext("Record deleted: %s"), $epg->{title});
+ my $title = sprintf(gettext("Recording deleted: %s"), $epg->{title});
my $description = "";
$description .= sprintf(gettext("Subtitle: %s\n"),
$epg->{subtitle}) if($epg->{subtitle});
@@ -412,7 +412,7 @@ sub readData {
($total, $totalUnit, $free, $freeUnit, $percent)
= $stat->[1] =~ /^250[\-|\s](\d+)(\S+)\s+(\d+)(\S+)\s+(\S+)/s;
- $obj->{CapacityMessage} = sprintf(gettext("Used %s, Total %s%s, Free %s%s"),$percent, dot1000($total), $totalUnit, dot1000($free), $freeUnit);
+ $obj->{CapacityMessage} = sprintf(gettext("Used %s, total %s%s, free %s%s"),$percent, dot1000($total), $totalUnit, dot1000($free), $freeUnit);
$obj->{CapacityPercent} = int($percent);
} else {
@@ -573,9 +573,7 @@ sub readData {
while(scalar @jobs > 0) {
my $command = shift (@jobs);
- lg sprintf('Call cmd "%s" now',
- $command,
- );
+ lg sprintf('Call command "%s"', $command );
my $erg = system("nice -n 19 $command");
}
exit 0;
@@ -899,6 +897,17 @@ sub videoInfo {
return $status;
}
+sub qquote {
+ my $str = shift;
+ $str =~ s/(\')/\'\\\'\'/g;
+
+# $metas = '!$`' unless($metas);
+# $metas =~ s/\]/\\]/g;
+# $str =~ s/([$metas])/\\$1/g;
+
+ return "'$str'";
+}
+
# ------------------
sub videoPreview {
# ------------------
@@ -1000,19 +1009,17 @@ sub videoPreview {
}
} else {
@files = glob("$vdir/[0-9][0-9][0-9].vdr");
- foreach (@files) { s/(\")/\\$1/g; }
+ foreach (@files) { $_ = qquote($_); }
}
- $vdir =~ s/(\')/\\$1/g;
-
my $scalex = 180;
my $mversions = {
- 'MPlayer1.0pre5' => sprintf("%s -noautosub -noconsolecontrols -nosound -nolirc -nojoystick -quiet -vo jpeg -jpeg outdir=\'%s\' -ni -ss %d -sstep %d -vf scale -zoom -xy %d -frames %d \'%s\' >> \'%s\' 2>&1",
- $obj->{previewbinary}, $outdir, $startseconds / 5, $stepseconds / 5, $scalex, $count, join("\' \'",@files), $log),
- 'MPlayer1.0pre6' => sprintf("%s -noautosub -noconsolecontrols -nosound -nolirc -nojoystick -quiet -vo jpeg:outdir=\'%s\' -ni -ss %d -sstep %d -vf scale -zoom -xy %d -frames %d \'%s\' >> \'%s\' 2>&1",
- $obj->{previewbinary}, $outdir, $startseconds / 5, $stepseconds / 5, $scalex, $count, join("\' \'",@files), $log),
- 'vdr2jpeg' => sprintf("%s -r \'%s\' -f %s -x %d -o \'%s\' >> \'%s\' 2>&1",
- $obj->{previewbinary}, $vdir, join(" -f ", @frames), $scalex, $outdir, $log),
+ 'MPlayer1.0pre5' => sprintf("%s -noautosub -noconsolecontrols -nosound -nolirc -nojoystick -quiet -vo jpeg -jpeg outdir=%s -ni -ss %d -sstep %d -vf scale -zoom -xy %d -frames %d %s >> %s 2>&1",
+ $obj->{previewbinary}, qquote($outdir), $startseconds / 5, $stepseconds / 5, $scalex, $count, join('" "',@files), qquote($log)),
+ 'MPlayer1.0pre6' => sprintf("%s -noautosub -noconsolecontrols -nosound -nolirc -nojoystick -quiet -vo jpeg:outdir=%s -ni -ss %d -sstep %d -vf scale -zoom -xy %d -frames %d %s >> %s 2>&1",
+ $obj->{previewbinary}, qquote($outdir), $startseconds / 5, $stepseconds / 5, $scalex, $count, join(' ',@files), qquote($log)),
+ 'vdr2jpeg' => sprintf("%s -r %s -f %s -x %d -o %s >> %s 2>&1",
+ $obj->{previewbinary}, qquote($vdir), join(' -f ', @frames), $scalex, qquote($outdir), qquote($log)),
};
return $mversions->{$obj->{previewcommand}};
}
@@ -1104,10 +1111,7 @@ sub createOldEventId {
$attr->{eventid} = $obj->{dbh}->selectrow_arrayref('SELECT SQL_CACHE max(eventid)+1 from OLDEPG')->[0];
$attr->{eventid} = 1000000000 if(not defined $attr->{eventid} or $attr->{eventid} < 1000000000 );
- lg sprintf('Create event "%s" - "%s" into OLDEPG',
- $title,
- $subtitle ? $subtitle : '',
- );
+ lg sprintf('Create event "%s" into OLDEPG', $subtitle ? $title .'~'. $subtitle : $title);
my $sth = $obj->{dbh}->prepare('REPLACE INTO OLDEPG(eventid, title, subtitle, description, channel_id, duration, tableid, starttime, video, audio, addtime) VALUES (?,?,?,?,?,?,?,FROM_UNIXTIME(?),?,?,FROM_UNIXTIME(?))');
$sth->execute(
@@ -1872,19 +1876,27 @@ sub conv {
my $cmd = (split(':', $obj->{reccmds}->[$cmdid-1]))[-1] || return $console->err(gettext("Couldn't find this command ID!"));
my $path = $obj->IdToPath($recid) || return $console->err(sprintf(gettext("Recording '%s' does not exist in the database!"),$recid));
- debug sprintf('Call command "%s" on recording "%s"%s',
- $cmd,
- $path,
+ my $command = sprintf("%s %s",$cmd,qquote($path));
+ debug sprintf('Call command %s%s',
+ $command,
( $console->{USER} && $console->{USER}->{Name} ? sprintf(' from user: %s', $console->{USER}->{Name}) : "" )
);
- my $call = "$cmd \"$path\"";
- my $output = `$call`;
- if( $? >> 8 > 0) {
- $console->message(sprintf(gettext("Sorry! Call %s %s with error output: %s"), $cmd, $path, $output));
+ my $output;
+ if(open P, $command .' |') { # Kommando ausführen und stdout einlesen
+ @$output = <P>;
+ close P;
+ if( $? >> 8 > 0) {
+ unshift(@$output,sprintf(gettext("Call %s '%s', standard error output :"), $cmd, $path));
+ $console->message($output);
+ } else {
+ unshift(@$output,sprintf(gettext("Call %s '%s', standard output :"), $cmd, $path));
+ $console->message($output);
+ }
} else {
- $console->message(sprintf(gettext("Call %s %s with output: %s"), $cmd, $path, $output));
+ $console->err(sprintf(gettext("Sorry! Couldn't call %s '%s'! %s"), $cmd, $path, $!));
}
+
$console->link({
text => gettext("Back to recording list"),
url => "?cmd=rlist",