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)
|
bbb_server.send_api_request("updateRecordings", meta)
|
||||||
end
|
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.
|
# Deletes a recording from a room.
|
||||||
def delete_recording(record_id)
|
def delete_recording(record_id)
|
||||||
bbb_server.delete_recordings(record_id)
|
bbb_server.delete_recordings(record_id)
|
||||||
|
|
|
@ -28,6 +28,12 @@ class RecordingsController < ApplicationController
|
||||||
"meta_#{META_LISTED}" => (params[:state] == "public"),
|
"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)
|
res = update_recording(params[:record_id], meta)
|
||||||
|
|
||||||
# Redirects to the page that made the initial request
|
# Redirects to the page that made the initial request
|
||||||
|
|
|
@ -42,6 +42,8 @@
|
||||||
<div class="dropdown">
|
<div class="dropdown">
|
||||||
<% if recording[:metadata][:"gl-listed"] == "true" %>
|
<% 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>
|
<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 %>
|
<% 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>
|
<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 %>
|
<% end %>
|
||||||
|
@ -52,14 +54,19 @@
|
||||||
<%= button_to update_recording_path(meetingID: recording[:meetingID], record_id: recording[:recordID], state: "unlisted"), class: "dropdown-item", "data-disable": "" do %>
|
<%= 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") %>
|
<i class="dropdown-icon fas fa-link"></i> <%= t("recording.visibility.unlisted") %>
|
||||||
<% end %>
|
<% 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>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
<% unless recording[:state] == "unpublished" %>
|
||||||
<% sorted_formats = recording[:playbacks].sort_by! { |p| p[:type] } %>
|
<% sorted_formats = recording[:playbacks].sort_by! { |p| p[:type] } %>
|
||||||
<% sorted_formats.each do |p| %>
|
<% sorted_formats.each do |p| %>
|
||||||
<%= link_to t("recording.format.#{p[:type]}"), p[:url], class: "btn btn-sm btn-primary", target: "_blank" %>
|
<%= link_to t("recording.format.#{p[:type]}"), p[:url], class: "btn btn-sm btn-primary", target: "_blank" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% end %>
|
||||||
</td>
|
</td>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
<div class="item-action dropdown">
|
<div class="item-action dropdown">
|
||||||
|
|
|
@ -32,12 +32,14 @@
|
||||||
</td>
|
</td>
|
||||||
<% if recording_thumbnails? %>
|
<% if recording_thumbnails? %>
|
||||||
<td class="overflow-hidden">
|
<td class="overflow-hidden">
|
||||||
|
<% if recording[:state] != "unpublished" %>
|
||||||
<% p = recording[:playbacks].find do |p| p.key?(:preview) end %>
|
<% p = recording[:playbacks].find do |p| p.key?(:preview) end %>
|
||||||
<% if p %>
|
<% if p %>
|
||||||
<% safe_recording_images(p[:preview][:images][:image]).each do |img| %>
|
<% safe_recording_images(p[:preview][:images][:image]).each do |img| %>
|
||||||
<%= image_tag(img[:content].strip, class: "thumbnail px-2") %>
|
<%= image_tag(img[:content].strip, class: "thumbnail px-2") %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% end %>
|
||||||
</td>
|
</td>
|
||||||
<% end %>
|
<% end %>
|
||||||
<td id="recording-length" class="text-left" data-full-length="<%= recording[:playbacks].empty? ? 0 : recording[:playbacks].first[:length]%>">
|
<td id="recording-length" class="text-left" data-full-length="<%= recording[:playbacks].empty? ? 0 : recording[:playbacks].first[:length]%>">
|
||||||
|
@ -50,6 +52,8 @@
|
||||||
<div class="dropdown">
|
<div class="dropdown">
|
||||||
<% if recording[:metadata][:"gl-listed"] == "true" %>
|
<% 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>
|
<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 %>
|
<% 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>
|
<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 %>
|
<% end %>
|
||||||
|
@ -60,14 +64,19 @@
|
||||||
<%= button_to update_recording_path(meetingID: recording[:meetingID], record_id: recording[:recordID], state: "unlisted"), class: "dropdown-item", "data-disable": "" do %>
|
<%= 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") %>
|
<i class="dropdown-icon fas fa-link"></i> <%= t("recording.visibility.unlisted") %>
|
||||||
<% end %>
|
<% 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>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
<% unless recording[:state] == "unpublished" %>
|
||||||
<% sorted_formats = recording[:playbacks].sort_by! { |p| p[:type] } %>
|
<% sorted_formats = recording[:playbacks].sort_by! { |p| p[:type] } %>
|
||||||
<% sorted_formats.each do |p| %>
|
<% sorted_formats.each do |p| %>
|
||||||
<%= link_to t("recording.format.#{p[:type]}"), p[:url], class: "btn btn-sm btn-primary", target: "_blank" %>
|
<%= link_to t("recording.format.#{p[:type]}"), p[:url], class: "btn btn-sm btn-primary", target: "_blank" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% end %>
|
||||||
</td>
|
</td>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
<div class="item-action dropdown">
|
<div class="item-action dropdown">
|
||||||
|
|
|
@ -510,6 +510,7 @@ en:
|
||||||
visibility: Visibility
|
visibility: Visibility
|
||||||
formats: Formats
|
formats: Formats
|
||||||
visibility:
|
visibility:
|
||||||
|
inaccessible: Inaccessible
|
||||||
public: Public
|
public: Public
|
||||||
unlisted: Unlisted
|
unlisted: Unlisted
|
||||||
format:
|
format:
|
||||||
|
|
|
@ -82,6 +82,24 @@ describe BbbServer do
|
||||||
end
|
end
|
||||||
|
|
||||||
context "#recordings" do
|
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
|
it "deletes the recording" do
|
||||||
allow_any_instance_of(BigBlueButton::BigBlueButtonApi).to receive(:delete_recordings).and_return(
|
allow_any_instance_of(BigBlueButton::BigBlueButtonApi).to receive(:delete_recordings).and_return(
|
||||||
returncode: true, deleted: true
|
returncode: true, deleted: true
|
||||||
|
|
Loading…
Reference in New Issue