From e9c78e4454837aaddb13e108335efafd247bf905 Mon Sep 17 00:00:00 2001 From: Andreas Brachold Date: Mon, 5 Nov 2007 19:22:34 +0000 Subject: * RECORDS: Fix calc free capacity if none recording present --- lib/XXV/MODULES/RECORDS.pm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lib') 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}}) { -- cgit v1.2.3