Class: CreateDerivativesJob
- Inherits:
-
ActiveFedoraIdBasedJob
- Object
- ActiveJob::Base
- ActiveFedoraIdBasedJob
- CreateDerivativesJob
- Defined in:
- app/jobs/create_derivatives_job.rb
Instance Attribute Summary
Attributes inherited from ActiveFedoraIdBasedJob
Instance Method Summary collapse
-
#parent_needs_reindex? ⇒ Boolean
If this file_set is the thumbnail for the parent work, then the parent also needs to be reindexed.
- #perform(id, file_name) ⇒ Object
Methods inherited from ActiveFedoraIdBasedJob
Instance Method Details
#parent_needs_reindex? ⇒ Boolean
If this file_set is the thumbnail for the parent work, then the parent also needs to be reindexed.
16 17 18 19 |
# File 'app/jobs/create_derivatives_job.rb', line 16 def parent_needs_reindex? return false unless file_set.parent file_set.parent.thumbnail_id == file_set.id end |
#perform(id, file_name) ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'app/jobs/create_derivatives_job.rb', line 4 def perform(id, file_name) @id = id return if file_set.video? && !CurationConcerns.config.enable_ffmpeg file_set.create_derivatives(file_name) # The thumbnail is indexed in the solr document, so reindex file_set.update_index file_set.parent.update_index if parent_needs_reindex? end |