Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip path logic when not needed #3682

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/Conversions/FileManipulator.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,17 @@ public function performConversions(

$conversions
->reject(function (Conversion $conversion) use ($onlyMissing, $media) {
if (! $onlyMissing) {
return false;
}

$relativePath = $media->getPath($conversion->getName());

if ($rootPath = config("filesystems.disks.{$media->disk}.root")) {
$relativePath = str_replace($rootPath, '', $relativePath);
}

return $onlyMissing && Storage::disk($media->disk)->exists($relativePath);
return Storage::disk($media->disk)->exists($relativePath);
})
->each(function (Conversion $conversion) use ($media, $copiedOriginalFile) {
(new PerformConversionAction)->execute($conversion, $media, $copiedOriginalFile);
Expand Down