ReviewOS

also looking at this

meemalabs/laravel-media-converter

Apply fixes from StyleCI

#7
Merged chris wants to merge analysis-WN3dLe into master
2 files +209 -210

Review threads live on the whole diff, not on one commit, so none are shown here - a thread's line means something in the branch's final form, and painting it into an intermediate step would put it on code it is not about.

src/Traits/HasMediaConversions.phpmodified+0-1
Changes to src/Traits/HasMediaConversions.php
@@ -2,7 +2,6 @@
22
33namespace Meema\MediaConvert\Traits;
44
5use Illuminate\Database\Eloquent\Relations\MorphMany;
65use Meema\MediaConvert\Models\MediaConversion;
76
87trait HasMediaConversions
tests/DummyMessages.phpmodified+209-209
Changes to tests/DummyMessages.php
@@ -24,275 +24,275 @@ class DummyMessages
2424 ];
2525
2626 protected array $progressing = [
27 "version" => "0",
28 "id" => "c5aebd1c-2c6a-ace0-3ab3-9945f986b4c4",
29 "detail-type" => "MediaConvert Job State Change",
30 "source" => "aws.mediaconvert",
31 "account" => "923076644019",
32 "time" => "2020-11-28T04:58:31Z",
33 "region" => "us-east-2",
34 "resources" => [
35 "arn:aws:mediaconvert:us-east-2:923076644019:jobs/1606539508649-2fu0hb",
27 'version' => '0',
28 'id' => 'c5aebd1c-2c6a-ace0-3ab3-9945f986b4c4',
29 'detail-type' => 'MediaConvert Job State Change',
30 'source' => 'aws.mediaconvert',
31 'account' => '923076644019',
32 'time' => '2020-11-28T04:58:31Z',
33 'region' => 'us-east-2',
34 'resources' => [
35 'arn:aws:mediaconvert:us-east-2:923076644019:jobs/1606539508649-2fu0hb',
3636 ],
37 "detail" => [
38 "timestamp" => 1606539511533,
39 "accountId" => "923076644019",
40 "queue" => "arn:aws:mediaconvert:us-east-2:923076644019:queues/Default",
41 "jobId" => "1606539508649-2fu0hb",
42 "status" => "PROGRESSING",
43 "userMetadata" => [
44 "model_id" => "21",
45 "hello" => "world",
37 'detail' => [
38 'timestamp' => 1606539511533,
39 'accountId' => '923076644019',
40 'queue' => 'arn:aws:mediaconvert:us-east-2:923076644019:queues/Default',
41 'jobId' => '1606539508649-2fu0hb',
42 'status' => 'PROGRESSING',
43 'userMetadata' => [
44 'model_id' => '21',
45 'hello' => 'world',
4646 ],
4747 ],
4848 ];
4949
5050 protected array $statusUpdate = [
51 "version" => "0",
52 "id" => "810b18d6-8abd-03dd-5e1d-b0c52f387a05",
53 "detail-type" => "MediaConvert Job State Change",
54 "source" => "aws.mediaconvert",
55 "account" => "923076644019",
56 "time" => "2020-11-28T04:58:34Z",
57 "region" => "us-east-2",
58 "resources" => [
59 "arn:aws:mediaconvert:us-east-2:923076644019:jobs/1606539508649-2fu0hb",
51 'version' => '0',
52 'id' => '810b18d6-8abd-03dd-5e1d-b0c52f387a05',
53 'detail-type' => 'MediaConvert Job State Change',
54 'source' => 'aws.mediaconvert',
55 'account' => '923076644019',
56 'time' => '2020-11-28T04:58:34Z',
57 'region' => 'us-east-2',
58 'resources' => [
59 'arn:aws:mediaconvert:us-east-2:923076644019:jobs/1606539508649-2fu0hb',
6060 ],
61 "detail" => [
62 "timestamp" => 1606539514554,
63 "accountId" => "923076644019",
64 "queue" => "arn:aws:mediaconvert:us-east-2:923076644019:queues/Default",
65 "jobId" => "1606539508649-2fu0hb",
66 "status" => "STATUS_UPDATE",
67 "userMetadata" => [
68 "model_id" => "21",
69 "hello" => "world",
61 'detail' => [
62 'timestamp' => 1606539514554,
63 'accountId' => '923076644019',
64 'queue' => 'arn:aws:mediaconvert:us-east-2:923076644019:queues/Default',
65 'jobId' => '1606539508649-2fu0hb',
66 'status' => 'STATUS_UPDATE',
67 'userMetadata' => [
68 'model_id' => '21',
69 'hello' => 'world',
7070 ],
71 "framesDecoded" => 0,
72 "jobProgress" => [
73 "phaseProgress" => [
74 "PROBING" => [
75 "status" => "COMPLETE",
76 "percentComplete" => 100,
71 'framesDecoded' => 0,
72 'jobProgress' => [
73 'phaseProgress' => [
74 'PROBING' => [
75 'status' => 'COMPLETE',
76 'percentComplete' => 100,
7777 ],
78 "TRANSCODING" => [
79 "status" => "PENDING",
80 "percentComplete" => 0,
78 'TRANSCODING' => [
79 'status' => 'PENDING',
80 'percentComplete' => 0,
8181 ],
82 "UPLOADING" => [
83 "status" => "PENDING",
84 "percentComplete" => 0,
82 'UPLOADING' => [
83 'status' => 'PENDING',
84 'percentComplete' => 0,
8585 ],
8686 ],
87 "jobPercentComplete" => 0,
88 "currentPhase" => "TRANSCODING",
89 "retryCount" => 0,
87 'jobPercentComplete' => 0,
88 'currentPhase' => 'TRANSCODING',
89 'retryCount' => 0,
9090 ],
9191 ],
9292 ];
9393
9494 protected array $statusUpdate2 = [
95 "version" => "0",
96 "id" => "7f0eae16-c6d9-5511-0f77-93d2cbead642",
97 "detail-type" => "MediaConvert Job State Change",
98 "source" => "aws.mediaconvert",
99 "account" => "923076644019",
100 "time" => "2020-11-28T04:59:51Z",
101 "region" => "us-east-2",
102 "resources" => [
103 "arn:aws:mediaconvert:us-east-2:923076644019:jobs/1606539508649-2fu0hb",
95 'version' => '0',
96 'id' => '7f0eae16-c6d9-5511-0f77-93d2cbead642',
97 'detail-type' => 'MediaConvert Job State Change',
98 'source' => 'aws.mediaconvert',
99 'account' => '923076644019',
100 'time' => '2020-11-28T04:59:51Z',
101 'region' => 'us-east-2',
102 'resources' => [
103 'arn:aws:mediaconvert:us-east-2:923076644019:jobs/1606539508649-2fu0hb',
104104 ],
105 "detail" => [
106 "timestamp" => 1606539591681,
107 "accountId" => "923076644019",
108 "queue" => "arn:aws:mediaconvert:us-east-2:923076644019:queues/Default",
109 "jobId" => "1606539508649-2fu0hb",
110 "status" => "STATUS_UPDATE",
111 "userMetadata" => [
112 "model_id" => "21",
113 "hello" => "world",
105 'detail' => [
106 'timestamp' => 1606539591681,
107 'accountId' => '923076644019',
108 'queue' => 'arn:aws:mediaconvert:us-east-2:923076644019:queues/Default',
109 'jobId' => '1606539508649-2fu0hb',
110 'status' => 'STATUS_UPDATE',
111 'userMetadata' => [
112 'model_id' => '21',
113 'hello' => 'world',
114114 ],
115 "framesDecoded" => 1414,
116 "jobProgress" => [
117 "phaseProgress" => [
118 "PROBING" => [
119 "status" => "COMPLETE",
120 "percentComplete" => 100,
115 'framesDecoded' => 1414,
116 'jobProgress' => [
117 'phaseProgress' => [
118 'PROBING' => [
119 'status' => 'COMPLETE',
120 'percentComplete' => 100,
121121 ],
122 "TRANSCODING" => [
123 "status" => "COMPLETE",
124 "percentComplete" => 100,
122 'TRANSCODING' => [
123 'status' => 'COMPLETE',
124 'percentComplete' => 100,
125125 ],
126 "UPLOADING" => [
127 "status" => "PROGRESSING",
126 'UPLOADING' => [
127 'status' => 'PROGRESSING',
128128 ],
129129 ],
130 "jobPercentComplete" => 66,
131 "currentPhase" => "TRANSCODING",
132 "retryCount" => 0,
130 'jobPercentComplete' => 66,
131 'currentPhase' => 'TRANSCODING',
132 'retryCount' => 0,
133133 ],
134134 ],
135135 ];
136136
137137 protected array $complete = [
138 "version" => "0",
139 "id" => "3b9aa7e1-45ab-cf2a-1787-913f4452d16b",
140 "detail-type" => "MediaConvert Job State Change",
141 "source" => "aws.mediaconvert",
142 "account" => "923076644019",
143 "time" => "2020-11-28T05:00:03Z",
144 "region" => "us-east-2",
145 "resources" => [
146 "arn:aws:mediaconvert:us-east-2:923076644019:jobs/1606539508649-2fu0hb",
138 'version' => '0',
139 'id' => '3b9aa7e1-45ab-cf2a-1787-913f4452d16b',
140 'detail-type' => 'MediaConvert Job State Change',
141 'source' => 'aws.mediaconvert',
142 'account' => '923076644019',
143 'time' => '2020-11-28T05:00:03Z',
144 'region' => 'us-east-2',
145 'resources' => [
146 'arn:aws:mediaconvert:us-east-2:923076644019:jobs/1606539508649-2fu0hb',
147147 ],
148 "detail" => [
149 "timestamp" => 1606539603045,
150 "accountId" => "923076644019",
151 "queue" => "arn:aws:mediaconvert:us-east-2:923076644019:queues/Default",
152 "jobId" => "1606539508649-2fu0hb",
153 "status" => "COMPLETE",
154 "userMetadata" => [
155 "model_id" => "21",
156 "hello" => "world",
148 'detail' => [
149 'timestamp' => 1606539603045,
150 'accountId' => '923076644019',
151 'queue' => 'arn:aws:mediaconvert:us-east-2:923076644019:queues/Default',
152 'jobId' => '1606539508649-2fu0hb',
153 'status' => 'COMPLETE',
154 'userMetadata' => [
155 'model_id' => '21',
156 'hello' => 'world',
157157 ],
158 "outputGroupDetails" => [
158 'outputGroupDetails' => [
159159 [
160 "outputDetails" => [
160 'outputDetails' => [
161161 [
162 "durationInMs" => 0,
163 "videoDetails" => [
164 "widthInPx" => 0,
165 "heightInPx" => 0,
162 'durationInMs' => 0,
163 'videoDetails' => [
164 'widthInPx' => 0,
165 'heightInPx' => 0,
166166 ],
167167 ],
168168 ],
169 "type" => "FILE_GROUP",
169 'type' => 'FILE_GROUP',
170170 ],
171171 [
172 "outputDetails" => [
172 'outputDetails' => [
173173 [
174 "outputFilePaths" => [
175 "s3://meema-stage/chris/1/isI2oN3/hls/Raindrops_Videvo_1.m3u8",
174 'outputFilePaths' => [
175 's3://meema-stage/chris/1/isI2oN3/hls/Raindrops_Videvo_1.m3u8',
176176 ],
177 "durationInMs" => 58975,
178 "videoDetails" => [
179 "widthInPx" => 1920,
180 "heightInPx" => 1080,
177 'durationInMs' => 58975,
178 'videoDetails' => [
179 'widthInPx' => 1920,
180 'heightInPx' => 1080,
181181 ],
182182 ],
183183 [
184 "outputFilePaths" => [
185 "s3://meema-stage/chris/1/isI2oN3/hls/Raindrops_Videvo_2.m3u8",
184 'outputFilePaths' => [
185 's3://meema-stage/chris/1/isI2oN3/hls/Raindrops_Videvo_2.m3u8',
186186 ],
187 "durationInMs" => 58975,
188 "videoDetails" => [
189 "widthInPx" => 1920,
190 "heightInPx" => 1080,
187 'durationInMs' => 58975,
188 'videoDetails' => [
189 'widthInPx' => 1920,
190 'heightInPx' => 1080,
191191 ],
192192 ],
193193 [
194 "outputFilePaths" => [
195 "s3://meema-stage/chris/1/isI2oN3/hls/Raindrops_Videvo_3.m3u8",
194 'outputFilePaths' => [
195 's3://meema-stage/chris/1/isI2oN3/hls/Raindrops_Videvo_3.m3u8',
196196 ],
197 "durationInMs" => 58975,
198 "videoDetails" => [
199 "widthInPx" => 1280,
200 "heightInPx" => 720,
197 'durationInMs' => 58975,
198 'videoDetails' => [
199 'widthInPx' => 1280,
200 'heightInPx' => 720,
201201 ],
202202 ],
203203 [
204 "outputFilePaths" => [
205 "s3://meema-stage/chris/1/isI2oN3/hls/Raindrops_Videvo_4.m3u8",
204 'outputFilePaths' => [
205 's3://meema-stage/chris/1/isI2oN3/hls/Raindrops_Videvo_4.m3u8',
206206 ],
207 "durationInMs" => 58975,
208 "videoDetails" => [
209 "widthInPx" => 960,
210 "heightInPx" => 540,
207 'durationInMs' => 58975,
208 'videoDetails' => [
209 'widthInPx' => 960,
210 'heightInPx' => 540,
211211 ],
212212 ],
213213 [
214 "outputFilePaths" => [
215 "s3://meema-stage/chris/1/isI2oN3/hls/Raindrops_Videvo_5.m3u8",
214 'outputFilePaths' => [
215 's3://meema-stage/chris/1/isI2oN3/hls/Raindrops_Videvo_5.m3u8',
216216 ],
217 "durationInMs" => 58975,
218 "videoDetails" => [
219 "widthInPx" => 768,
220 "heightInPx" => 432,
217 'durationInMs' => 58975,
218 'videoDetails' => [
219 'widthInPx' => 768,
220 'heightInPx' => 432,
221221 ],
222222 ],
223223 [
224 "outputFilePaths" => [
225 "s3://meema-stage/chris/1/isI2oN3/hls/Raindrops_Videvo_6.m3u8",
224 'outputFilePaths' => [
225 's3://meema-stage/chris/1/isI2oN3/hls/Raindrops_Videvo_6.m3u8',
226226 ],
227 "durationInMs" => 58975,
228 "videoDetails" => [
229 "widthInPx" => 640,
230 "heightInPx" => 360,
227 'durationInMs' => 58975,
228 'videoDetails' => [
229 'widthInPx' => 640,
230 'heightInPx' => 360,
231231 ],
232232 ],
233233 ],
234 "playlistFilePaths" => [
235 "s3://meema-stage/chris/1/isI2oN3/hls/Raindrops_Videvo.m3u8",
234 'playlistFilePaths' => [
235 's3://meema-stage/chris/1/isI2oN3/hls/Raindrops_Videvo.m3u8',
236236 ],
237 "type" => "HLS_GROUP",
237 'type' => 'HLS_GROUP',
238238 ],
239239 [
240 "outputDetails" => [
240 'outputDetails' => [
241241 [
242 "outputFilePaths" => [
243 "s3://meema-stage/chris/1/isI2oN3/mp4/Raindrops_Videvo.mp4",
242 'outputFilePaths' => [
243 's3://meema-stage/chris/1/isI2oN3/mp4/Raindrops_Videvo.mp4',
244244 ],
245 "durationInMs" => 58975,
246 "videoDetails" => [
247 "widthInPx" => 1920,
248 "heightInPx" => 1080,
245 'durationInMs' => 58975,
246 'videoDetails' => [
247 'widthInPx' => 1920,
248 'heightInPx' => 1080,
249249 ],
250250 ],
251251 ],
252 "type" => "FILE_GROUP",
252 'type' => 'FILE_GROUP',
253253 ],
254254 ],
255255 ],
256256 ];
257257
258258 protected array $inputInformation = [
259 "version" => "0",
260 "id" => "e9ebf388-8936-bd57-64e3-c2c1f1d78897",
261 "detail-type" => "MediaConvert Job State Change",
262 "source" => "aws.mediaconvert",
263 "account" => "923076644019",
264 "time" => "2020-11-28T05:00:02Z",
265 "region" => "us-east-2",
266 "resources" => [
267 "arn:aws:mediaconvert:us-east-2:923076644019:jobs/1606539508649-2fu0hb",
259 'version' => '0',
260 'id' => 'e9ebf388-8936-bd57-64e3-c2c1f1d78897',
261 'detail-type' => 'MediaConvert Job State Change',
262 'source' => 'aws.mediaconvert',
263 'account' => '923076644019',
264 'time' => '2020-11-28T05:00:02Z',
265 'region' => 'us-east-2',
266 'resources' => [
267 'arn:aws:mediaconvert:us-east-2:923076644019:jobs/1606539508649-2fu0hb',
268268 ],
269 "detail" => [
270 "timestamp" => 1606539602895,
271 "accountId" => "923076644019",
272 "queue" => "arn:aws:mediaconvert:us-east-2:923076644019:queues/Default",
273 "jobId" => "1606539508649-2fu0hb",
274 "status" => "INPUT_INFORMATION",
275 "userMetadata" => [
276 "model_id" => "21",
277 "hello" => "world",
269 'detail' => [
270 'timestamp' => 1606539602895,
271 'accountId' => '923076644019',
272 'queue' => 'arn:aws:mediaconvert:us-east-2:923076644019:queues/Default',
273 'jobId' => '1606539508649-2fu0hb',
274 'status' => 'INPUT_INFORMATION',
275 'userMetadata' => [
276 'model_id' => '21',
277 'hello' => 'world',
278278 ],
279 "inputDetails" => [
279 'inputDetails' => [
280280 [
281 "id" => 1,
282 "uri" => "s3://meema-stage/chris/1/isI2oN3/Raindrops_Videvo.mp4",
283 "video" => [
281 'id' => 1,
282 'uri' => 's3://meema-stage/chris/1/isI2oN3/Raindrops_Videvo.mp4',
283 'video' => [
284284 [
285 "bitDepth" => 8,
286 "codec" => "H_264",
287 "colorFormat" => "YUV_420",
288 "fourCC" => "avc1",
289 "frameRate" => 23.98,
290 "height" => 1080,
291 "interlaceMode" => "PROGRESSIVE",
292 "sar" => "1:1",
293 "standard" => "UNSPECIFIED",
294 "streamId" => 1,
295 "width" => 1920,
285 'bitDepth' => 8,
286 'codec' => 'H_264',
287 'colorFormat' => 'YUV_420',
288 'fourCC' => 'avc1',
289 'frameRate' => 23.98,
290 'height' => 1080,
291 'interlaceMode' => 'PROGRESSIVE',
292 'sar' => '1:1',
293 'standard' => 'UNSPECIFIED',
294 'streamId' => 1,
295 'width' => 1920,
296296 ],
297297 ],
298298 ],
@@ -301,27 +301,27 @@ class DummyMessages
301301 ];
302302
303303 protected array $error = [
304 "version" => "0",
305 "id" => "916792ce-208f-d04a-db2f-a573cf9b08bd",
306 "detail-type" => "MediaConvert Job State Change",
307 "source" => "aws.mediaconvert",
308 "account" => "923076644019",
309 "time" => "2020-11-28T05:56:51Z",
310 "region" => "us-east-2",
311 "resources" => [
312 "arn:aws:mediaconvert:us-east-2:923076644019:jobs/1606542703411-00h7yw",
304 'version' => '0',
305 'id' => '916792ce-208f-d04a-db2f-a573cf9b08bd',
306 'detail-type' => 'MediaConvert Job State Change',
307 'source' => 'aws.mediaconvert',
308 'account' => '923076644019',
309 'time' => '2020-11-28T05:56:51Z',
310 'region' => 'us-east-2',
311 'resources' => [
312 'arn:aws:mediaconvert:us-east-2:923076644019:jobs/1606542703411-00h7yw',
313313 ],
314 "detail" => [
315 "timestamp" => 1606543011394,
316 "accountId" => "923076644019",
317 "queue" => "arn:aws:mediaconvert:us-east-2:923076644019:queues/Default",
318 "jobId" => "1606542703411-00h7yw",
319 "status" => "ERROR",
320 "errorCode" => 1404,
321 "errorMessage" => "Unable to open input file [s3://meema-stage/chris/1/AoTef8Z/Raindrops_Videvo.mp4]: [Failed probe/open: [Failed to read data: HeadObject failed]]",
322 "userMetadata" => [
323 "model_id" => "23",
324 "hello" => "world",
314 'detail' => [
315 'timestamp' => 1606543011394,
316 'accountId' => '923076644019',
317 'queue' => 'arn:aws:mediaconvert:us-east-2:923076644019:queues/Default',
318 'jobId' => '1606542703411-00h7yw',
319 'status' => 'ERROR',
320 'errorCode' => 1404,
321 'errorMessage' => 'Unable to open input file [s3://meema-stage/chris/1/AoTef8Z/Raindrops_Videvo.mp4]: [Failed probe/open: [Failed to read data: HeadObject failed]]',
322 'userMetadata' => [
323 'model_id' => '23',
324 'hello' => 'world',
325325 ],
326326 ],
327327 ];