From: Andrew Ruthven Date: Tue, 11 Dec 2007 18:19:24 +0000 (+1300) Subject: By default only show storage groups that are over the warning threshold. X-Git-Tag: 0.6.0~7 X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5c939c4231f8c8af850234b1c4b55b64c2709ca1;p=mythtv-status.git By default only show storage groups that are over the warning threshold. --- diff --git a/bin/mythtv-status b/bin/mythtv-status index b94c17e..db72a53 100755 --- a/bin/mythtv-status +++ b/bin/mythtv-status @@ -256,7 +256,12 @@ my @blocks = ( 'commify' => [ qw/total used/ ], 'template' => "Total space for group __id__ is __total__ GB, with __used__ GB used (__percent__)", 'filter' => { - 'id' => sub { return $_[0] eq 'total' } + 'id' => sub { return $_[0] eq 'total' }, + 'used' => sub { + return ! ( + (defined $display{'Disk Space'} && $display{'Disk Space'}) + || ($_[1]->{'used'} / $_[1]->{'total'}) * 100 > $disk_space_warn) + } }, 'subs' => { 'percent' => sub { @@ -591,7 +596,7 @@ sub substitute_vars { $skip = 1 if defined $block->{'filter'}{$key} && - &{ $block->{'filter'}{$key} }($value); + &{ $block->{'filter'}{$key} }($value, $vars); if (defined $block->{'rewrite'}{"/$key/"}) { my ($search, $replace); @@ -779,7 +784,9 @@ the next recording is displayed. =item Disk Space -Details about each storage group that MythTV knows about. +Details about each storage group that MythTV knows about. By default this +only shows storage groups that are above the warning level. Use +B<--disk-space> to turn on display of all storage groups. =back diff --git a/testing/xml/multiple-storage-groups.pucks-patches.one-warn.xml b/testing/xml/multiple-storage-groups.pucks-patches.one-warn.xml new file mode 100644 index 0000000..e3f8a8d --- /dev/null +++ b/testing/xml/multiple-storage-groups.pucks-patches.one-warn.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + +