From b1fcde99bc3b9e6833e3aeccb9e6608b1cca41d2 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 11 Mar 2020 09:40:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E8=A7=86=E9=A2=91=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/videos/batch_publish_service.rb | 7 +++---- app/services/videos/dispatch_callback_service.rb | 4 +--- lib/gitlab-cli/.rakeTasks | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/app/services/videos/batch_publish_service.rb b/app/services/videos/batch_publish_service.rb index cad8cfbd9..c47906192 100644 --- a/app/services/videos/batch_publish_service.rb +++ b/app/services/videos/batch_publish_service.rb @@ -33,10 +33,9 @@ class Videos::BatchPublishService < ApplicationService code_info = AliyunVod::Service.get_meta_code_info(video.uuid) if code_info.present? && code_info.start_with?('h264', 'h265') video.transcoded = true - #Rails.logger.info("####video.uuid:#{video.uuid}") - #result = AliyunVod::Service.get_play_info(video.uuid) - # Rails.logger.info("####video.result:#{result}") - #video.play_url = result['PlayInfoList']['PlayInfo'][0]['PlayURL'] + result = AliyunVod::Service.get_play_info(video.uuid) rescue nil + play_url = result['PlayInfoList']['PlayInfo'][0]['PlayURL'] if result + video.play_url = play_url else AliyunVod::Service.submit_transcode_job(video.uuid, Video::NORMAL_TRANSCODE_GROUP_ID) end diff --git a/app/services/videos/dispatch_callback_service.rb b/app/services/videos/dispatch_callback_service.rb index 2e3d85987..4ff94a1c4 100644 --- a/app/services/videos/dispatch_callback_service.rb +++ b/app/services/videos/dispatch_callback_service.rb @@ -18,9 +18,7 @@ class Videos::DispatchCallbackService < ApplicationService video.save! when 'SnapshotComplete' then # 封面截图完成 return if video.cover_url.present? - result = AliyunVod::Service.get_play_info(video.uuid) rescue nil - play_url = result['PlayInfoList']['PlayInfo'][0]['PlayURL'] if result - video.update!(cover_url: params['CoverUrl'], play_url: play_url) + video.update!(cover_url: params['CoverUrl']) when 'StreamTranscodeComplete' then # 转码完成 #return if video.play_url.present? video.update!(play_url: params['FileUrl'], transcoded: true) diff --git a/lib/gitlab-cli/.rakeTasks b/lib/gitlab-cli/.rakeTasks index ea716fd52..f349995e9 100644 --- a/lib/gitlab-cli/.rakeTasks +++ b/lib/gitlab-cli/.rakeTasks @@ -4,4 +4,4 @@ You are allowed to: 1. Remove rake task 2. Add existing rake tasks To add existing rake tasks automatically delete this file and reload the project. ---> +-->