diff options
| author | Andreas Brachold <vdr07@deltab.de> | 2007-11-09 15:18:21 +0000 |
|---|---|---|
| committer | Andreas Brachold <vdr07@deltab.de> | 2007-11-09 15:18:21 +0000 |
| commit | aa99123685e85b53583a491febe269c9dceb8222 (patch) | |
| tree | d94900136de0a3a4139dc83832e35b2ad0158c46 /lib | |
| parent | c66187b33b7cbbd88697167a583154372705e119 (diff) | |
| download | xxv-aa99123685e85b53583a491febe269c9dceb8222.tar.gz xxv-aa99123685e85b53583a491febe269c9dceb8222.tar.bz2 | |
* RECORDS: fix div zero, if none recording present
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/XXV/MODULES/RECORDS.pm | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/XXV/MODULES/RECORDS.pm b/lib/XXV/MODULES/RECORDS.pm index 7ff3801..9b46053 100644 --- a/lib/XXV/MODULES/RECORDS.pm +++ b/lib/XXV/MODULES/RECORDS.pm @@ -564,7 +564,11 @@ sub readData { error sprintf("Unsupported unit '%s' to calc free capacity",$freeUnit) unless($freeUnit eq 'MB'); # use store capacity and recordings length to calc free capacity $obj->{CapacityTotal} = $totalDuration; - $obj->{CapacityFree} = ($free * $totalDuration) / $totalSpace; + if($totalSpace > 1) { + $obj->{CapacityFree} = ($free * $totalDuration) / $totalSpace; + } else { + $obj->{CapacityFree} = $free * 3600 / 2000; # use 2GB at one hour as base + } $obj->{CapacityPercent} = ($totalSpace * 100 / ($free + $totalSpace)) unless($obj->{CapacityPercent}); |
