Merge remote-tracking branch 'calcms/master'
* INSTALL.md: add sox to calculate audio duration * db.pm: output call stack on error * audio-recordings.cgi: set permissions to update event
This commit is contained in:
@@ -99,6 +99,8 @@ apt-get install <deb-package>
|
|||||||
libtext-wikicreole-perl
|
libtext-wikicreole-perl
|
||||||
liburi-escape-xs-perl
|
liburi-escape-xs-perl
|
||||||
perlmagick
|
perlmagick
|
||||||
|
sox
|
||||||
|
libsox-fmt-all
|
||||||
|
|
||||||
#### Install CPAN packages
|
#### Install CPAN packages
|
||||||
|
|
||||||
|
|||||||
@@ -52,6 +52,10 @@ sub connect($;$) {
|
|||||||
my $dbh = DBI->connect( $dsn, $username, $password, { mysql_enable_utf8 => 1 } )
|
my $dbh = DBI->connect( $dsn, $username, $password, { mysql_enable_utf8 => 1 } )
|
||||||
|| die "could not connect to database: $DBI::errstr";
|
|| die "could not connect to database: $DBI::errstr";
|
||||||
$dbh->{RaiseError} = 1;
|
$dbh->{RaiseError} = 1;
|
||||||
|
$dbh->{HandleError} = sub{
|
||||||
|
print STDERR join(",",(caller($_))[0..3])."\n" for (1..2);
|
||||||
|
return 0;
|
||||||
|
};
|
||||||
$dbh->{'mysql_enable_utf8'} = 1;
|
$dbh->{'mysql_enable_utf8'} = 1;
|
||||||
put( $dbh, "set character set utf8", undef );
|
put( $dbh, "set character set utf8", undef );
|
||||||
put( $dbh, "set names utf8", undef );
|
put( $dbh, "set names utf8", undef );
|
||||||
|
|||||||
@@ -130,6 +130,7 @@ sub uploadRecording {
|
|||||||
|
|
||||||
if ( defined $fh ) {
|
if ( defined $fh ) {
|
||||||
print STDERR "upload\n";
|
print STDERR "upload\n";
|
||||||
|
$config->{access}->{write} = 1;
|
||||||
events::set_upload_status($config, {event_id=>$params->{event_id}, upload_status=>'uploading' });
|
events::set_upload_status($config, {event_id=>$params->{event_id}, upload_status=>'uploading' });
|
||||||
my $fileInfo = uploadFile( $config, $fh, $params->{event_id}, $user, $params->{upload} );
|
my $fileInfo = uploadFile( $config, $fh, $params->{event_id}, $user, $params->{upload} );
|
||||||
$params->{error} .= $fileInfo->{error} if defined $fileInfo->{error};
|
$params->{error} .= $fileInfo->{error} if defined $fileInfo->{error};
|
||||||
@@ -141,6 +142,7 @@ sub uploadRecording {
|
|||||||
$params = updateDatabase( $config, $params, $user ) ;
|
$params = updateDatabase( $config, $params, $user ) ;
|
||||||
events::set_upload_status($config, {event_id=>$params->{event_id}, upload_status=>'uploaded' });
|
events::set_upload_status($config, {event_id=>$params->{event_id}, upload_status=>'uploaded' });
|
||||||
}
|
}
|
||||||
|
$config->{access}->{write} = 0;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
print STDERR "could not get file handle\n";
|
print STDERR "could not get file handle\n";
|
||||||
@@ -408,7 +410,6 @@ sub updateDatabase {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#connect
|
#connect
|
||||||
$config->{access}->{write} = 1;
|
|
||||||
my $dbh = db::connect($config);
|
my $dbh = db::connect($config);
|
||||||
|
|
||||||
my $entries = audio_recordings::get(
|
my $entries = audio_recordings::get(
|
||||||
@@ -439,7 +440,6 @@ sub updateDatabase {
|
|||||||
$params->{id} = $entry->{id};
|
$params->{id} = $entry->{id};
|
||||||
}
|
}
|
||||||
call_hooks($config, $entry, $params);
|
call_hooks($config, $entry, $params);
|
||||||
$config->{access}->{write} = 0;
|
|
||||||
$params->{action_result} = 'done!';
|
$params->{action_result} = 'done!';
|
||||||
|
|
||||||
return $params;
|
return $params;
|
||||||
|
|||||||
Reference in New Issue
Block a user