From 0a0d031e1c33411188fdd51d99ee61b0434c3742 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sun, 31 Jul 2016 18:13:40 +0200 Subject: updating pool title works too 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) = @_; -- cgit v0.10.2