|
|
|
@ -80,9 +80,9 @@ namespace :video do
|
|
|
|
|
videos = Video.published.where("duration = 0")
|
|
|
|
|
videos.find_each do |v|
|
|
|
|
|
result = AliyunVod::Service.get_play_info(v.uuid)
|
|
|
|
|
if result.present? && result["VideoBase"]["Duration"].present?
|
|
|
|
|
p '-----#{v.id} , #{result["VideoBase"]["Duration"]]}'
|
|
|
|
|
v.update(duration: result["VideoBase"]["Duration"])
|
|
|
|
|
if result.present? && result['PlayInfoList']['PlayInfo'][0]['Duration'].present?
|
|
|
|
|
p "-----#{v.id} , #{result['PlayInfoList']['PlayInfo'][0]['Duration']}"
|
|
|
|
|
v.update(duration: result['PlayInfoList']['PlayInfo'][0]['Duration'])
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|