forked from External/greenlight
GRN2-180: First stages of refactoring code for v2.4 (#748)
* Email rescues and authenticator concern * Application controller and helper clean up * Moved controller code out of helpers * More helper and email clean up * Cleaned up remaining helpers and create omniauth_options * Controller code clean up * restructured views structure * Restructured role code * Restructured profile and code clean up * Master merge * Added bbb server concern to deal with bbb calls * Bug fixes and changes after changes * rspec * More rubocop fixes
This commit is contained in:
@ -18,29 +18,29 @@
|
||||
|
||||
module Recorder
|
||||
extend ActiveSupport::Concern
|
||||
include ::BbbApi
|
||||
include RecordingsHelper
|
||||
|
||||
# Fetches all recordings for a room.
|
||||
def recordings(room_bbb_id, provider, search_params = {}, ret_search_params = false)
|
||||
res = bbb(provider).get_recordings(meetingID: room_bbb_id)
|
||||
def recordings(room_bbb_id, search_params = {}, ret_search_params = false)
|
||||
res = get_recordings(room_bbb_id)
|
||||
|
||||
format_recordings(res, search_params, ret_search_params)
|
||||
end
|
||||
|
||||
# Fetches a rooms public recordings.
|
||||
def public_recordings(room_bbb_id, provider, search_params = {}, ret_search_params = false)
|
||||
search, order_col, order_dir, recs = recordings(room_bbb_id, provider, search_params, ret_search_params)
|
||||
def public_recordings(room_bbb_id, search_params = {}, ret_search_params = false)
|
||||
search, order_col, order_dir, recs = recordings(room_bbb_id, search_params, ret_search_params)
|
||||
[search, order_col, order_dir, recs.select { |r| r[:metadata][:"gl-listed"] == "true" }]
|
||||
end
|
||||
|
||||
# Makes paginated API calls to get recordings
|
||||
def all_recordings(room_bbb_ids, provider, search_params = {}, ret_search_params = false, search_name = false)
|
||||
def all_recordings(room_bbb_ids, search_params = {}, ret_search_params = false, search_name = false)
|
||||
res = { recordings: [] }
|
||||
|
||||
until room_bbb_ids.empty?
|
||||
# bbb.get_recordings returns an object
|
||||
# take only the array portion of the object that is returned
|
||||
full_res = bbb(provider).get_recordings(meetingID: room_bbb_ids.pop(Rails.configuration.pagination_number))
|
||||
full_res = get_multiple_recordings(room_bbb_ids.pop(Rails.configuration.pagination_number))
|
||||
res[:recordings].push(*full_res[:recordings])
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user