also looking at this
meemalabs/laravel-media-converter
feat: add support for tagging
#17
4 files
+20
-5
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.
| @@ -58,7 +58,7 @@ interface Converter | ||
| 58 | 58 | * @param int $priority |
| 59 | 59 | * @return \Aws\Result |
| 60 | 60 | */ |
| 61 | public function createJob(array $settings, array $metaData, int $priority); | |
| 61 | public function createJob(array $settings, array $metaData, array $tags, int $priority); | |
| 62 | 62 | |
| 63 | 63 | /** |
| 64 | 64 | * Gets the job. |
| @@ -146,13 +146,14 @@ class MediaConvert implements Converter | ||
| 146 | 146 | * @param int $priority |
| 147 | 147 | * @return \Aws\Result |
| 148 | 148 | */ |
| 149 | public function createJob(array $settings, array $metaData = [], int $priority = 0) | |
| 149 | public function createJob(array $settings, array $metaData = [], array $tags = [], int $priority = 0) | |
| 150 | 150 | { |
| 151 | 151 | return $this->client->createJob([ |
| 152 | 152 | 'Role' => config('media-converter.iam_arn'), |
| 153 | 153 | 'Settings' => $settings, |
| 154 | 154 | 'Queue' => config('media-converter.queue_arn'), |
| 155 | 155 | 'UserMetadata' => $metaData, |
| 156 | 'Tags' => $tags, | |
| 156 | 157 | 'StatusUpdateInterval' => $this->getStatusUpdateInterval(), |
| 157 | 158 | 'Priority' => $priority, |
| 158 | 159 | ]); |
| @@ -40,11 +40,18 @@ class CreateVideoConversion implements ShouldQueue | ||
| 40 | 40 | public function handle() |
| 41 | 41 | { |
| 42 | 42 | $metaData = []; |
| 43 | ||
| 43 | $tags = []; | |
| 44 | ||
| 44 | 45 | if ($this->mediaId) { |
| 45 | 46 | $metaData = ['model_id' => $this->mediaId]; |
| 46 | 47 | } |
| 47 | 48 | |
| 48 | MediaConvert::createJob($this->jobSettings, $metaData); | |
| 49 | if ($this->teamId) { | |
| 50 | $tags = ['team_id' => $this->teamId]; | |
| 51 | } | |
| 52 | ||
| 53 | ||
| 54 | ||
| 55 | MediaConvert::createJob($this->jobSettings, $metaData, $tags); | |
| 49 | 56 | } |
| 50 | 57 | } |