'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');
})
];
$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());