Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

newyslclassrooms
daiao 5 years ago
commit f29f673698

@ -134,13 +134,17 @@ class CoursesController < ApplicationController
# 视频移动到目录
def move_to_category
tip_exception("请选择要移动的目录") if params[:new_category_id].blank?
category = @course.course_second_categories.find_by(id: params[:new_category_id])
if params[:new_category_id].to_i == 0 || category.present?
videos = @course.course_videos.where(video_id: params[:video_ids]).or(@course.course_videos.where(id: params[:video_ids]))
video = @course.course_videos.where(video_id: params[:video_ids]).or(@course.course_videos.where(id: params[:video_ids])).first
user_id = video.user_id || video.video.user_id
tip_exception("您不是课堂管理员或者视频发布者,暂不能移动视频。") unless @user_course_identity < Course::PROFESSOR || user_id == current_user.id
videos.update_all(course_second_category_id: params[:new_category_id])
video.update!(course_second_category_id: params[:new_category_id])
normal_status(0, "操作成功")
else
normal_status(-1, "目录不存在")

@ -3,7 +3,7 @@ namespace :video_transcode do
desc "视频转码成h264"
task :submit => :environment do
Video.find_each do |v|
if v.uuid && v.transcoded == false && AliyunVod::Service.get_meta_code_info(v.uuid).start_with?("h264", "h265", "flv") == false
if v.uuid && !v.transcoded && !v.file_url.include?('.mp4') && !AliyunVod::Service.get_meta_code_info(v.uuid).start_with?("h264", "h265")
p "--- Start submit video trans code #{v.uuid}"
AliyunVod::Service.submit_transcode_job(v.uuid, 'a0277c5c0c7458458e171b0cee6ebf5e')
end

Loading…
Cancel
Save