]> _ Git - odl.git/commitdiff
wait #4756 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 6 Oct 2021 14:16:45 +0000 (16:16 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 6 Oct 2021 14:16:45 +0000 (16:16 +0200)
app/Console/Kernel.php
app/Jobs/ProcessFluidbook.php
app/Models/Asset.php
composer.lock

index 69914e9937839b2a0fa23ec9142ca20fd7ab7a8d..938d8a1f9f3ecda74aa0317ec9d25c3536a0f9bf 100644 (file)
@@ -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');
     }
index b9e4e35627e039bd30f4743a58a2ea0564868f0f..cd47074c887bb7768e4ed1fe16414cdf894a63df 100644 (file)
@@ -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;
     }
 
index a85b68714e074aab1287fb0d8d2626ce5afd3ba6..2558c9125de8341f5a7e05242341a62eb77bb8c8 100644 (file)
@@ -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();
+
+    }
 }
 
index f57dcaad78ad824a6acf3ea98e9b5e139345790a..791a1d91a1ff146968d2c5c4ff3d262df06de117 100644 (file)
             "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",
                 }
             ],
             "description": "Cubist Backpack extension",
-            "time": "2021-10-05T11:50:10+00:00"
+            "time": "2021-10-06T12:59:50+00:00"
         },
         {
             "name": "cubist/cms-front",
             "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",
                 }
             ],
             "description": "Fluidbook Tools",
-            "time": "2021-10-05T13:26:54+00:00"
+            "time": "2021-10-05T15:48:46+00:00"
         },
         {
             "name": "fruitcake/laravel-cors",
         },
         {
             "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": {
                 "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"
                 }
             ],
             ],
             "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",
         },
         {
             "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": {
                 "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",
         },
         {
             "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": {
             ],
             "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": [
                 {
                     "type": "github"
                 }
             ],
-            "time": "2021-09-29T17:48:39+00:00"
+            "time": "2021-10-05T19:02:38+00:00"
         },
         {
             "name": "prologue/alerts",