Sha256: 346d2f9234a65ef1fd853f673d461945936f7f4892005f32cdafa4250b916d6f

Contents?: true

Size: 623 Bytes

Versions: 8

Compression:

Stored size: 623 Bytes

Contents

class CreateDerivativesJob < ActiveFedoraIdBasedJob
  queue_as :derivatives

  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

  # If this file_set is the thumbnail for the parent work,
  # then the parent also needs to be reindexed.
  def parent_needs_reindex?
    return false unless file_set.parent
    file_set.parent.thumbnail_id == file_set.id
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
curation_concerns-models-0.10.0 app/jobs/create_derivatives_job.rb
curation_concerns-models-0.9.0 app/jobs/create_derivatives_job.rb
curation_concerns-models-0.8.0 app/jobs/create_derivatives_job.rb
curation_concerns-models-0.7.0 app/jobs/create_derivatives_job.rb
curation_concerns-models-0.6.0 app/jobs/create_derivatives_job.rb
curation_concerns-models-0.5.0 app/jobs/create_derivatives_job.rb
curation_concerns-models-0.4.0 app/jobs/create_derivatives_job.rb
curation_concerns-models-0.3.0 app/jobs/create_derivatives_job.rb