Files
old-holivud2/app/presenters/video_presenter.rb
2020-05-31 22:38:19 +02:00

40 lines
996 B
Ruby

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