diff options
| author | Andreas Brachold <vdr07@deltab.de> | 2007-11-05 19:22:34 +0000 |
|---|---|---|
| committer | Andreas Brachold <vdr07@deltab.de> | 2007-11-05 19:22:34 +0000 |
| commit | e9c78e4454837aaddb13e108335efafd247bf905 (patch) | |
| tree | b789f19faa5691bd0c3eb64aa5c87aa9ab781db3 /lib | |
| parent | 0a0d50f174caf486dbb416ca87c4daabec48f594 (diff) | |
| download | xxv-e9c78e4454837aaddb13e108335efafd247bf905.tar.gz xxv-e9c78e4454837aaddb13e108335efafd247bf905.tar.bz2 | |
* RECORDS: Fix calc free capacity if none recording present
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/XXV/MODULES/RECORDS.pm | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/XXV/MODULES/RECORDS.pm b/lib/XXV/MODULES/RECORDS.pm index 668f540..3a35565 100644 --- a/lib/XXV/MODULES/RECORDS.pm +++ b/lib/XXV/MODULES/RECORDS.pm @@ -558,8 +558,13 @@ sub readData { $obj->{CapacityTotal} = $totalDuration; $obj->{CapacityPercent} = (100.0 / $total) * ($total - $free) if($total && $totalUnit eq $freeUnit); - $obj->{CapacityFree} = ($totalDuration * 100.0 / $obj->{CapacityPercent}) - - $obj->{CapacityTotal}; + + # use store capacity and recordings length to calc free capacity + if($totalDuration > 3600) { + $obj->{CapacityFree} = ($totalDuration * 100.0 / $obj->{CapacityPercent}) - $totalDuration; + } else { + $obj->{CapacityFree} = $free * 3600 / 2000; # use 2GB at one hour + } # Previews im fork erzeugen if(scalar @{$obj->{JOBS}}) { |
