summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndreas Brachold <vdr07@deltab.de>2008-10-06 09:00:44 +0000
committerAndreas Brachold <vdr07@deltab.de>2008-10-06 09:00:44 +0000
commit0d66c4b5d972e6e439bec0a3028c8de70e137db8 (patch)
treea2ce6741ac448a310e1021675a481d7f55de796e /lib
parent2b6688ca3d2e21c7339e39a98109b3e2cebc75ee (diff)
downloadxxv-0d66c4b5d972e6e439bec0a3028c8de70e137db8.tar.gz
xxv-0d66c4b5d972e6e439bec0a3028c8de70e137db8.tar.bz2
* TIMER/tlist: display used recorder
* CONFIG: Remove double reconfigure * CONFIG: Remove unusable command write configuation * Base: remove command restart
Diffstat (limited to 'lib')
-rw-r--r--lib/XXV/MODULES/CONFIG.pm53
-rw-r--r--lib/XXV/MODULES/EVENTS.pm3
-rw-r--r--lib/XXV/MODULES/TIMERS.pm15
-rw-r--r--lib/XXV/OUTPUT/NEWS/MAIL.pm4
4 files changed, 32 insertions, 43 deletions
diff --git a/lib/XXV/MODULES/CONFIG.pm b/lib/XXV/MODULES/CONFIG.pm
index ff9de48..b1277b6 100644
--- a/lib/XXV/MODULES/CONFIG.pm
+++ b/lib/XXV/MODULES/CONFIG.pm
@@ -26,24 +26,12 @@ sub module {
callback => sub{ $obj->edit(@_) },
Level => 'admin',
},
- configwrite => {
- description => gettext('Saves the configuration.'),
- short => 'cw',
- callback => sub{ $obj->write(@_) },
- Level => 'admin',
- },
configget => {
description => gettext("Get configuration from 'modname'"),
short => 'cg',
callback => sub{ $obj->get(@_) },
Level => 'admin',
},
- reconfigure => {
- description => gettext('Edit all processes'),
- short => 'cr',
- callback => sub{ $obj->reconfigure(@_) },
- Level => 'admin',
- },
help => {
description => gettext("This will display all commands or description of module 'name'."),
short => 'h',
@@ -133,14 +121,6 @@ sub menu {
link => "?cmd=configedit&data=$name",
};
}
- $ret->{links}->{'reconfigure'} = {
- text => gettext("Save configuration"),
- link => "?cmd=reconfigure",
- };
- $ret->{links}->{'write'} = {
- text => gettext("Saves the configuration."),
- link => "?cmd=configwrite",
- };
return $console->littlemenu($ret);
}
@@ -194,12 +174,12 @@ sub edit {
if(ref $cfg eq 'HASH') {
$obj->{config}->{$sector} = $cfg;
- $obj->reconfigure();
- $obj->write();
-
con_msg($console, sprintf(gettext("Section: '%s' saving ... please wait."), $sector));
- $console->redirect({url => sprintf('?cmd=configedit&amp;data=%s',$sector), wait => 1})
- if($console->typ eq 'HTML');
+ my $success = $obj->write($watcher, $console);
+
+ $console->redirect({url => '?cmd=configedit', wait => 1})
+ if($success eq 'ok'
+ && $console->typ eq 'HTML');
}
}
@@ -210,15 +190,16 @@ sub write {
my $watcher = shift;
my $console = shift;
- $obj->reconfigure($watcher, $console);
+ my $success = $obj->reconfigure($watcher, $console);
my $configfile = main::getUsrConfigFile;
- $obj->{config}->write( $configfile )
- or return con_err($console, sprintf ("Couldn't write '%s': %s", $configfile , $! ));
+ if($success eq 'ok'
+ && !$obj->{config}->write( $configfile )) {
+ con_err($console, sprintf ("Couldn't write '%s': %s", $configfile , $! ));
+ return 'failed';
+ }
con_msg($console, sprintf(gettext("Configuration written to '%s'."), $configfile));
-
- $console->redirect({url => '?cmd=configedit', wait => 2})
- if(ref $console and $console->typ eq 'HTML');
+ return $success;
}
# ------------------
@@ -253,6 +234,8 @@ sub reconfigure {
my $watcher = shift;
my $console = shift;
+ my $success = 'ok';
+
my $cfg = $obj->{config};
foreach my $moduleName (keys %$cfg) {
if($moduleName eq 'General') {
@@ -273,20 +256,22 @@ sub reconfigure {
unless($ok || not $err) {
my $message = sprintf("Config -> %s -> %s: %s %s", $moduleName, $parameter, $mod->{$parameter}, $err);
con_err($console, $message);
+ $success = 'failed';
}
}
}
} else {
con_err($console, sprintf(gettext("Couldn't find %s in %s!"), $parameter, $moduleName));
+ $success = 'failed';
}
}
}
}
- $obj->menu( $watcher, $console )
- if(ref $console and $console->{TYP} eq 'HTML');
- con_msg($console, gettext('Edit successful!'));
+ con_msg($console, gettext('Edit successful!'))
+ if($success eq 'ok');
+ return $success;
}
# ------------------
diff --git a/lib/XXV/MODULES/EVENTS.pm b/lib/XXV/MODULES/EVENTS.pm
index b848d5b..77ffbc4 100644
--- a/lib/XXV/MODULES/EVENTS.pm
+++ b/lib/XXV/MODULES/EVENTS.pm
@@ -172,10 +172,9 @@ sub _init {
$self->callEvent(@_);
};
- my $start = main::getStartTime;
$self->news(
sprintf(gettext('XXVD System %s started'), main::getVersion),
- sprintf(gettext('Start time: %s'), datum($start)),
+ sprintf(gettext('Start time: %s'), datum()),
undef,
undef,
'harmless'
diff --git a/lib/XXV/MODULES/TIMERS.pm b/lib/XXV/MODULES/TIMERS.pm
index 9a0cfec..f99a741 100644
--- a/lib/XXV/MODULES/TIMERS.pm
+++ b/lib/XXV/MODULES/TIMERS.pm
@@ -1026,7 +1026,7 @@ sub _insert {
q|REPLACE INTO TIMERS VALUES
(?,?,?,?,?,?,?,?,?,?,?,?,FROM_UNIXTIME(?), FROM_UNIXTIME(?),0,?,?,?,?,0,NOW())
|);
- my $id = md5_hex($timer->{vid} . $timer->{channel} . $nexttime->{start} . $nexttime->{stop} );
+ my $id = md5_hex($timer->{vid} . $timer->{channel} . $nexttime->{start} . $nexttime->{stop} . $timer->{file} );
$sth->execute(
$id,
$timer->{vid},
@@ -1213,7 +1213,6 @@ sub _list {
my $search = shift || '';
my $term = shift;
my $params = shift;
- my $table = shift || '';
my %f = (
'id' => gettext('Service'),
@@ -1245,15 +1244,17 @@ SELECT SQL_CACHE
FROM EPG as e
WHERE t.eventid = e.eventid
LIMIT 1) as __description,
- NOW() between starttime and stoptime AND (flags & 1) as __running
+ NOW() between starttime and stoptime AND (flags & 1) as __running,
+ r.host as __host
FROM
TIMERS as t,
- CHANNELS as c
- $table
+ CHANNELS as c,
+ RECORDER as r
WHERE
t.stoptime > NOW()
AND t.channel = c.id
AND t.vid = c.vid
+ AND t.vid = r.id
$search
ORDER BY
t.starttime
@@ -1307,9 +1308,13 @@ ORDER BY
unshift(@$erg, $fields);
}
+ # More then one host defined
+ my $hostlist = $self->{svdrp}->list_hosts();
+
$console->setCall('tlist');
$console->table($erg, {
capacity => main::getModule('RECORDS')->{CapacityFree},
+ recorder => scalar @$hostlist,
keywords => $keywords,
keywordsmax => $keywordmax,
keywordsmin => $keywordmin,
diff --git a/lib/XXV/OUTPUT/NEWS/MAIL.pm b/lib/XXV/OUTPUT/NEWS/MAIL.pm
index 60ae109..7b5be0b 100644
--- a/lib/XXV/OUTPUT/NEWS/MAIL.pm
+++ b/lib/XXV/OUTPUT/NEWS/MAIL.pm
@@ -198,7 +198,7 @@ sub init {
my $self = shift || return error('No object defined!');
$self->{INITE} = 1;
- $self->{LastReportTime} = main::getStartTime();
+ $self->{LastReportTime} = time;
# Interval to send the next mail
$self->{TIMER} = Event->timer(
@@ -262,7 +262,7 @@ sub parseHeader {
my $vars = {
msgnr => $self->{COUNT},
- date => datum(time),
+ date => datum(),
anzahl=> $newscnt,
};