diff options
Diffstat (limited to 'utils/rhrd-show')
-rwxr-xr-x | utils/rhrd-show | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/utils/rhrd-show b/utils/rhrd-show index 7cb8422..f2a6aed 100755 --- a/utils/rhrd-show +++ b/utils/rhrd-show @@ -181,14 +181,30 @@ sub remove { my ($ctx, $show_id) = @_; + my ($group, $status, $errorstring) = RHRD::rddb::get_show_group($ctx, $show_id); + unless(defined $group) { + print STDERR $status . ": " . $errorstring . "\n"; + return 1; + } + my @results = RHRD::rddb::remove_show($ctx, $show_id); if(!defined $results[0] && defined $results[2]) { - print STDERR "$results[2]\n"; + print STDERR $results[1] . ": " . $results[2] . "\n"; return 1; } for my $href (@results) { print int($href->{cnt}) . " " . $href->{name} . " deleted\n"; } + + my @carts = RHRD::rddb::get_show_group_carts_used($ctx, $group); + if(!defined $carts[0] && defined $carts[1]) { + print STDERR $carts[1] . ": " . $carts[2] . "\n"; + return 1; + } + if(scalar @carts == 0) { + print "group '" . $group . "' is now empty .. you should probably remove it!\n"; + } + return 0; } |