summaryrefslogtreecommitdiff
path: root/utils/rhrd-show
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2016-04-29 12:20:16 (GMT)
committerChristian Pointner <equinox@helsinki.at>2016-04-29 12:26:46 (GMT)
commitac81019e73049c079d3b9ea8c4187a04bc1833f4 (patch)
tree7fce5730e1660e77044fe0c2437062271cfc65aa /utils/rhrd-show
parentfbe0303d3cc74f355beb49fcd6ac6d2cebe3851f (diff)
improved show info output
moved command line parsing of week and dow to lib
Diffstat (limited to 'utils/rhrd-show')
-rwxr-xr-xutils/rhrd-show15
1 files changed, 8 insertions, 7 deletions
diff --git a/utils/rhrd-show b/utils/rhrd-show
index a25ceff..3cac649 100755
--- a/utils/rhrd-show
+++ b/utils/rhrd-show
@@ -23,6 +23,7 @@
use strict;
use RHRD::rddb;
use RHRD::utils;
+use Date::Calc;
sub print_usage
{
@@ -55,15 +56,14 @@ sub show
print STDERR "$carts[1]: $carts[2]\n";
return 1;
}
- my ($title, undef, $status, $errorstring) = RHRD::rddb::get_show_title_and_log($ctx, $show_id);
- unless (defined $title) {
+ my ($show, $status, $errorstring) = RHRD::rddb::get_show_info($ctx, $show_id);
+ unless (defined $show) {
print STDERR "$errorstring\n";
return 1;
}
- print $title . ":\n";
- for my $cart (@carts) {
- print " > " . $cart . "\n";
- }
+ $show->{'DOW'} = 7 if $show->{'DOW'} == 0;
+ print $show->{'TITLE'} . ": " . join(", ", $show->{'RHYTHM'}, Date::Calc::Day_of_Week_to_Text($show->{'DOW'}), $show->{'STARTTIME'}, ($show->{'LEN'} . " min")) . "\n";
+ print " carts(" . scalar(@carts) . "): " . join(", ", @carts) . " \n";
return 0;
}
@@ -96,7 +96,7 @@ sub add__check_arguments
return 1;
}
- ($result, $err, $hint) = RHRD::utils::dropbox_param_dow_ok($dow);
+ ($result, $err, $hint) = RHRD::utils::cmdline_dow($dow);
unless($result) {
print STDERR $err . "\n " . $hint . "\n";
return 1;
@@ -125,6 +125,7 @@ sub add
if($ret) {
return $ret;
}
+ ($dow, undef, undef) = RHRD::utils::cmdline_dow($dow);
print " * creating show: " . $title . " (" . $name . ") for group '" . $groupname . "'\n";