noosfero | Html5VideoPlugin: extracts conversion jobs to script (!1308)
Rodrigo Souto
gitlab at mg.gitlab.com
Mon Sep 18 17:10:32 BRT 2017
Rodrigo Souto started a new discussion on plugins/html5_video/lib/html5_video_plugin/enqueue_video_conversion_job.rb:
> +class Html5VideoPlugin::EnqueueVideoConversionJob
> +
> + attr_accessor :file_type, :file_id, :full_filename
> +
> + def perform
> + return unless file_type.constantize.exists?(file_id)
> + video = FilePresenter.for file_type.constantize.find(file_id)
> +
> + if video.is_a? FilePresenter::Video
We shouldn't be checking file types if we are using Presenters. You should add a method to the general presenter (something like `video?` or `conversible?`) that should return true or false instead of checking if the object is of a specific kind.
---
Reply to this email directly or view it on GitLab: https://gitlab.com/noosfero/noosfero/merge_requests/1308#note_40678634
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20170918/6459ed4c/attachment.html>
More information about the Noosfero-dev
mailing list