summaryrefslogtreecommitdiff
path: root/lib/RHRD
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2016-05-19 14:07:10 (GMT)
committerChristian Pointner <equinox@helsinki.at>2016-05-19 14:07:10 (GMT)
commitb4fe0e03eb1a712e379c2100ef92553afd4b26ed (patch)
tree3f858dd24a49059845328e8b0c4a9cad59297347 /lib/RHRD
parent10e2d89361988bd25a7085a34a874c8bf8ce98b5 (diff)
fix edit show (change title didn't work)
Diffstat (limited to 'lib/RHRD')
-rwxr-xr-xlib/RHRD/rddb.pm33
1 files changed, 25 insertions, 8 deletions
diff --git a/lib/RHRD/rddb.pm b/lib/RHRD/rddb.pm
index 36a4298..a1ab7e6 100755
--- a/lib/RHRD/rddb.pm
+++ b/lib/RHRD/rddb.pm
@@ -1294,6 +1294,23 @@ sub get_show_title_and_log
return ($title, $log, 'OK', 'success');
}
+sub update_show_title
+{
+ my ($ctx, $showid, $title) = @_;
+
+ my $sql = qq{update CART set TITLE = ? where NUMBER = ?;};
+
+ my $sth = $ctx->{'dbh'}->prepare($sql)
+ or return (undef, 'ERROR', "Database Error: " . $ctx->{'dbh'}->errstr);
+
+ my $cnt = $sth->execute($title, $showid)
+ or return (undef, 'ERROR', "Database Error: " . $sth->errstr);
+
+ $sth->finish();
+
+ return ($cnt, 'OK', 'success');
+}
+
sub get_show_info
{
my ($ctx, $showid) = @_;
@@ -1445,14 +1462,14 @@ sub get_next_free_showid
$sth->execute($ctx->{'config'}{'specialgroups'}{'shows'})
or return (undef, 'ERROR', "Database Error: " . $sth->errstr);
- my $show_id = $low;
+ my $showid = $low;
while(my ($cart) = $sth->fetchrow_array()) {
- last if($show_id < $cart);
- $show_id += 1;
+ last if($showid < $cart);
+ $showid += 1;
}
$sth->finish();
- return ($show_id, 'OK', 'success');
+ return ($showid, 'OK', 'success');
}
sub create_show_macro_cart
@@ -1477,7 +1494,7 @@ sub create_show_macro_cart
sub create_show_dropbox
{
- my ($ctx, $groupname, $show_id, $rhythm, $dow, $starttime, $len) = @_;
+ my ($ctx, $groupname, $showid, $rhythm, $dow, $starttime, $len) = @_;
my $param = join(';', ('S', $rhythm, $dow, $starttime, $len));
my $sql = qq{insert into DROPBOXES (STATION_NAME, GROUP_NAME, NORMALIZATION_LEVEL, AUTOTRIM_LEVEL, TO_CART, FIX_BROKEN_FORMATS, SET_USER_DEFINED) values (?, ?, ?, ?, ?, 'Y', ?)};
@@ -1485,7 +1502,7 @@ sub create_show_dropbox
my $sth = $ctx->{'dbh'}->prepare($sql)
or return (undef, 'ERROR', "Database Error: " . $ctx->{'dbh'}->errstr);
- my $cnt = $sth->execute($ctx->{'config'}{'dropboxes'}{'dropbox-pseudo-station'}, $groupname, $ctx->{'config'}{'dropboxes'}{'norm-level'}, $ctx->{'config'}{'dropboxes'}{'trim-level'}, $show_id, $param)
+ my $cnt = $sth->execute($ctx->{'config'}{'dropboxes'}{'dropbox-pseudo-station'}, $groupname, $ctx->{'config'}{'dropboxes'}{'norm-level'}, $ctx->{'config'}{'dropboxes'}{'trim-level'}, $showid, $param)
or return (undef, 'ERROR', "Database Error: " . $sth->errstr);
$sth->finish();
@@ -1495,7 +1512,7 @@ sub create_show_dropbox
sub update_show_dropbox
{
- my ($ctx, $show_id, $rhythm, $dow, $starttime, $len) = @_;
+ my ($ctx, $showid, $rhythm, $dow, $starttime, $len) = @_;
my $param = join(';', ('S', $rhythm, $dow, $starttime, $len));
my $sql = qq{update DROPBOXES set SET_USER_DEFINED = ? where TO_CART = ?};
@@ -1503,7 +1520,7 @@ sub update_show_dropbox
my $sth = $ctx->{'dbh'}->prepare($sql)
or return (undef, 'ERROR', "Database Error: " . $ctx->{'dbh'}->errstr);
- my $cnt = $sth->execute($param, $show_id)
+ my $cnt = $sth->execute($param, $showid)
or return (undef, 'ERROR', "Database Error: " . $sth->errstr);
$sth->finish();