ReviewOS

also looking at this

meemalabs/laravel-media-converter

feat: add support for tagging

#17
Merged glennmichael123 wants to merge add-tags into main
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.

src/Facades/MediaConvert.phpmodified+1-1
Changes to src/Facades/MediaConvert.php
@@ -11,7 +11,7 @@ use Illuminate\Support\Facades\Facade;
1111 * @method static \Meema\MediaConverter\Converters\MediaConvert withThumbnails(int $framerateNumerator, int $framerateDenominator, int $maxCaptures, $width = null, $nameModifier = null, $imageQuality = 80)
1212 * @method static \Aws\Result saveTo(string $s3Path, $s3bucket = null)
1313 * @method static \Aws\Result cancelJob(string $id)
14 * @method static \Aws\Result createJob(array $settings, array $metaData = [], int $priority = 0)
14 * @method static \Aws\Result createJob(array $settings, array $metaData = [], array $tags = [], int $priority = 0)
1515 * @method static \Aws\Result getJob(string $id)
1616 * @method static \Aws\Result listJobs(array $options)
1717 */
src/Jobs/CreateVideoConversion.phpmodified+15-10
Changes to src/Jobs/CreateVideoConversion.php
@@ -13,27 +13,36 @@ class CreateVideoConversion implements ShouldQueue
1313{
1414 use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
1515
16 /**
17 * @var array
18 */
1619 private array $jobSettings;
1720
21 /**
22 * @var int
23 */
1824 private int $mediaId;
1925
26 /**
27 * @var array
28 */
29 private array $tags;
30
2031 /**
2132 * Create a new job instance.
2233 *
2334 * @param $jobSettings
35 * @param $tags
2436 * @param $mediaId
2537 */
26 public function __construct($jobSettings, $mediaId = null, $teamId = null)
38 public function __construct($jobSettings, $tags, $mediaId = null)
2739 {
2840 $this->jobSettings = $jobSettings;
41 $this->tags = $tags;
2942
3043 if ($mediaId) {
3144 $this->mediaId = $mediaId;
3245 }
33
34 if ($teamId) {
35 $this->teamId = $teamId;
36 }
3746 }
3847
3948 /**
@@ -44,16 +53,12 @@ class CreateVideoConversion implements ShouldQueue
4453 public function handle()
4554 {
4655 $metaData = [];
47 $tags = [];
56 $tags = $this->tags;
4857
4958 if ($this->mediaId) {
5059 $metaData = ['model_id' => $this->mediaId];
5160 }
5261
53 if ($this->teamId) {
54 $tags = ['team_id' => $this->teamId];
55 }
56
5762 MediaConvert::createJob($this->jobSettings, $metaData, $tags);
5863 }
5964}