Skip to content

Commit

Permalink
Fix issue with recording resync deleting recordings
Browse files Browse the repository at this point in the history
  • Loading branch information
farhatahmad committed Oct 11, 2023
1 parent 16b8922 commit bd3f40b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/services/recording_creator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def get_recording_length(recording:)
length = 0
if recording[:playback][:format].is_a?(Array)
recording[:playback][:format].each do |formats|
length = formats[:length] if formats[:type] == 'presentation'
length = formats[:length] if formats[:type] == 'presentation' || formats[:type] == 'video'
end
else
length = recording[:playback][:format][:length]
Expand Down
4 changes: 3 additions & 1 deletion app/services/recordings_sync.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ def initialize(room:, provider:)
end

def call
@room.recordings.destroy_all
recordings = @room.recordings
Format.where(recordings:).delete_all
recordings.delete_all

recordings = BigBlueButtonApi.new(provider: @provider).get_recordings(meeting_ids: @room.meeting_id)
recordings[:recordings].each do |recording|
Expand Down

0 comments on commit bd3f40b

Please sign in to comment.