Skip to content

Commit

Permalink
dispatchConversions in replace
Browse files Browse the repository at this point in the history
  • Loading branch information
QuentinGab committed Oct 19, 2024
1 parent 820e038 commit 20deb0e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Jobs/MediaConversionJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -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}",
];
}
Expand Down
7 changes: 6 additions & 1 deletion src/Models/Media.php
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,11 @@ public function replaceConversion(
);
}

$this->dispatchConversions(
parent: $conversion,
filter: fn ($definition) => $definition->immediate
);

return $conversion;
}

Expand Down Expand Up @@ -398,7 +403,7 @@ public function dispatchConversions(
continue;
}

if ($definition->queued || $queued === true) {
if ($queued ?? $definition->queued) {
$definition->dispatch(
media: $this,
parent: $parent,
Expand Down

0 comments on commit 20deb0e

Please sign in to comment.