Skip to content

Commit 5e68c05

Browse files
committed
Add timestamp methods support for shingocoder
1 parent d95ce45 commit 5e68c05

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

lib/active_encode/engine_adapters/shingoncoder_adapter.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ def build_encode(job_details, cast)
4646
progress = job_progress(encode.id)
4747
encode.current_operations = convert_current_operations(progress)
4848
encode.percent_complete = convert_percent_complete(progress, job_details)
49+
encode.created_at = job_details.body["job"]["created_at"]
50+
encode.updated_at = job_details.body["job"]["updated_at"]
51+
encode.finished_at = job_details.body["job"]["finished_at"]
4952
encode.output = convert_output(job_details)
5053
encode.errors = convert_errors(job_details)
5154
encode.tech_metadata = convert_tech_metadata(job_details.body["job"]["input_media_file"])

spec/integration/shingoncoder_adapter_spec.rb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
its(:current_operations) { is_expected.to be_empty }
3737
its(:percent_complete) { is_expected.to eq 0 }
3838
its(:errors) { is_expected.to be_empty }
39+
its(:created_at) { is_expected.to eq '2015-06-10T14:38:47Z' }
40+
its(:updated_at) { is_expected.to eq '2015-06-10T14:38:47Z' }
41+
its(:finished_at) { is_expected.to be_nil }
3942
its(:tech_metadata) { is_expected.to be_empty }
4043
end
4144

@@ -59,6 +62,9 @@
5962
its(:current_operations) { is_expected.to be_empty }
6063
its(:percent_complete) { is_expected.to eq 30.0 }
6164
its(:errors) { is_expected.to be_empty }
65+
its(:created_at) { is_expected.to eq '2015-06-09T16:18:26Z' }
66+
its(:updated_at) { is_expected.to eq '2015-06-09T16:18:28Z' }
67+
its(:finished_at) { is_expected.to be_nil }
6268
its(:tech_metadata) { is_expected.to eq running_tech_metadata }
6369
end
6470

@@ -73,6 +79,9 @@
7379
its(:current_operations) { is_expected.to be_empty }
7480
its(:percent_complete) { is_expected.to eq 0 }
7581
its(:errors) { is_expected.to be_empty }
82+
its(:created_at) { is_expected.to eq '2015-06-08T20:43:23Z' }
83+
its(:updated_at) { is_expected.to eq '2015-06-08T20:43:26Z' }
84+
its(:finished_at) { is_expected.to eq '2015-06-08T20:43:26Z' }
7685
its(:tech_metadata) { is_expected.to be_empty }
7786
end
7887

@@ -90,6 +99,9 @@
9099
its(:current_operations) { is_expected.to be_empty }
91100
its(:percent_complete) { is_expected.to eq 100 }
92101
its(:errors) { is_expected.to be_empty }
102+
its(:created_at) { is_expected.to eq '2015-06-08T18:13:53Z' }
103+
its(:updated_at) { is_expected.to eq '2015-06-08T18:14:06Z' }
104+
its(:finished_at) { is_expected.to eq '2015-06-08T18:14:06Z' }
93105
its(:tech_metadata) { is_expected.to eq completed_tech_metadata }
94106
end
95107

@@ -106,6 +118,9 @@
106118
its(:current_operations) { is_expected.to be_empty }
107119
its(:percent_complete) { is_expected.to eq 0 }
108120
its(:errors) { is_expected.to include failed_errors }
121+
its(:created_at) { is_expected.to eq '2015-06-09T20:52:57Z' }
122+
its(:updated_at) { is_expected.to eq '2015-06-09T20:53:00Z' }
123+
its(:finished_at) { is_expected.to eq '2015-06-09T20:53:00Z' }
109124
its(:tech_metadata) { is_expected.to be_empty }
110125
end
111126
end
@@ -147,6 +162,9 @@
147162
its(:current_operations) { is_expected.to be_empty }
148163
its(:percent_complete) { is_expected.to eq 30.0 }
149164
its(:errors) { is_expected.to be_empty }
165+
its(:created_at) { is_expected.to eq '2015-06-09T16:18:26Z' }
166+
its(:updated_at) { is_expected.to eq '2015-06-09T16:18:28Z' }
167+
its(:finished_at) { is_expected.to be_nil }
150168
its(:tech_metadata) { is_expected.to eq reload_tech_metadata }
151169
end
152170
end

0 commit comments

Comments
 (0)