From 46d7907920595fb8ae8fb4b637795e99eb1ead1d Mon Sep 17 00:00:00 2001 From: Othmar Gsenger Date: Tue, 18 Jan 2011 20:51:28 +0000 Subject: added download speed in kb (lahme leitung ;() --- groups.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/groups.pl b/groups.pl index 0cceceb..908b2d5 100755 --- a/groups.pl +++ b/groups.pl @@ -21,7 +21,8 @@ sub get_download_speed { my $cli = new local::nzbget; my $status = $cli->send_request('status') or die "Can't connect to nzbget"; - return int($status->{DownloadRate}->value/(1024*1024)).'MB/s'; + my $speed = int($status->{DownloadRate}->value/(1024*1024)); + return $speed?$speed.'MB/s':int($status->{DownloadRate}->value/1024).'KB/s'; } sub get_download_table -- cgit v1.2.3