also looking at this
meemalabs/laravel-media-converter
fix: add tagging fix
#19
1 file
+8
-18
| @@ -19,9 +19,9 @@ class CreateVideoConversion implements ShouldQueue | ||
| 19 | 19 | private array $jobSettings; |
| 20 | 20 | |
| 21 | 21 | /** |
| 22 | * @var int | |
| 22 | * @var array | |
| 23 | 23 | */ |
| 24 | private int $mediaId; | |
| 24 | private int $metaData; | |
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | 27 | * @var array |
| @@ -31,18 +31,15 @@ class CreateVideoConversion implements ShouldQueue | ||
| 31 | 31 | /** |
| 32 | 32 | * Create a new job instance. |
| 33 | 33 | * |
| 34 | * @param $jobSettings | |
| 35 | * @param $tags | |
| 36 | * @param $mediaId | |
| 34 | * @param array $jobSettings | |
| 35 | * @param array $metadata | |
| 36 | * @param array $tags | |
| 37 | 37 | */ |
| 38 | public function __construct($jobSettings, $tags, $mediaId = null) | |
| 38 | public function __construct($jobSettings, $metaData = [], $tags = []) | |
| 39 | 39 | { |
| 40 | 40 | $this->jobSettings = $jobSettings; |
| 41 | $this->metaData = $metaData; | |
| 41 | 42 | $this->tags = $tags; |
| 42 | ||
| 43 | if ($mediaId) { | |
| 44 | $this->mediaId = $mediaId; | |
| 45 | } | |
| 46 | 43 | } |
| 47 | 44 | |
| 48 | 45 | /** |
| @@ -52,13 +49,6 @@ class CreateVideoConversion implements ShouldQueue | ||
| 52 | 49 | */ |
| 53 | 50 | public function handle() |
| 54 | 51 | { |
| 55 | $metaData = []; | |
| 56 | $tags = $this->tags; | |
| 57 | ||
| 58 | if ($this->mediaId) { | |
| 59 | $metaData = ['model_id' => $this->mediaId]; | |
| 60 | } | |
| 61 | ||
| 62 | MediaConvert::createJob($this->jobSettings, $metaData, $tags); | |
| 52 | MediaConvert::createJob($this->jobSettings, $this->metaData, $this->tags); | |
| 63 | 53 | } |
| 64 | 54 | } |