Added env variable to exclude recording formats from public recordings (#2055)

This commit is contained in:
Ahmad Farhat 2020-09-03 10:55:24 -04:00 committed by GitHub
parent 3de60daf85
commit 99c7262971
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -54,4 +54,9 @@ module RoomsHelper
false
end
end
# Array of recording formats not to show for public recordings
def hidden_format_public
ENV.fetch("HIDDEN_FORMATS_PUBLIC", "").split(",")
end
end

View File

@ -55,9 +55,10 @@
</div>
</td>
<td>
<% sorted_formats = recording[:playbacks].sort_by! {|p| p[:type]} %>
<% sorted_formats = recording[:playbacks].sort_by! {|p| p[:type]} %>
<% p = recording[:playbacks].find do |p| p.key?(:length) end %>
<% sorted_formats.each do |p| %>
<% next if hidden_format_public.include?(p[:type].downcase)%>
<%= link_to t("recording.format.#{p[:type]}"), p[:url], class: "btn btn-sm btn-primary", target: "_blank" %>
<% end %>
</td>