add recording events to other meeting pages under room

This commit is contained in:
Zachary Chai
2017-01-31 15:06:04 -05:00
parent 02f59c49e6
commit 77fd74dd8f
5 changed files with 40 additions and 16 deletions

View File

@ -56,6 +56,7 @@ class BbbController < ApplicationController
wait_for_moderator: true,
meeting_recorded: true,
meeting_name: meeting_name,
room_owner: params[:room_id],
user_is_moderator: current_user == user
}
else
@ -117,7 +118,11 @@ class BbbController < ApplicationController
load_room!
# bbb_res = bbb_get_recordings "#{@user.encrypted_id}-#{params[:id]}"
bbb_res = bbb_get_recordings "#{@user.encrypted_id}"
options = { "meta_room-id": @user.encrypted_id }
if params[:id]
options["meta_meeting-name"] = params[:id]
end
bbb_res = bbb_get_recordings(options)
render_bbb_response bbb_res, bbb_res[:recordings]
end
@ -127,7 +132,7 @@ class BbbController < ApplicationController
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])
RecordingUpdatesJob.perform_later(@user.encrypted_id, params[:record_id], params[:id])
end
render_bbb_response bbb_res
end
@ -136,7 +141,7 @@ class BbbController < ApplicationController
def delete_recordings
bbb_res = bbb_delete_recordings(params[:record_id])
if bbb_res[:returncode]
RecordingDeletesJob.perform_later(@user.encrypted_id, params[:record_id])
RecordingDeletesJob.perform_later(@user.encrypted_id, params[:record_id], params[:id])
end
render_bbb_response bbb_res
end
@ -161,7 +166,7 @@ class BbbController < ApplicationController
def authorize_recording_owner!
load_and_authorize_room_owner!
recordings = bbb_get_recordings(params[:room_id])[:recordings]
recordings = bbb_get_recordings({recordID: params[:record_id]})[:recordings]
recordings.each do |recording|
if recording[:recordID] == params[:record_id]
return true
@ -194,7 +199,7 @@ class BbbController < ApplicationController
# the webhook event doesn't have all the data we need, so we need
# to send a getRecordings anyway
# TODO: if the webhooks included all data in the event we wouldn't need this
rec_info = bbb_get_recordings(token, record_id)
rec_info = bbb_get_recordings({recordID: record_id})
rec_info = rec_info[:recordings].first
RecordingCreatedJob.perform_later(token, parse_recording_for_view(rec_info))