From 90d14398ddbee2f2f9827f1a05b9bbbba869b946 Mon Sep 17 00:00:00 2001 From: Juha Luoma <33253757+LuomaJuha@users.noreply.github.com> Date: Wed, 9 Oct 2024 18:01:56 +0300 Subject: [PATCH] [FINNA-2689] Forward: Fix displaying of related videos (#3050) --- .../src/Finna/RecordDriver/SolrForward.php | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/module/Finna/src/Finna/RecordDriver/SolrForward.php b/module/Finna/src/Finna/RecordDriver/SolrForward.php index 669cec36d28..b252c658d37 100644 --- a/module/Finna/src/Finna/RecordDriver/SolrForward.php +++ b/module/Finna/src/Finna/RecordDriver/SolrForward.php @@ -391,6 +391,28 @@ class SolrForward extends \VuFind\RecordDriver\SolrDefault implements \Laminas\L 'Synopsis' => 'synopsis', ]; + /** + * Video types, which are related to certain production. + * These videotypes are marked in the metadata as online-video=0 so + * we have to check the type. + * + * @var array + */ + protected $relatedVideoTypes = [ + 'animaatio', + 'dokumentti', + 'fiktio', + 'katsaus', + 'luokittelematon', + 'mainos', + 'musiikkiohjelma', + 'musiikkivideo', + 'radiotuotanto', + 'sarja', + 'tv-tuotanto', + 'traileri', + ]; + /** * Record metadata * @@ -1238,7 +1260,7 @@ protected function getVideoUrls() } $attributes = $titleValue->attributes(); $videoType = (string)($attributes->{'video-tyyppi'} ?? 'elokuva'); - if ($videoType !== 'traileri' && empty($attributes->{'online-video'})) { + if (empty($attributes->{'online-video'}) && !in_array($videoType, $this->relatedVideoTypes)) { continue; } $warnings = [];