Skip to content
Snippets Groups Projects
Verified Commit cb31498c authored by Andrej Ramašeuski's avatar Andrej Ramašeuski
Browse files

Vytvoreni zaznamu v records

parent 37d3f958
Branches
No related tags found
No related merge requests found
......@@ -8,6 +8,7 @@ use constant CONTENT_TYPE => {
};
use constant CONTROL_URL => '%s/control/record/%s?app=stream&name=%s&rec=%s';
use constant HLS_URL => '/hls/%s.m3u8';
sub list {
my $c = shift;
......@@ -53,7 +54,6 @@ sub list {
$c->render( json => \@streams );
}
sub player {
my $c = shift;
......@@ -82,6 +82,7 @@ sub player {
return;
}
$c->stash->{url} = sprintf(HLS_URL, $stream->key);
$c->render();
}
......@@ -157,11 +158,19 @@ sub recording {
my $recording = ( $c->param('action') eq 'start' ) ? 1 : 0;
if ($res->is_success) {
# TRANSAKCE
my $guard = $c->schema->txn_scope_guard;
$stream->update({
recording => $recording
});
# create/update records
if ( $recording ) {
$stream->add_to_records({
publish_user_id => $stream->publish_user_id,
});
}
$guard->commit;
}
$c->render( json => { recording => $stream->recording } );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment