forked from External/greenlight
Added inaccesible recording format (#2750)
This commit is contained in:
parent
1ff45a4061
commit
0f90c4e873
|
@ -108,6 +108,16 @@ module BbbServer
|
|||
bbb_server.send_api_request("updateRecordings", meta)
|
||||
end
|
||||
|
||||
# Update a recording from a room
|
||||
def publish_recording(record_id)
|
||||
bbb_server.publish_recordings(record_id, true)
|
||||
end
|
||||
|
||||
# Update a recording from a room
|
||||
def unpublish_recording(record_id)
|
||||
bbb_server.publish_recordings(record_id, false)
|
||||
end
|
||||
|
||||
# Deletes a recording from a room.
|
||||
def delete_recording(record_id)
|
||||
bbb_server.delete_recordings(record_id)
|
||||
|
|
|
@ -28,6 +28,12 @@ class RecordingsController < ApplicationController
|
|||
"meta_#{META_LISTED}" => (params[:state] == "public"),
|
||||
}
|
||||
|
||||
if params[:state] == "inaccessible"
|
||||
unpublish_recording(params[:record_id])
|
||||
else
|
||||
publish_recording(params[:record_id])
|
||||
end
|
||||
|
||||
res = update_recording(params[:record_id], meta)
|
||||
|
||||
# Redirects to the page that made the initial request
|
||||
|
|
|
@ -42,6 +42,8 @@
|
|||
<div class="dropdown">
|
||||
<% if recording[:metadata][:"gl-listed"] == "true" %>
|
||||
<button class="btn btn-sm btn-secondary dropdown-toggle" data-toggle="dropdown"><i class="dropdown-icon fas fa-globe px-2"></i> <%= t("recording.visibility.public") %></button>
|
||||
<% elsif recording[:state] == "unpublished" %>
|
||||
<button class="btn btn-sm btn-secondary dropdown-toggle" data-toggle="dropdown"><i class="dropdown-icon fas fa-lock px-2"></i> <%= t("recording.visibility.inaccessible") %></button>
|
||||
<% else %>
|
||||
<button class="btn btn-sm btn-secondary dropdown-toggle" data-toggle="dropdown"><i class="dropdown-icon fas fa-link px-2"></i> <%= t("recording.visibility.unlisted") %></button>
|
||||
<% end %>
|
||||
|
@ -52,13 +54,18 @@
|
|||
<%= button_to update_recording_path(meetingID: recording[:meetingID], record_id: recording[:recordID], state: "unlisted"), class: "dropdown-item", "data-disable": "" do %>
|
||||
<i class="dropdown-icon fas fa-link"></i> <%= t("recording.visibility.unlisted") %>
|
||||
<% end %>
|
||||
<%= button_to update_recording_path(meetingID: recording[:meetingID], record_id: recording[:recordID], state: "inaccessible"), class: "dropdown-item", "data-disable": "" do %>
|
||||
<i class="dropdown-icon fas fa-lock"></i> <%= t("recording.visibility.inaccessible") %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<% sorted_formats = recording[:playbacks].sort_by! { |p| p[:type] } %>
|
||||
<% sorted_formats.each do |p| %>
|
||||
<%= link_to t("recording.format.#{p[:type]}"), p[:url], class: "btn btn-sm btn-primary", target: "_blank" %>
|
||||
<% unless recording[:state] == "unpublished" %>
|
||||
<% sorted_formats = recording[:playbacks].sort_by! { |p| p[:type] } %>
|
||||
<% sorted_formats.each do |p| %>
|
||||
<%= link_to t("recording.format.#{p[:type]}"), p[:url], class: "btn btn-sm btn-primary", target: "_blank" %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
|
|
|
@ -32,10 +32,12 @@
|
|||
</td>
|
||||
<% if recording_thumbnails? %>
|
||||
<td class="overflow-hidden">
|
||||
<% p = recording[:playbacks].find do |p| p.key?(:preview) end %>
|
||||
<% if p %>
|
||||
<% safe_recording_images(p[:preview][:images][:image]).each do |img| %>
|
||||
<%= image_tag(img[:content].strip, class: "thumbnail px-2") %>
|
||||
<% if recording[:state] != "unpublished" %>
|
||||
<% p = recording[:playbacks].find do |p| p.key?(:preview) end %>
|
||||
<% if p %>
|
||||
<% safe_recording_images(p[:preview][:images][:image]).each do |img| %>
|
||||
<%= image_tag(img[:content].strip, class: "thumbnail px-2") %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</td>
|
||||
|
@ -50,6 +52,8 @@
|
|||
<div class="dropdown">
|
||||
<% if recording[:metadata][:"gl-listed"] == "true" %>
|
||||
<button class="btn btn-sm btn-secondary dropdown-toggle" data-toggle="dropdown"><i class="dropdown-icon fas fa-globe px-2"></i> <%= t("recording.visibility.public") %></button>
|
||||
<% elsif recording[:state] == "unpublished" %>
|
||||
<button class="btn btn-sm btn-secondary dropdown-toggle" data-toggle="dropdown"><i class="dropdown-icon fas fa-lock px-2"></i> <%= t("recording.visibility.inaccessible") %></button>
|
||||
<% else %>
|
||||
<button class="btn btn-sm btn-secondary dropdown-toggle" data-toggle="dropdown"><i class="dropdown-icon fas fa-link px-2"></i> <%= t("recording.visibility.unlisted") %></button>
|
||||
<% end %>
|
||||
|
@ -60,13 +64,18 @@
|
|||
<%= button_to update_recording_path(meetingID: recording[:meetingID], record_id: recording[:recordID], state: "unlisted"), class: "dropdown-item", "data-disable": "" do %>
|
||||
<i class="dropdown-icon fas fa-link"></i> <%= t("recording.visibility.unlisted") %>
|
||||
<% end %>
|
||||
<%= button_to update_recording_path(meetingID: recording[:meetingID], record_id: recording[:recordID], state: "inaccessible"), class: "dropdown-item", "data-disable": "" do %>
|
||||
<i class="dropdown-icon fas fa-lock"></i> <%= t("recording.visibility.inaccessible") %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<% sorted_formats = recording[:playbacks].sort_by! { |p| p[:type] } %>
|
||||
<% sorted_formats.each do |p| %>
|
||||
<%= link_to t("recording.format.#{p[:type]}"), p[:url], class: "btn btn-sm btn-primary", target: "_blank" %>
|
||||
<% unless recording[:state] == "unpublished" %>
|
||||
<% sorted_formats = recording[:playbacks].sort_by! { |p| p[:type] } %>
|
||||
<% sorted_formats.each do |p| %>
|
||||
<%= link_to t("recording.format.#{p[:type]}"), p[:url], class: "btn btn-sm btn-primary", target: "_blank" %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
|
|
|
@ -510,6 +510,7 @@ en:
|
|||
visibility: Visibility
|
||||
formats: Formats
|
||||
visibility:
|
||||
inaccessible: Inaccessible
|
||||
public: Public
|
||||
unlisted: Unlisted
|
||||
format:
|
||||
|
|
|
@ -82,6 +82,24 @@ describe BbbServer do
|
|||
end
|
||||
|
||||
context "#recordings" do
|
||||
it "publishes a recording" do
|
||||
allow_any_instance_of(BigBlueButton::BigBlueButtonApi).to receive(:publish_recordings).and_return(
|
||||
returncode: true, published: true
|
||||
)
|
||||
|
||||
expect(publish_recording(Faker::IDNumber.valid))
|
||||
.to contain_exactly([:returncode, true], [:published, true])
|
||||
end
|
||||
|
||||
it "unpublishes a recording" do
|
||||
allow_any_instance_of(BigBlueButton::BigBlueButtonApi).to receive(:publish_recordings).and_return(
|
||||
returncode: true, published: false
|
||||
)
|
||||
|
||||
expect(unpublish_recording(Faker::IDNumber.valid))
|
||||
.to contain_exactly([:returncode, true], [:published, false])
|
||||
end
|
||||
|
||||
it "deletes the recording" do
|
||||
allow_any_instance_of(BigBlueButton::BigBlueButtonApi).to receive(:delete_recordings).and_return(
|
||||
returncode: true, deleted: true
|
||||
|
|
Loading…
Reference in New Issue