From 95c8f28a74b14fd203f8975adb75a16ed73f0603 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Sat, 17 Aug 2019 15:51:50 +0800 Subject: [PATCH] video feature: modify refresh auth api --- app/controllers/users/video_auths_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/users/video_auths_controller.rb b/app/controllers/users/video_auths_controller.rb index a7d41bce5..2231dcfdf 100644 --- a/app/controllers/users/video_auths_controller.rb +++ b/app/controllers/users/video_auths_controller.rb @@ -10,7 +10,9 @@ class Users::VideoAuthsController < Users::BaseController def update video = observed_user.videos.find_by(uuid: params[:video_id]) - return render_error('该视频凭证不存在') if video.blank? + if video.blank? + video = observed_user.videos.create!(uuid: params[:video_id], title: params[:title], cover_url: params[:cover_url]) + end result = AliyunVod::Service.refresh_upload_video(video.uuid) render_ok(data: result)