From 20deb0e13c6ba0c2eb2a12990fadda88fc7953e2 Mon Sep 17 00:00:00 2001 From: Quentin Gabriele Date: Sat, 19 Oct 2024 14:57:28 +0200 Subject: [PATCH] dispatchConversions in replace --- src/Jobs/MediaConversionJob.php | 2 +- src/Models/Media.php | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Jobs/MediaConversionJob.php b/src/Jobs/MediaConversionJob.php index b209477..73ad122 100644 --- a/src/Jobs/MediaConversionJob.php +++ b/src/Jobs/MediaConversionJob.php @@ -46,8 +46,8 @@ public function tags(): array { return [ 'media', - $this->media->id, $this->conversion, + get_class($this->media).':'.$this->media->id, "{$this->media->model_type}:{$this->media->model_id}", ]; } diff --git a/src/Models/Media.php b/src/Models/Media.php index 4909b5d..d6664c0 100644 --- a/src/Models/Media.php +++ b/src/Models/Media.php @@ -311,6 +311,11 @@ public function replaceConversion( ); } + $this->dispatchConversions( + parent: $conversion, + filter: fn ($definition) => $definition->immediate + ); + return $conversion; } @@ -398,7 +403,7 @@ public function dispatchConversions( continue; } - if ($definition->queued || $queued === true) { + if ($queued ?? $definition->queued) { $definition->dispatch( media: $this, parent: $parent,