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

@ -19,22 +19,13 @@ class RecordingUpdatesJob < ApplicationJob
queue_as :default
def perform(room, record_id, published)
tries = 0
sleep_time = 2
while tries < 4
bbb_res = bbb_get_recordings(nil, record_id)
if bbb_res[:recordings].first[:published].to_s == published
ActionCable.server.broadcast "#{room}_recording_updates_channel",
action: 'update',
record_id: record_id,
published: bbb_res[:recordings].first[:published]
break
end
sleep sleep_time
sleep_time = sleep_time * 2
tries += 1
end
def perform(room, record_id)
bbb_res = bbb_get_recordings(nil, record_id)
recording = bbb_res[:recordings].first
ActionCable.server.broadcast "#{room}_recording_updates_channel",
action: 'update',
record_id: record_id,
published: recording[:published],
listed: bbb_is_recording_listed(recording)
end
end