[Git][noosfero/noosfero][master] 2 commits: html5-video: adapt to_html to received context

Rodrigo Souto gitlab at mg.gitlab.com
Tue Oct 31 18:32:08 BRST 2017


Rodrigo Souto pushed to branch master at Noosfero / noosfero


Commits:
307f1dd1 by Rodrigo Souto at 2017-10-31T17:31:31-03:00
html5-video: adapt to_html to received context

- - - - -
dcc579e9 by Rodrigo Souto at 2017-10-31T17:31:45-03:00
html5_video: convert failed pending jobs

- - - - -


2 changed files:

- plugins/html5_video/lib/html5_video_plugin/video_channel.rb
- + plugins/html5_video/script/convert_pending_jobs.rb


Changes:

=====================================
plugins/html5_video/lib/html5_video_plugin/video_channel.rb
=====================================
--- a/plugins/html5_video/lib/html5_video_plugin/video_channel.rb
+++ b/plugins/html5_video/lib/html5_video_plugin/video_channel.rb
@@ -11,7 +11,7 @@ class Html5VideoPlugin::VideoChannel < Folder
   include ActionView::Helpers::TagHelper
   def to_html(options={})
     article = self
-    lambda do
+    lambda do |context|
       render :file => 'content_viewer/video_channel', :locals => {:article => article}
     end
   end


=====================================
plugins/html5_video/script/convert_pending_jobs.rb
=====================================
--- /dev/null
+++ b/plugins/html5_video/script/convert_pending_jobs.rb
@@ -0,0 +1,20 @@
+jobs = Delayed::Job.where("handler LIKE '%Html5VideoPlugin::CreateVideo%'")
+
+file_ids = {}
+
+jobs.each do |job|
+  file_id = job.handler.match(/file_id: ([0-9]*)/)[1]
+  file_type = job.handler.match(/file_type: ([a-zA-Z]*)/)[1]
+  full_filename = job.handler.match(/full_filename: \"([^\"]*)\"/)[1]
+  file_ids[file_id] = {}
+  file_ids[file_id]['file_type'] = file_type
+  file_ids[file_id]['full_filename'] = full_filename
+end
+
+file_ids.each do |file_id, hash|
+  job = Html5VideoPlugin::EnqueueVideoConversionJob.new
+  job.file_id = file_id
+  job.file_type = hash['file_type']
+  job.full_filename = hash['full_filename']
+  Delayed::Job.enqueue job, priority: 10
+end



View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/b7ebeb943e01d9399fcafb6a57512aa714025e84...dcc579e9f7835015405a33b3cb91973cc900f7f4

---
View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/b7ebeb943e01d9399fcafb6a57512aa714025e84...dcc579e9f7835015405a33b3cb91973cc900f7f4
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/20171031/f5f57ab8/attachment-0001.html>


More information about the Noosfero-dev mailing list