diff --git a/app/helpers/rooms_helper.rb b/app/helpers/rooms_helper.rb index b08b52df..c14b57eb 100644 --- a/app/helpers/rooms_helper.rb +++ b/app/helpers/rooms_helper.rb @@ -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 diff --git a/app/views/shared/components/_public_recording_row.html.erb b/app/views/shared/components/_public_recording_row.html.erb index c450eb1f..1966cb92 100644 --- a/app/views/shared/components/_public_recording_row.html.erb +++ b/app/views/shared/components/_public_recording_row.html.erb @@ -55,9 +55,10 @@ - <% 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 %>