Initial commit
This commit is contained in:
39
app/presenters/video_presenter.rb
Normal file
39
app/presenters/video_presenter.rb
Normal file
@@ -0,0 +1,39 @@
|
||||
class VideoPresenter
|
||||
def initialize(video)
|
||||
@video = video
|
||||
end
|
||||
|
||||
def edl_file_path
|
||||
return "" unless video.edl_file.attached?
|
||||
|
||||
ApplicationController._routes.url_helpers.rails_blob_path(video.edl_file, only_path: true, disposition: 'inline')
|
||||
end
|
||||
|
||||
def graphics_only_edl_file_path
|
||||
return "" unless video.graphics_only_edl_file.attached?
|
||||
|
||||
ApplicationController._routes.url_helpers.rails_blob_path(video.graphics_only_edl_file, only_path: true, disposition: 'inline')
|
||||
end
|
||||
|
||||
def audio_only_edl_file_path
|
||||
return "" unless video.audio_only_edl_file.attached?
|
||||
|
||||
ApplicationController._routes.url_helpers.rails_blob_path(video.audio_only_edl_file, only_path: true, disposition: 'inline')
|
||||
end
|
||||
|
||||
def edl_download_disabled?
|
||||
!video.edl_file.attached?
|
||||
end
|
||||
|
||||
def graphics_edl_download_disabled?
|
||||
!video.graphics_only_edl_file.attached?
|
||||
end
|
||||
|
||||
def audio_edl_download_disabled?
|
||||
!video.audio_only_edl_file.attached?
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
attr_reader :video
|
||||
end
|
||||
Reference in New Issue
Block a user