4
5
6
7
8
9
10
11
12
13
14
|
# File 'app/jobs/valkyrie_create_derivatives_job.rb', line 4
def perform(_file_set_id, file_id, _filepath = nil)
file_metadata = Hyrax.custom_queries.find_file_metadata_by(id: file_id)
return if file_metadata.video? && !Hyrax.config.enable_ffmpeg
file = Hyrax.storage_adapter.find_by(id: file_metadata.file_identifier)
derivative_service = Hyrax::DerivativeService.for(file_metadata)
derivative_service.create_derivatives(file.disk_path)
Hyrax.publisher.publish('file.metadata.updated', metadata: file_metadata, user: nil)
end
|