summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-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