|
|
@ -112,9 +112,11 @@ class CoursesController < ApplicationController
|
|
|
|
|
|
|
|
|
|
|
|
videos = custom_sort(videos, params[:sort_by], params[:sort_direction])
|
|
|
|
videos = custom_sort(videos, params[:sort_by], params[:sort_direction])
|
|
|
|
@count = videos.count
|
|
|
|
@count = videos.count
|
|
|
|
sql = "left join videos on videos.id=course_videos.video_id AND (videos.transcoded=1 OR videos.user_id = #{current_user.id})"
|
|
|
|
#sql = "left join videos on videos.id=course_videos.video_id AND (videos.transcoded=1 OR videos.user_id = #{current_user.id})"
|
|
|
|
videos = videos.joins(sql).reload!
|
|
|
|
#@videos = paginate videos.joins(sql).includes(video: [user: :user_extension], user: :user_extension)
|
|
|
|
@videos = paginate videos.includes(video: [user: :user_extension], user: :user_extension)
|
|
|
|
@videos = paginate videos.includes(video: [user: :user_extension], user: :user_extension)
|
|
|
|
|
|
|
|
.where(videos: {transcoded: true}).or(videos: {user_id: current_user.id})
|
|
|
|
|
|
|
|
.or(course_videos: {is_link: true})
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def delete_course_video
|
|
|
|
def delete_course_video
|
|
|
|