From a70d34983668a913854fd91d6a5a23a13051c92b Mon Sep 17 00:00:00 2001 From: Andrew Ruthven Date: Sat, 8 Dec 2007 18:30:23 +1300 Subject: [PATCH] Add support for my modified version of the XML for storage groups. In trac at: - http://svn.mythtv.org/trac/ticket/4278 --- bin/mythtv-status | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/bin/mythtv-status b/bin/mythtv-status index 1776553..df3cff7 100755 --- a/bin/mythtv-status +++ b/bin/mythtv-status @@ -226,6 +226,24 @@ my @blocks = ( } }, + # Diskspace, with storage groups and sensible XML layour. + { + 'name' => 'Total Disk Space', + 'type' => 'xpath', + 'xpath' => '//Status/MachineInfo/Storage/Group[@id="total"]', + 'protocol_version' => [ ">= 36" ], + 'xml_version' => [ "> 0" ], + 'attrs' => [ qw/total used/ ], + 'commify' => [ qw/total used/ ], + 'template' => "Total space is __total__ GB, with __used__ GB used (__percent__)", + 'format' => 'one line', + 'subs' => { + 'percent' => sub { + calc_disk_space_percentage($_[0]->{'used'}, $_[0]->{'total'}) + } + } + }, + # How many hours till the next recording. { 'name' => 'Next Recording In', @@ -454,7 +472,7 @@ sub process_xml { return unless defined $result && $result ne ''; - warn "We have the correct version of the XML protocol\n" + warn "We have the correct $vers version for $block->{'name'}\n" if $verbose; } } -- 2.30.2