Allow recordings to be 'unlisted'

Unlisted is a state between published and unpublished. They are still
published in the server, but will not appear to anyone other than the
user that created the recording.
It is done using a metadata attribute and required several changes in how
the application handles publishing and unpublishing.
This commit is contained in:
Leonardo Crauss Daronco
2016-12-06 12:03:53 -02:00
parent 40cbc8a575
commit b518458622
12 changed files with 111 additions and 53 deletions

View File

@ -76,9 +76,11 @@ class BbbController < ApplicationController
# PATCH /rooms/:id/recordings/:record_id
def update_recordings
bbb_res = bbb_update_recordings(params[:record_id], params[:published] == 'true')
published = params[:published] == 'true'
metadata = params.select{ |k, v| k.match(/^meta_/) }
bbb_res = bbb_update_recordings(params[:record_id], published, metadata)
if bbb_res[:returncode]
RecordingUpdatesJob.perform_later(@user.encrypted_id, params[:record_id], bbb_res[:published])
RecordingUpdatesJob.perform_later(@user.encrypted_id, params[:record_id])
end
render_bbb_response bbb_res
end