#
my @size_thresholds = (
{
- 'unit' => 'TB',
- 'threshold' => 1024 * 1024,
+ 'unit' => 'TB',
+ 'threshold' => 1024 * 1024,
'conversion' => 1024 * 1024,
- 'make_integer' => 1,
+ 'make_integer' => 1,
'make_integer_threshold' => 500,
},
{
- 'unit' => 'GB',
- 'threshold' => 50 * 1024, # 50GB seems like a good threshold.
+ 'unit' => 'GB',
+ 'threshold' => 50 * 1024, # 50GB seems like a good threshold.
'conversion' => 1024,
- 'make_integer' => 1,
+ 'make_integer' => 1,
'make_integer_threshold' => 500,
},
{
return $_[0];
} elsif ($_[0] =~ /^([.0-9]+) (\w+)$/) {
my $space = $1;
- my $unit = $2;
-
- if ($unit eq 'B') {
- return $space / (1024 * 1024);
- } elsif ($unit eq 'KB') {
- return $space / 1024;
- } elsif ($unit eq 'MB') {
- return $space;
- } elsif ($unit eq 'GB') {
- return $space * 1024;
- } elsif ($unit eq 'TB') {
- return $space * 1024 * 1024;
- }
+ my $unit = $2;
+
+ if ($unit eq 'B') { return $space / (1024 * 1024) }
+ elsif ($unit eq 'KB') { return $space / 1024 }
+ elsif ($unit eq 'MB') { return $space }
+ elsif ($unit eq 'GB') { return $space * 1024 }
+ elsif ($unit eq 'TB') { return $space * 1024 * 1024 }
warn "Unknown unit for disk space: $unit. Please let the author of mythtv-status know.\n";
return $space;