diff options
Diffstat (limited to 'lib/RHRD/rddb.pm')
-rwxr-xr-x | lib/RHRD/rddb.pm | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/lib/RHRD/rddb.pm b/lib/RHRD/rddb.pm index 586ae17..68d8aaa 100755 --- a/lib/RHRD/rddb.pm +++ b/lib/RHRD/rddb.pm @@ -1411,9 +1411,10 @@ sub get_show_info my ($group, $params) = $sth->fetchrow_array; $sth->finish(); + return (undef, 'ERROR', "show with id $showid does not exist") unless (defined $params); my @p = split(';', $params); - return (undef, 'ERROR', "show with $showid does not exist") unless ('S' eq $p[0]); + return (undef, 'ERROR', "show with id $showid does not exist") unless ('S' eq $p[0]); my $entry = {}; $entry->{'ID'} = $showid; @@ -1783,6 +1784,34 @@ sub list_musicpools return @pool_dbs; } +sub get_musicpool_info +{ + my ($ctx, $shortname) = @_; + + my $sql = qq{select DROPBOXES.GROUP_NAME,GROUPS.DESCRIPTION,GROUPS.DEFAULT_LOW_CART,GROUPS.DEFAULT_HIGH_CART,DROPBOXES.SET_USER_DEFINED from DROPBOXES,GROUPS where DROPBOXES.GROUP_NAME = GROUPS.NAME and DROPBOXES.STATION_NAME = ? and DROPBOXES.PATH = ? order by DROPBOXES.PATH;}; + + my $sth = $ctx->{'dbh'}->prepare($sql) + or return (undef, 'ERROR', "Database Error: " . $ctx->{'dbh'}->errstr); + + $sth->execute($ctx->{'config'}{'dropboxes'}{'dropbox-pseudo-station'}, $shortname) + or return (undef, 'ERROR', "Database Error: " . $sth->errstr); + + my ($group, $title, $low_cart, $high_cart, $params) = $sth->fetchrow_array(); + $sth->finish(); + return (undef, 'ERROR', "pool $shortname does not exist") unless (defined $params); + + my @p = split(';', $params); + return (undef, 'ERROR', "pool $shortname does not exist") unless ('M' eq $p[0]); + + my $entry = {}; + $entry->{'SHORTNAME'} = $shortname; + $entry->{'GROUP'} = $group; + $entry->{'TITLE'} = $title; + $entry->{'LOW_CART'} = $low_cart; + $entry->{'HIGH_CART'} = $high_cart; + + return ($entry, 'OK', 'success'); +} sub is_musicpools_user { |