Skip to content
Snippets Groups Projects
Commit f58d76c5 authored by Joshua Arts's avatar Joshua Arts
Browse files

prevent from grabbing length from stats format

parent efc2e3ab
No related branches found
No related tags found
No related merge requests found
...@@ -130,7 +130,12 @@ class RoomsController < ApplicationController ...@@ -130,7 +130,12 @@ class RoomsController < ApplicationController
helper_method :recording_date helper_method :recording_date
# Helper for converting BigBlueButton dates into a nice length string. # Helper for converting BigBlueButton dates into a nice length string.
def recording_length(len) def recording_length(playbacks)
# Stats format currently doesn't support length.
playbacks.reject! { |p| p[:type] == "statistics" }
return "0 min" if playbacks.empty?
len = playbacks.first[:length]
if len > 60 if len > 60
"#{(len / 60).round} hrs" "#{(len / 60).round} hrs"
elsif len == 0 elsif len == 0
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<div class="small text-muted text-uppercase"> <div class="small text-muted text-uppercase">
<%= t("recording.table.length") %> <%= t("recording.table.length") %>
</div> </div>
<%= recording_length(recording[:playbacks].first[:length]) %> <%= recording_length(recording[:playbacks]) %>
</td> </td>
<td class="text-left"> <td class="text-left">
<div class="small text-muted text-uppercase"> <div class="small text-muted text-uppercase">
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<div class="small text-muted text-uppercase"> <div class="small text-muted text-uppercase">
<%= t("recording.table.length") %> <%= t("recording.table.length") %>
</div> </div>
<%= recording_length(recording[:playbacks].first[:length]) %> <%= recording_length(recording[:playbacks]) %>
</td> </td>
<td class="text-left"> <td class="text-left">
<div class="small text-muted text-uppercase"> <div class="small text-muted text-uppercase">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment