Merge branch 'develop' into dev_aliyun

dev_video
cxt 5 years ago
commit 2967891321

@ -1,16 +1,16 @@
namespace :video do namespace :video do
desc "get video play data" desc "get video play data"
task :data => :environment do task :data => :environment do
start_times = ['2019-08-19T00:00:00Z', '2019-11-10T00:00:00Z'] start_times = ['2019-08-19 00:00:00', '2019-11-10 00:00:00']
end_times = ['2019-11-09T23:59:59Z', '2020-02-06T00:00:00Z'] end_times = ['2019-11-09 23:59:59', '2020-02-06 00:00:00']
Video.all.each do |video| Video.all.each do |video|
vv = 0 vv = 0
play_duration = 0 play_duration = 0
start_times.each_with_index do |time, index| start_times.each_with_index do |time, index|
start_time = time start_time = time.to_time.utc.strftime('%Y-%m-%dT%H:%M:%SZ')
end_time = end_times[index] end_time = end_times[index].to_time.utc.strftime('%Y-%m-%dT%H:%M:%SZ')
data = AliyunVod::Service.video_data(video.uuid, start_time, end_time) data = AliyunVod::Service.video_data(video.uuid, start_time, end_time)

Loading…
Cancel
Save