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

@@ -590,7 +590,7 @@ sub update_listen_key($$){
return undef unless defined $event->{event_id};
return undef unless defined $event->{listen_key};
print STDERR "set listen_key=$event->{listen_key} for ".$event->{start}." ".$event->{title}."\n";
#print STDERR "set listen_key=$event->{listen_key} for ".$event->{start}." ".$event->{title}."\n";
my $bindValues = [ $event->{listen_key}, $event->{event_id} ];
my $query = qq{
@@ -602,6 +602,23 @@ sub update_listen_key($$){
my $recordings = db::put( $dbh, $query, $bindValues );
}
sub set_upload_status($$){
my ($config, $event) = @_;
print STDERR "set upload_status=$event->{upload_status} for ".$event->{event_id}."\n";
return undef unless defined $event->{event_id};
return undef unless defined $event->{upload_status};
my $bindValues = [ $event->{upload_status}, $event->{event_id}, $event->{upload_status} ];
my $query = qq{
update calcms_events
set upload_status=?
where id=? and upload_status!=?;
};
my $dbh = db::connect($config);
my $recordings = db::put( $dbh, $query, $bindValues );
}
sub add_recordings($$$$) {
my ($dbh, $config, $request, $events) = @_;
@@ -1086,6 +1103,7 @@ sub get_query($$$) {
,e.disable_event_sync
,e.episode
,e.listen_key
,e.upload_status
};
my $template = $params->{template} || '';