diff --git a/Plugin.php b/Plugin.php index 3264804..085b7a9 100644 --- a/Plugin.php +++ b/Plugin.php @@ -1,4 +1,6 @@ -shouldProcess()) { - Queue::push(ResizeJob::class, [$filePath]); + Queue::push(ResizeJob::class, [$filePath], Setting::get('queue')); } }); Event::listen('media.file.delete', function($widget, $filePath) { diff --git a/console/ResizeMake.php b/console/ResizeMake.php index fee1bc4..d442bc8 100644 --- a/console/ResizeMake.php +++ b/console/ResizeMake.php @@ -35,7 +35,7 @@ class ResizeMake extends Command if ($item->type === 'folder') { $this->resize($item->path); } else { - Queue::push(ResizeJob::class, [$item->path, 'update' => $this->option('update', false)]); + Queue::push(ResizeJob::class, [$item->path, 'update' => $this->option('update', false)], Setting::get('queue')); } } } diff --git a/models/setting/fields.yaml b/models/setting/fields.yaml index bdce25d..a5494b1 100644 --- a/models/setting/fields.yaml +++ b/models/setting/fields.yaml @@ -16,6 +16,9 @@ fields: mode: array label: Breakpoints comment: Von diesen Werten werden Bilder generiert mit entsprechender Breite. Bitte nur die Breite in Pixel angeben. Die Höhe bestimmt sich nach der Zielgröße + queue: + label: Queue + comment: Auf dieser Queue werden die Bilder generiert sizes: type: repeater label: Seitenverhältnisse diff --git a/tests/TestCase.php b/tests/TestCase.php index 649a924..4df7864 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -2,6 +2,7 @@ namespace Aweos\Resizer\Tests; +use Aweos\Resizer\Models\Setting; use Media\Classes\MediaLibrary; use PluginTestCase; use Storage; @@ -16,6 +17,7 @@ class TestCase extends PluginTestCase { parent::setUp(); + Setting::set('queue', 'default'); $this->media = MediaLibrary::instance(); }