summaryrefslogtreecommitdiff
path: root/utils/rhrd-show
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2016-05-18 13:58:29 (GMT)
committerChristian Pointner <equinox@spreadspace.org>2016-05-18 13:58:29 (GMT)
commit97323fb5f40779cf38a96325ece5efb16812870d (patch)
tree075973ea92eb9f1803155dac9fcc6dd33b85ce76 /utils/rhrd-show
parent635dfff6d078e40afef725be9041a52a8a9d0189 (diff)
rhrd-show can now edit show info
Diffstat (limited to 'utils/rhrd-show')
-rwxr-xr-xutils/rhrd-show22
1 files changed, 16 insertions, 6 deletions
diff --git a/utils/rhrd-show b/utils/rhrd-show
index cab6ead..731b627 100755
--- a/utils/rhrd-show
+++ b/utils/rhrd-show
@@ -21,7 +21,6 @@
#
use strict;
-use lib "../lib/";
use RHRD::rddb;
use RHRD::utils;
use Date::Calc;
@@ -180,9 +179,10 @@ sub add
return 0;
}
+
sub edit__check_arguments
{
- my ($showid, $title, $rhythm, $dow, $starttime, $len) = @_;
+ my ($show_id, $title, $rhythm, $dow, $starttime, $len) = @_;
my ($result, $err, $hint) = RHRD::utils::dropbox_param_rhythm_ok($rhythm);
unless($result) {
@@ -213,16 +213,26 @@ sub edit__check_arguments
sub edit
{
- my ($ctx, $showid, $title, $rhythm, $dow, $starttime, $len) = @_;
+ my ($ctx, $show_id, $title, $rhythm, $dow, $starttime, $len) = @_;
- my $ret = edit__check_arguments($showid, $title, $rhythm, $dow, $starttime, $len);
+ my $ret = edit__check_arguments($show_id, $title, $rhythm, $dow, $starttime, $len);
if($ret) {
return $ret;
}
+ ($dow, undef, undef) = RHRD::utils::cmdline_dow($dow);
- print " not yet implemented!!\n";
+ my ($result, $status, $errorstring) = RHRD::rddb::update_show_dropbox($ctx, $show_id, $rhythm, $dow, $starttime, $len);
+ unless(defined $result) {
+ print STDERR $status . ": " . $errorstring . "\n";
+ return 1;
+ }
+ if ($result != 1) {
+ print "show '" . $show_id ."' does not exist.\n";
+ return 1;
+ }
- return 1;
+ print "show '" . $show_id . "' successfully changed!\n";
+ return 0;
}
sub remove