From 10e2d89361988bd25a7085a34a874c8bf8ce98b5 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Thu, 19 May 2016 14:56:09 +0200 Subject: add group name to show info diff --git a/lib/RHRD/rddb.pm b/lib/RHRD/rddb.pm index 1286a46..36a4298 100755 --- a/lib/RHRD/rddb.pm +++ b/lib/RHRD/rddb.pm @@ -1298,7 +1298,7 @@ sub get_show_info { my ($ctx, $showid) = @_; - my $sql = qq{select SET_USER_DEFINED from DROPBOXES where STATION_NAME = ? and TO_CART = ?;}; + my $sql = qq{select GROUP_NAME,SET_USER_DEFINED from DROPBOXES where STATION_NAME = ? and TO_CART = ?;}; my $sth = $ctx->{'dbh'}->prepare($sql) or return (undef, 'ERROR', "Database Error: " . $ctx->{'dbh'}->errstr); @@ -1306,7 +1306,7 @@ sub get_show_info $sth->execute($ctx->{'config'}{'dropboxes'}{'dropbox-pseudo-station'}, $showid) or return (undef, 'ERROR', "Database Error: " . $sth->errstr); - my ($params) = $sth->fetchrow_array; + my ($group, $params) = $sth->fetchrow_array; $sth->finish(); my @p = split(';', $params); @@ -1317,6 +1317,7 @@ sub get_show_info my ($title, $log, $status, $errorstring) = get_show_title_and_log($ctx, $showid); return (undef, $status, $errorstring) unless (defined $title && defined $log); + $entry->{'GROUP'} = $group; $entry->{'TITLE'} = $title; $entry->{'LOG'} = $log; $entry->{'RHYTHM'} = $p[1]; diff --git a/utils/rhrd-show b/utils/rhrd-show index 731b627..0c81c72 100755 --- a/utils/rhrd-show +++ b/utils/rhrd-show @@ -65,7 +65,7 @@ sub show } $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"; + print " group: " . $show->{'GROUP'} . ", carts(" . scalar(@carts) . "): " . join(", ", @carts) . " \n"; return 0; } -- cgit v0.10.2