audio-recordings.cgi: set upload status

on uploading and audio processing the status is updated
This commit is contained in:
Milan
2021-02-05 22:53:56 +01:00
parent 696b964dfa
commit 7ffc6914b9
5 changed files with 60 additions and 11 deletions

View File

@@ -135,20 +135,25 @@ sub uploadRecording {
if ( defined $fh ) {
print STDERR "upload\n";
events::set_upload_status($config, {event_id=>$params->{event_id}, upload_status=>'uploading' });
my $fileInfo = uploadFile( $config, $fh, $params->{event_id}, $user, $params->{upload} );
$params->{error} .= $fileInfo->{error} if defined $fileInfo->{error};
$params->{path} = $fileInfo->{path};
$params->{size} = $fileInfo->{size};
#$params->{duration} = $fileInfo->{duration};
$params = updateDatabase( $config, $params, $user ) if $params->{error} eq '';
if ($params->{error} eq ''){
$params = updateDatabase( $config, $params, $user ) ;
events::set_upload_status($config, {event_id=>$params->{event_id}, upload_status=>'uploaded' });
}
} else {
print STDERR "could not get file handle\n";
$params->{error} .= 'Could not get file handle';
}
if ( $params->{error} ne '' ) {
events::set_upload_status($config, {event_id=>$params->{event_id}, upload_status=>'upload failed' });
if ( $params->{error} =~ /limit/ ) {
$params->{error} .=
"audio file size is limited to "