Initial commit

This commit is contained in:
Senad Uka
2020-05-31 22:38:19 +02:00
commit 858fafc3c5
1280 changed files with 65918 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
class VideoAnalyses::EdlEventsController < ApplicationController
before_action :set_video
def create
@timecode = timecode
@edl_events = edl_event_gateway.edl_events
@info_message = t(".info_message", count: @edl_events.size)
end
private
def videos
policy_scope(Video)
end
def set_video
@video = authorize videos.find(params[:video_id])
end
def edl_event_gateway
@edl_event_gateway ||= EdlEventGateway.new(FilesForRequest.new(@video), timecode, timecode)
end
def edl_event_params
params.require(:edl_event).permit(:time_elapsed)
end
def timecode
time_elapsed = edl_event_params.fetch(:time_elapsed)
Timecode.from_seconds(time_elapsed.to_f).to_s
end
end