forked from External/greenlight
prevent from grabbing length from stats format
This commit is contained in:
parent
efc2e3ab17
commit
f58d76c5ef
|
@ -130,7 +130,12 @@ class RoomsController < ApplicationController
|
|||
helper_method :recording_date
|
||||
|
||||
# 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
|
||||
"#{(len / 60).round} hrs"
|
||||
elsif len == 0
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
<div class="small text-muted text-uppercase">
|
||||
<%= t("recording.table.length") %>
|
||||
</div>
|
||||
<%= recording_length(recording[:playbacks].first[:length]) %>
|
||||
<%= recording_length(recording[:playbacks]) %>
|
||||
</td>
|
||||
<td class="text-left">
|
||||
<div class="small text-muted text-uppercase">
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
<div class="small text-muted text-uppercase">
|
||||
<%= t("recording.table.length") %>
|
||||
</div>
|
||||
<%= recording_length(recording[:playbacks].first[:length]) %>
|
||||
<%= recording_length(recording[:playbacks]) %>
|
||||
</td>
|
||||
<td class="text-left">
|
||||
<div class="small text-muted text-uppercase">
|
||||
|
|
Loading…
Reference in New Issue