fix stats format being removed

This commit is contained in:
Joshua Arts 2018-08-20 14:53:14 -04:00
parent a27fbec44a
commit a6fc8f0f2f
1 changed files with 3 additions and 3 deletions

View File

@ -132,10 +132,10 @@ class RoomsController < ApplicationController
# Helper for converting BigBlueButton dates into a nice length string.
def recording_length(playbacks)
# Stats format currently doesn't support length.
playbacks.reject! { |p| p[:type] == "statistics" }
return "0 min" if playbacks.empty?
valid_playbacks = playbacks.reject { |p| p[:type] == "statistics" }
return "0 min" if valid_playbacks.empty?
len = playbacks.first[:length]
len = valid_playbacks.first[:length]
if len > 60
"#{(len / 60).round} hrs"
elsif len == 0