From: Vincent Vanwaelscappel Date: Wed, 6 Oct 2021 14:16:45 +0000 (+0200) Subject: wait #4756 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=2ee603dfd9720198ce2b841a35d8fd1a5e7bb97e;p=odl.git wait #4756 @1 --- diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 69914e9..938d8a1 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -3,9 +3,9 @@ namespace App\Console; use Illuminate\Console\Scheduling\Schedule; -use Illuminate\Foundation\Console\Kernel as ConsoleKernel; +use Cubist\Backpack\Console\Kernel as CubistKernel; -class Kernel extends ConsoleKernel +class Kernel extends CubistKernel { /** * The Artisan commands provided by your application. @@ -19,12 +19,12 @@ class Kernel extends ConsoleKernel /** * Define the application's command schedule. * - * @param \Illuminate\Console\Scheduling\Schedule $schedule + * @param \Illuminate\Console\Scheduling\Schedule $schedule * @return void */ protected function schedule(Schedule $schedule) { - // $schedule->command('inspire')->hourly(); + parent::schedule($schedule); } /** @@ -34,7 +34,7 @@ class Kernel extends ConsoleKernel */ protected function commands() { - $this->load(__DIR__.'/Commands'); + $this->load(__DIR__ . '/Commands'); require base_path('routes/console.php'); } diff --git a/app/Jobs/ProcessFluidbook.php b/app/Jobs/ProcessFluidbook.php index b9e4e35..cd47074 100644 --- a/app/Jobs/ProcessFluidbook.php +++ b/app/Jobs/ProcessFluidbook.php @@ -50,6 +50,17 @@ class ProcessFluidbook extends Compiler if (file_exists($path)) { copy($path, $this->wdir . $fname); } + + if (stripos($path, '.mp4') !== false) { + /** @var Media $posterMedia */ + $posterMedia = $asset->getMediaInField($asset->getAttributeValue('file_upload'))->first(); + $poster = $posterMedia->getPath('poster'); + if (file_exists($poster)) { + $dest = $this->wdir . str_replace('.mp4', '.jpg', $fname); + copy($poster, $dest); + } + } + return $fname; } diff --git a/app/Models/Asset.php b/app/Models/Asset.php index a85b687..2558c91 100644 --- a/app/Models/Asset.php +++ b/app/Models/Asset.php @@ -7,6 +7,7 @@ use Cubist\Backpack\Magic\Fields\SelectFromArray; use Cubist\Backpack\Magic\Fields\Tags; use Cubist\Backpack\Magic\Fields\Text; use Cubist\Backpack\Magic\Models\CubistMagicAbstractModel; +use Spatie\MediaLibrary\MediaCollections\Models\Media; class Asset extends CubistMagicAbstractModel { @@ -32,12 +33,27 @@ class Asset extends CubistMagicAbstractModel 'inlinevideo' => 'Vidéo (intégrée à la page)', 'popupvideo' => 'Vidéo (popup)', 'pdf' => 'Document PDF', - //'download' => 'Fichier à télécharger'], - 'column' => true, - ] + 'download' => 'Fichier à télécharger' + ], + 'column' => true, ]); $this->addField('file_upload', Files::class, 'Fichier'); $this->addField('keywords', Tags::class, 'Mots-clé', ['column' => true]); } + + /** + * @throws \Spatie\Image\Exceptions\InvalidManipulation + */ + public function registerMediaConversions(Media $media = null): void + { + parent::registerMediaConversions($media); + + $this->addMediaConversion('poster') + ->extractVideoFrameAtSecond(4) + ->sharpen(10) + ->optimize() + ->nonQueued(); + + } } diff --git a/composer.lock b/composer.lock index f57dcaa..791a1d9 100644 --- a/composer.lock +++ b/composer.lock @@ -1218,13 +1218,13 @@ "source": { "type": "git", "url": "git://git.cubedesigners.com/cubist_cms-back.git", - "reference": "648b1affc3941ee588d0e74665163b12bcd05bce" + "reference": "356aef6c88b61d38931cb3dbf9a306fd31cd1cd8" }, "dist": { "type": "tar", - "url": "https://composer.cubedesigners.com/dist/cubist/cms-back/cubist-cms-back-dev-master-da3a83.tar", - "reference": "648b1affc3941ee588d0e74665163b12bcd05bce", - "shasum": "1f324f2dfb2e6363996a254285aa722669be6adb" + "url": "https://composer.cubedesigners.com/dist/cubist/cms-back/cubist-cms-back-dev-master-1d0f1b.tar", + "reference": "356aef6c88b61d38931cb3dbf9a306fd31cd1cd8", + "shasum": "f7bfc0cdda6e2e4d340f082aff431ee5a489f1cc" }, "require": { "backpack/backupmanager": "^3.0", @@ -1301,7 +1301,7 @@ } ], "description": "Cubist Backpack extension", - "time": "2021-10-05T11:50:10+00:00" + "time": "2021-10-06T12:59:50+00:00" }, { "name": "cubist/cms-front", @@ -2735,13 +2735,13 @@ "source": { "type": "git", "url": "git://git.cubedesigners.com/fluidbook_tools.git", - "reference": "84663184d9a6f6419f380c1093311a7cf78f5704" + "reference": "1034981ad6b8cca85f02d54bec63d86623f4e944" }, "dist": { "type": "tar", - "url": "https://composer.cubedesigners.com/dist/fluidbook/tools/fluidbook-tools-dev-master-653417.tar", - "reference": "84663184d9a6f6419f380c1093311a7cf78f5704", - "shasum": "2bde8aa7648605824ef9eba194ebf61d8c095659" + "url": "https://composer.cubedesigners.com/dist/fluidbook/tools/fluidbook-tools-dev-master-58e109.tar", + "reference": "1034981ad6b8cca85f02d54bec63d86623f4e944", + "shasum": "6513fa7f79d9ddcfd66a4a5eb1da33de407fbae6" }, "require": { "barryvdh/laravel-debugbar": "^3.6", @@ -2773,7 +2773,7 @@ } ], "description": "Fluidbook Tools", - "time": "2021-10-05T13:26:54+00:00" + "time": "2021-10-05T15:48:46+00:00" }, { "name": "fruitcake/laravel-cors", @@ -3276,16 +3276,16 @@ }, { "name": "guzzlehttp/psr7", - "version": "1.8.2", + "version": "1.8.3", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "dc960a912984efb74d0a90222870c72c87f10c91" + "reference": "1afdd860a2566ed3c2b0b4a3de6e23434a79ec85" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/dc960a912984efb74d0a90222870c72c87f10c91", - "reference": "dc960a912984efb74d0a90222870c72c87f10c91", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/1afdd860a2566ed3c2b0b4a3de6e23434a79ec85", + "reference": "1afdd860a2566ed3c2b0b4a3de6e23434a79ec85", "shasum": "" }, "require": { @@ -3322,13 +3322,34 @@ "MIT" ], "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, { "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", "homepage": "https://github.com/Tobion" } ], @@ -3345,9 +3366,23 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/1.8.2" + "source": "https://github.com/guzzle/psr7/tree/1.8.3" }, - "time": "2021-04-26T09:17:50+00:00" + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], + "time": "2021-10-05T13:56:00+00:00" }, { "name": "intervention/image", @@ -3435,16 +3470,16 @@ }, { "name": "laravel/framework", - "version": "v8.62.0", + "version": "v8.63.0", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "60a7e00488167ce2babf3a2aeb3677e48aaf39be" + "reference": "8f3d280f36a427730c8c8fa34316c79eed38781e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/60a7e00488167ce2babf3a2aeb3677e48aaf39be", - "reference": "60a7e00488167ce2babf3a2aeb3677e48aaf39be", + "url": "https://api.github.com/repos/laravel/framework/zipball/8f3d280f36a427730c8c8fa34316c79eed38781e", + "reference": "8f3d280f36a427730c8c8fa34316c79eed38781e", "shasum": "" }, "require": { @@ -3602,7 +3637,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-09-28T13:30:25+00:00" + "time": "2021-10-05T14:04:25+00:00" }, { "name": "laravel/sanctum", @@ -5014,16 +5049,16 @@ }, { "name": "predis/predis", - "version": "v1.1.8", + "version": "v1.1.9", "source": { "type": "git", "url": "https://github.com/predis/predis.git", - "reference": "cf5c118a077fbab8b9af1482c20952173125c041" + "reference": "c50c3393bb9f47fa012d0cdfb727a266b0818259" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/predis/predis/zipball/cf5c118a077fbab8b9af1482c20952173125c041", - "reference": "cf5c118a077fbab8b9af1482c20952173125c041", + "url": "https://api.github.com/repos/predis/predis/zipball/c50c3393bb9f47fa012d0cdfb727a266b0818259", + "reference": "c50c3393bb9f47fa012d0cdfb727a266b0818259", "shasum": "" }, "require": { @@ -5068,7 +5103,7 @@ ], "support": { "issues": "https://github.com/predis/predis/issues", - "source": "https://github.com/predis/predis/tree/v1.1.8" + "source": "https://github.com/predis/predis/tree/v1.1.9" }, "funding": [ { @@ -5076,7 +5111,7 @@ "type": "github" } ], - "time": "2021-09-29T17:48:39+00:00" + "time": "2021-10-05T19:02:38+00:00" }, { "name": "prologue/alerts",