From f1b2e909b26c841041d9404eff3c3dff3ebde007 Mon Sep 17 00:00:00 2001 From: Andreas Brachold Date: Tue, 14 Apr 2009 19:20:35 +0000 Subject: * etc/xxvd.cfg.example remove outdated statments * RECORDS: Fix a illegal division by zero if video directory is missed --- etc/xxvd.cfg.example | 3 --- lib/XXV/MODULES/RECORDS.pm | 6 +++++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/etc/xxvd.cfg.example b/etc/xxvd.cfg.example index ad1f8d5..b5a9156 100644 --- a/etc/xxvd.cfg.example +++ b/etc/xxvd.cfg.example @@ -97,7 +97,6 @@ previewcount=5 previewimages=/var/cache/xxv/preview previewlistthumbs=n vfat=y -videodir=/video [REMOTE] active=y @@ -126,8 +125,6 @@ host=192.168.0.23 netvideo=\\192.168.0.23\video [SVDRP] -VdrHost=localhost -VdrPort=2001 timeout=60 [TELNET] diff --git a/lib/XXV/MODULES/RECORDS.pm b/lib/XXV/MODULES/RECORDS.pm index 85f292c..8186a3d 100644 --- a/lib/XXV/MODULES/RECORDS.pm +++ b/lib/XXV/MODULES/RECORDS.pm @@ -918,7 +918,11 @@ sub _readData { } else { $self->{CapacityFree} = int($totalFree * 3600 / 2000); # use 2GB at one hour as base } - $self->{CapacityPercent} = ($totalSpace * 100 / ($totalFree + $totalSpace)); + if(($totalFree + $totalSpace) > 1) { + $self->{CapacityPercent} = ($totalSpace * 100 / ($totalFree + $totalSpace)); + } else { + $self->{CapacityPercent} = 0; + } -- cgit v1.2.3