Skip to content

Commit

Permalink
Add timestamp methods support for shingocoder
Browse files Browse the repository at this point in the history
  • Loading branch information
cjcolvar committed Dec 2, 2015
1 parent d95ce45 commit 5e68c05
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/active_encode/engine_adapters/shingoncoder_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ def build_encode(job_details, cast)
progress = job_progress(encode.id)
encode.current_operations = convert_current_operations(progress)
encode.percent_complete = convert_percent_complete(progress, job_details)
encode.created_at = job_details.body["job"]["created_at"]
encode.updated_at = job_details.body["job"]["updated_at"]
encode.finished_at = job_details.body["job"]["finished_at"]
encode.output = convert_output(job_details)
encode.errors = convert_errors(job_details)
encode.tech_metadata = convert_tech_metadata(job_details.body["job"]["input_media_file"])
Expand Down
18 changes: 18 additions & 0 deletions spec/integration/shingoncoder_adapter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
its(:current_operations) { is_expected.to be_empty }
its(:percent_complete) { is_expected.to eq 0 }
its(:errors) { is_expected.to be_empty }
its(:created_at) { is_expected.to eq '2015-06-10T14:38:47Z' }
its(:updated_at) { is_expected.to eq '2015-06-10T14:38:47Z' }
its(:finished_at) { is_expected.to be_nil }
its(:tech_metadata) { is_expected.to be_empty }
end

Expand All @@ -59,6 +62,9 @@
its(:current_operations) { is_expected.to be_empty }
its(:percent_complete) { is_expected.to eq 30.0 }
its(:errors) { is_expected.to be_empty }
its(:created_at) { is_expected.to eq '2015-06-09T16:18:26Z' }
its(:updated_at) { is_expected.to eq '2015-06-09T16:18:28Z' }
its(:finished_at) { is_expected.to be_nil }
its(:tech_metadata) { is_expected.to eq running_tech_metadata }
end

Expand All @@ -73,6 +79,9 @@
its(:current_operations) { is_expected.to be_empty }
its(:percent_complete) { is_expected.to eq 0 }
its(:errors) { is_expected.to be_empty }
its(:created_at) { is_expected.to eq '2015-06-08T20:43:23Z' }
its(:updated_at) { is_expected.to eq '2015-06-08T20:43:26Z' }
its(:finished_at) { is_expected.to eq '2015-06-08T20:43:26Z' }
its(:tech_metadata) { is_expected.to be_empty }
end

Expand All @@ -90,6 +99,9 @@
its(:current_operations) { is_expected.to be_empty }
its(:percent_complete) { is_expected.to eq 100 }
its(:errors) { is_expected.to be_empty }
its(:created_at) { is_expected.to eq '2015-06-08T18:13:53Z' }
its(:updated_at) { is_expected.to eq '2015-06-08T18:14:06Z' }
its(:finished_at) { is_expected.to eq '2015-06-08T18:14:06Z' }
its(:tech_metadata) { is_expected.to eq completed_tech_metadata }
end

Expand All @@ -106,6 +118,9 @@
its(:current_operations) { is_expected.to be_empty }
its(:percent_complete) { is_expected.to eq 0 }
its(:errors) { is_expected.to include failed_errors }
its(:created_at) { is_expected.to eq '2015-06-09T20:52:57Z' }
its(:updated_at) { is_expected.to eq '2015-06-09T20:53:00Z' }
its(:finished_at) { is_expected.to eq '2015-06-09T20:53:00Z' }
its(:tech_metadata) { is_expected.to be_empty }
end
end
Expand Down Expand Up @@ -147,6 +162,9 @@
its(:current_operations) { is_expected.to be_empty }
its(:percent_complete) { is_expected.to eq 30.0 }
its(:errors) { is_expected.to be_empty }
its(:created_at) { is_expected.to eq '2015-06-09T16:18:26Z' }
its(:updated_at) { is_expected.to eq '2015-06-09T16:18:28Z' }
its(:finished_at) { is_expected.to be_nil }
its(:tech_metadata) { is_expected.to eq reload_tech_metadata }
end
end

0 comments on commit 5e68c05

Please sign in to comment.