diff options
| author | Andreas Brachold <vdr07@deltab.de> | 2007-12-01 17:17:53 +0000 |
|---|---|---|
| committer | Andreas Brachold <vdr07@deltab.de> | 2007-12-01 17:17:53 +0000 |
| commit | 470bbc6be3a5ffa1f890aa3c507f6ef489110b73 (patch) | |
| tree | 851ae458f80acf2e1c9871b0c1bde2c8259cd662 /lib | |
| parent | 1acb7bfd3d1ef3d4c45218c2d797341e1f34a816 (diff) | |
| download | xxv-470bbc6be3a5ffa1f890aa3c507f6ef489110b73.tar.gz xxv-470bbc6be3a5ffa1f890aa3c507f6ef489110b73.tar.bz2 | |
* CONFIG: Warn if real modul name missed
* RECORDS: Redirect encode url
* RECORDS: Option 'undefined channel' was'nt showed
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/Tools.pm | 15 | ||||
| -rw-r--r-- | lib/XXV/MODULES/RECORDS.pm | 26 | ||||
| -rw-r--r-- | lib/XXV/OUTPUT/Html.pm | 7 |
3 files changed, 24 insertions, 24 deletions
diff --git a/lib/Tools.pm b/lib/Tools.pm index b8d65f0..155de0a 100644 --- a/lib/Tools.pm +++ b/lib/Tools.pm @@ -21,9 +21,10 @@ our $BENCH = {}; our $LOGCALLB = sub{ }; our $DBH = {}; -@EXPORT = qw(&datum &stackTrace &lg &event &debug &error &panic &rep2str &dumper &getFromSocket &fields - &load_file &save_file &tableUpdated &buildsearch &deleteDir &getip &convert &int &entities &reentities &bench - &fmttime &getDataByTable &getDataById &getDataBySearch &getDataByFields &touch); +@EXPORT = qw(&datum &stackTrace &lg &event &debug &error &panic &rep2str &dumper + &getFromSocket &fields &load_file &save_file &tableUpdated &buildsearch + &deleteDir &getip &convert &int &entities &reentities &bench &fmttime + &getDataByTable &getDataById &getDataBySearch &getDataByFields &touch &url); # ------------------ @@ -607,4 +608,12 @@ sub touch { || error sprintf("Couldn't touch '%s' : %s",$file,$!); } +# ------------------ +sub url{ +# ------------------ + my $s = shift; # string + $s =~ s/([^a-z0-9A-Z])/sprintf('%%%X', ord($1))/seg; + return $s; +} + 1; diff --git a/lib/XXV/MODULES/RECORDS.pm b/lib/XXV/MODULES/RECORDS.pm index f356748..043309f 100644 --- a/lib/XXV/MODULES/RECORDS.pm +++ b/lib/XXV/MODULES/RECORDS.pm @@ -507,7 +507,7 @@ sub readData { } # Update duration at database entry $db_data->{$h}->{duration} = $duration; - $db_data->{$h}->{FileSize} = $obj->_recordingsize($db_data->{$h}->{path}, ($duration * 8 * 25)); + $db_data->{$h}->{FileSize} = $obj->_recordingsize($db_data->{$h}->{path}, ($duration * 8 * $obj->{framerate})); $obj->_updateEvent($db_data->{$h}); $obj->_updateFileSize($db_data->{$h}); @@ -861,18 +861,12 @@ sub videoInfo { #Splitt 2005-01-16.04:35.88.99.rec my ($year, $month, $day, $hour, $minute, $prio, $lifetime) = (basename($path)) =~ /^(\d+)\-(\d+)\-(\d+)\.(\d+)[\:|\.](\d+)\.(\d+)\.(\d+)\.rec/si; -# if($year && $month && $day && $hour && $minute && $year >= 1970 && $year < 2038 ) { -# @{$status->{mtime}} = localtime(timelocal(0,int($minute),int($hour),$day,$month-1,$year-1900)); -# } else { -# my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, -# $atime,$mtime,$ctime,$blksize,$blocks) = stat $file; -# @{$status->{mtime}} = localtime $mtime; -# } + $status->{Prio} = $prio; $status->{Lifetime} = $lifetime; $status->{duration} = $obj->_recordinglength($path); - $status->{FileSize} = $obj->_recordingCapacity(\@files,($status->{duration} * 8 * 25)); + $status->{FileSize} = $obj->_recordingCapacity(\@files,($status->{duration} * 8 * $obj->{framerate})); # Schnittmarken ermitteln my $marks = sprintf("%s/marks.vdr", $path); @@ -1051,7 +1045,7 @@ sub videoPreview { 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}, qquote($outdir), $startseconds / 5, $stepseconds / 5, $scalex, $count, join('" "',@files), qquote($log)), + $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", @@ -1258,7 +1252,7 @@ sub play { my $cmd = sprintf('PLAY %d begin', $rec->{RecordID}); if($obj->{svdrp}->scommand($watcher, $console, $cmd)) { - $console->redirect({url => sprintf('?cmd=rdisplay&data=%s',$rec->{RecordMD5}), wait => 1}) + $console->redirect({url => sprintf('?cmd=rdisplay&data=%s',$rec->{RecordMD5}), wait => 1}) if(ref $console and $console->typ eq 'HTML'); return 1; } @@ -1283,7 +1277,7 @@ sub cut { my $cmd = sprintf('EDIT %d', $rec->{RecordID}); if($obj->{svdrp}->scommand($watcher, $console, $cmd)) { - $console->redirect({url => sprintf('?cmd=rdisplay&data=%s',$rec->{RecordMD5}), wait => 1}) + $console->redirect({url => sprintf('?cmd=rdisplay&data=%s',$rec->{RecordMD5}), wait => 1}) if(ref $console and $console->typ eq 'HTML'); return 1; } @@ -1553,7 +1547,7 @@ sub delete { my @t = split('~', $todelete[0]); if(scalar @t > 1) { # Remove subtitle delete $t[-1]; - $console->redirect({url => sprintf('?cmd=rlist&data=%s',join('~',@t)), wait => 1}); + $console->redirect({url => sprintf('?cmd=rlist&data=%s',url(join('~',@t))), wait => 1}); } else { $console->redirect({url => '?cmd=rlist', wait => 1}); } @@ -1690,7 +1684,7 @@ WHERE def => $mod->ChannelToPos($channel), choices => sub { my $erg = $mod->ChannelArray('Name'); - unshift(@$erg, gettext("Undefined")); + unshift(@$erg, [gettext("Undefined"),undef]); return $erg; }, msg => gettext('Channel'), @@ -1901,7 +1895,7 @@ WHERE } $obj->readData($watcher,$console,$waiter); - $console->redirect({url => sprintf('?cmd=rdisplay&data=%s',md5_hex($rec->{Path})), wait => 1}) + $console->redirect({url => sprintf('?cmd=rdisplay&data=%s',md5_hex($rec->{Path})), wait => 1}) if(ref $console and $console->typ eq 'HTML'); } @@ -2150,7 +2144,7 @@ sub _recordinglength { if(-r $f) { my $bytes = stat($f)->size; - return int(($bytes / 8) / 25); + return int(($bytes / 8) / $obj->{framerate}); } else { error sprintf("Couldn't read : '%s'", $f); } diff --git a/lib/XXV/OUTPUT/Html.pm b/lib/XXV/OUTPUT/Html.pm index e2bce79..c10322c 100644 --- a/lib/XXV/OUTPUT/Html.pm +++ b/lib/XXV/OUTPUT/Html.pm @@ -255,11 +255,8 @@ sub parseTemplateFile { return $s ? '...' : ''; } }, - url => sub{ - my $s = shift; # string - $s = reentities($s); - $s =~ s/([^a-z0-9A-Z])/sprintf('%%%X', ord($1))/seg; - return $s; + url => sub{ + return url(reentities($_[0])); }, # translate string, usage : gettext(foo,truncate) or gettext(foo) |
