diff options
Diffstat (limited to 'lib/RHRD/rddb.pm')
-rwxr-xr-x | lib/RHRD/rddb.pm | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/RHRD/rddb.pm b/lib/RHRD/rddb.pm index 3d19ff5..d0c2a47 100755 --- a/lib/RHRD/rddb.pm +++ b/lib/RHRD/rddb.pm @@ -2260,6 +2260,28 @@ sub create_musicpool_dropbox return ($cnt, 'OK', 'success'); } +sub update_musicpool_title +{ + my ($ctx, $shortname, $title) = @_; + + my ($groupname, $status, $errorstring) = get_musicpool_group($ctx, $shortname); + unless (defined $groupname) { + return (undef, $status, $errorstring); + } + + my $sql = qq{update GROUPS set DESCRIPTION = ? where NAME = ?;}; + + my $sth = $ctx->{'dbh'}->prepare($sql) + or return (undef, 'ERROR', "Database Error: " . $ctx->{'dbh'}->errstr); + + my $cnt = $sth->execute($title, $groupname) + or return (undef, 'ERROR', "Database Error: " . $sth->errstr); + + $sth->finish(); + + return ($cnt, 'OK', 'success'); +} + sub remove_musicpool { my ($ctx, $shortname) = @_; |