forked from External/greenlight
Merge pull request #56 from erickadbay/dev-erick
Fixed recording duration
This commit is contained in:
commit
f0128951f4
|
@ -140,8 +140,7 @@ class @Recordings
|
|||
if !@owner
|
||||
table_api.column(-1).visible(false)
|
||||
for recording in data.recordings
|
||||
totalMinutes = Math.round((new Date(recording.end_time) - new Date(recording.start_time)) / 1000 / 60)
|
||||
recording.duration = totalMinutes
|
||||
recording.duration = recording.length
|
||||
data.recordings.sort (a,b) ->
|
||||
return new Date(b.start_time) - new Date(a.start_time)
|
||||
table_api.clear()
|
||||
|
|
|
@ -113,7 +113,7 @@ module BbbApi
|
|||
|
||||
res[:recordings].each do |recording|
|
||||
pref_preview = {}
|
||||
|
||||
recording[:length] = recording[:playback][:format].is_a?(Hash) ? recording[:playback][:format][:length] : recording[:playback][:format].first[:length]
|
||||
# create a playbacks attribute on recording for playback formats
|
||||
recording[:playbacks] = if !recording[:playback] || !recording[:playback][:format]
|
||||
[]
|
||||
|
|
|
@ -23,6 +23,7 @@ json.recordings do
|
|||
json.start_time recording[:startTime]
|
||||
json.end_time recording[:endTime]
|
||||
json.published recording[:published]
|
||||
json.length recording[:length]
|
||||
json.previews do
|
||||
json.array!(recording[:previews]) do |preview|
|
||||
json.partial! 'preview', preview: preview
|
||||
|
|
Loading…
Reference in New Issue