]> _ Git - odl.git/commitdiff
wip #5184 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 29 Mar 2022 13:26:22 +0000 (15:26 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 29 Mar 2022 13:26:22 +0000 (15:26 +0200)
app/Http/Controllers/FrontController.php
app/Jobs/SearchIndex.php

index 4b89945e515e44060104a3fa79ba6a82ede7f15a..52d96f88de077e93863ca43d030fdfa24b3e3e4f 100644 (file)
@@ -115,7 +115,7 @@ class FrontController extends Controller
                 'title' => $a->get('title'),
                 'file' => $a->getImageURLbyCollection($a->get('file_upload')),
                 'image' => $a->getImageURLbyCollection($a->get('file_thumb')) ?? $a->getImageURLbyCollection($a->get('file_upload'), 'poster'),
-                'duration' => Cache::get('media_duration_' . Files::hashFileAttributes($file), function () use ($ffprobe, $file) {
+                'duration' => Cache::remember('media_duration_' . Files::hashFileAttributes($file), 85400, function () use ($ffprobe, $file) {
                     return $ffprobe->format($file)->get('duration');
                 })
             ];
index 3f71a8a792d7ed5d29cd4f723a00005061566057..aa3a2cf9fb6f76f41862fba7369ed9838b27e7d5 100644 (file)
@@ -75,7 +75,7 @@ class SearchIndex extends Index
         $pdfs = Asset::getPDFInResources();
         foreach ($pdfs as $pdf) {
             $file = $pdf->getFirstMediaInField('file_upload');
-            if (null===$file) {
+            if (null === $file) {
                 throw new \Exception('Aucun fichier dans l\'asset ' . $pdf->id);
             }
             $document = new PDF($file->getPath());