Skip to content

Commit

Permalink
Added recordings size in GB
Browse files Browse the repository at this point in the history
  • Loading branch information
vitoriamr committed Jan 17, 2018
1 parent 4057ad9 commit 733545b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/views/manage/_statistics_list.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@
.text= t('.recordings.all', value: @data[:recordings][:all])
.text= t('.recordings.total', value: distance_of_time_in_words_to_now(Time.now + @data[:recordings][:total], include_seconds: false))
.text= t('.recordings.average', value: distance_of_time_in_words_to_now(Time.now + @data[:recordings][:average], include_seconds: false))
.text= t('.recordings.size', value: human_file_size(@data[:recordings][:size]))
1 change: 1 addition & 0 deletions config/locales/en/mconf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1075,6 +1075,7 @@ en:
all: "All recordings: %{value}"
total: "Total recordings duration: %{value}"
average: "Average recordings duration: %{value}"
size: "Total size: %{value}"
user_item:
allow_record: "Give the user permission to record conferences"
auth_using: "using"
Expand Down
1 change: 1 addition & 0 deletions config/locales/pt-br/mconf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1073,6 +1073,7 @@ pt-br:
all: "Total de gravações: %{value}"
total: "Duração de todas as gravações: %{value}"
average: "Média de duração por gravação: %{value}"
size: "Tamanho total de todas as gravações: %{value}"
user_item:
allow_record: "Conceder permissão de gravação"
auth_using: "usando"
Expand Down
3 changes: 3 additions & 0 deletions lib/mconf/statistics_module.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,19 @@ def self.total_recordings(from, to)
duration = 0
average = 0
count = 0
size = 0

recordings.find_each do |r|
# total duration
duration = r.end_time - r.start_time
total = total + duration
size = size + r.size
count = count + 1
end

# duration average
result[:all] = count
result[:size] = size
if count == 0
result[:average] = 0
else
Expand Down

0 comments on commit 733545b

Please sign in to comment.