summaryrefslogtreecommitdiff
path: root/utils/rhrd-pool
diff options
context:
space:
mode:
Diffstat (limited to 'utils/rhrd-pool')
-rwxr-xr-xutils/rhrd-pool20
1 files changed, 20 insertions, 0 deletions
diff --git a/utils/rhrd-pool b/utils/rhrd-pool
index dc85f94..93e943c 100755
--- a/utils/rhrd-pool
+++ b/utils/rhrd-pool
@@ -64,8 +64,28 @@ sub show
return 1;
}
+ my @slots = RHRD::rddb::get_musicpool_clock_usage($ctx, $shortname);
+ if(!defined $slots[0] && defined $slots[1]) {
+ print STDERR "$slots[1]: $slots[2]";
+ return 1;
+ }
+
print $pool->{'TITLE'} . " (" . $pool->{'SHORTNAME'} . "):\n";
print " group: " . $pool->{'GROUP'} . ", carts: " . $pool->{'LOW_CART'} . "-" . $pool->{'HIGH_CART'} . " (" . scalar(@carts) . " used)\n";
+ print " clock usage:";
+ my $current_dow = -1;
+ my $first = 0;
+ for my $slot (@slots) {
+ if($slot->{'DOW'} != $current_dow) {
+ $current_dow = $slot->{'DOW'};
+ print "\n " . Date::Calc::Day_of_Week_to_Text(($slot->{'DOW'} == 0) ? 7 : $slot->{'DOW'}) . ":\t";
+ $first = 1;
+ }
+ print ", " unless($first);
+ $first = 0;
+ print sprintf("%02d:00", $slot->{'HOUR'})
+ }
+ print "\n";
return 0;
}