Skip to content

Commit

Permalink
Adjust call to ActiveEncode to request subtitle extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
masaball committed Jan 14, 2025
1 parent 9d00d0f commit 56f3507
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ GIT

GIT
remote: https://github.com/samvera-labs/active_encode.git
revision: 31e59574a60a54be0b35faf79e8a913480d68362
revision: bfc46242def0040404ea400e70028eca37b43659
branch: caption_extraction
specs:
active_encode (1.2.3)
Expand Down
2 changes: 1 addition & 1 deletion app/jobs/active_encode_jobs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def perform(input, master_file_id, options = {})
return unless MasterFile.exists? master_file_id
master_file = MasterFile.find(master_file_id)
return if master_file.workflow_id.present?
master_file.encoder_class.create(input, options.merge!(master_file_id: master_file_id, preset: master_file.workflow_name))
master_file.encoder_class.create(input, options.merge!(master_file_id: master_file_id, preset: master_file.workflow_name, extract_subtitles: true))
end
end

Expand Down
12 changes: 6 additions & 6 deletions spec/models/master_file_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
end

it 'creates an encode' do
expect(master_file.encoder_class).to receive(:create).with("file://" + Addressable::URI.escape(master_file.file_location), { master_file_id: master_file.id, preset: master_file.workflow_name, headers: nil })
expect(master_file.encoder_class).to receive(:create).with("file://" + Addressable::URI.escape(master_file.file_location), { master_file_id: master_file.id, preset: master_file.workflow_name, headers: nil, extract_subtitles: true })
master_file.process
end

Expand Down Expand Up @@ -155,8 +155,8 @@
end

it 'creates an encode' do
expect(master_file.encoder_class).to receive(:create).with("file://" + Rails.root.join(high_file).to_path, { outputs: outputs_hash, master_file_id: master_file.id, preset: master_file.workflow_name })
master_file.process(files)
expect(master_file.encoder_class).to receive(:create).with("file://" + Rails.root.join(high_file).to_path, { outputs: outputs_hash, master_file_id: master_file.id, preset: master_file.workflow_name, extract_subtitles: true })
master_file.process(files)
end
end

Expand All @@ -165,8 +165,8 @@
let(:outputs_hash) { [{ label: 'high', url: input_url }] }

it 'creates an encode' do
expect(master_file.encoder_class).to receive(:create).with(input_url, { outputs: outputs_hash, master_file_id: master_file.id, preset: master_file.workflow_name })
master_file.process
expect(master_file.encoder_class).to receive(:create).with(input_url, { outputs: outputs_hash, master_file_id: master_file.id, preset: master_file.workflow_name, extract_subtitles: true })
master_file.process
end
end
end
Expand Down Expand Up @@ -838,7 +838,7 @@
context 'with embedded captions' do
let(:encode_succeeded) { FactoryBot.build(:encode, :embedded_captions) }

it 'calls update_supplemental_files' do
it 'calls add_supplemental_files' do
expect(master_file).to receive(:update_derivatives).with(array_including(hash_including(label: 'quality-high')))
expect(master_file).to receive(:add_supplemental_files).with(array_including(1))
expect(master_file).to receive(:run_hook).with(:after_transcoding)
Expand Down

0 comments on commit 56f3507

Please sign in to comment.