diff options
author | Christian Pointner <equinox@helsinki.at> | 2016-07-31 12:43:47 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2016-07-31 12:43:47 (GMT) |
commit | af294a1f65fd66f0a0ecf59e199785703d1b947e (patch) | |
tree | 50014968aca2abafee7987e18eb694a23d554094 /utils | |
parent | 1283d78ec24c3b4e084409610e4711015044ce58 (diff) |
print clock usage for musicpool
Diffstat (limited to 'utils')
-rwxr-xr-x | utils/rhrd-pool | 20 |
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; } |