From: Vincent Vanwaelscappel Date: Thu, 21 Oct 2021 16:02:24 +0000 (+0200) Subject: wip #4830 @1.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=dfbabd25c763e77e04f5e0e97f0eb55ae33c10ec;p=odl.git wip #4830 @1.5 --- diff --git a/app/Http/Controllers/Admin/AssetThemesCrudController.php b/app/Http/Controllers/Admin/AssetThemesCrudController.php new file mode 100644 index 0000000..3c2c489 --- /dev/null +++ b/app/Http/Controllers/Admin/AssetThemesCrudController.php @@ -0,0 +1,28 @@ + $args]); - } - return $this->$tool($args); - } -} diff --git a/app/Http/Controllers/Admin/TourCrudController.php b/app/Http/Controllers/Admin/TourCrudController.php new file mode 100644 index 0000000..cd27d30 --- /dev/null +++ b/app/Http/Controllers/Admin/TourCrudController.php @@ -0,0 +1,28 @@ + $args]); + } + return $this->$tool($args); + } +} diff --git a/app/Jobs/ProcessFluidbook.php b/app/Jobs/ProcessFluidbook.php index 3bbf098..f473af4 100644 --- a/app/Jobs/ProcessFluidbook.php +++ b/app/Jobs/ProcessFluidbook.php @@ -20,6 +20,9 @@ class ProcessFluidbook extends Compiler public function __construct() { $this->pub = Publication::find(1); + if (null === $this->pub) { + return; + } /** @var Media $media */ $media = $this->pub->getMediaInField($this->pub->getAttributeValue('document'))->first(); @@ -66,7 +69,7 @@ class ProcessFluidbook extends Compiler protected function _getAssetCollection($id) { /** @var Asset $asset */ - $asset = Asset::find($id); + $asset = Asset::createdok()->find($id); if (null === $asset) { throw new \Exception('L\'élement ' . $id . ' n\'existe pas dans la médiathèque'); } diff --git a/app/Jobs/SearchIndex.php b/app/Jobs/SearchIndex.php index 517612d..110d110 100644 --- a/app/Jobs/SearchIndex.php +++ b/app/Jobs/SearchIndex.php @@ -34,17 +34,9 @@ class SearchIndex extends Index public function indexLibrary() { - $indexableTypes = ['audio', 'video']; - - $assets = Asset::all(); + $assets = Asset::createdok()->whereNotNull('theme')->whereIn('type', ['audio', 'video']); foreach ($assets as $asset) { $data = $asset->getPageData(); - if (!in_array($data->get('type'), $indexableTypes)) { - continue; - } - if (!$data->get('theme')) { - continue; - } $doc = new Document(); $doc->setType($data->get('type')); $doc->setId('media_' . $data->get('type') . '_' . $data->get('id'));