Skip to content

Commit

Permalink
[FINNA-2689] Forward: Fix displaying of related videos (#3050)
Browse files Browse the repository at this point in the history
  • Loading branch information
LuomaJuha authored Oct 9, 2024
1 parent 9bbd4d1 commit 90d1439
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion module/Finna/src/Finna/RecordDriver/SolrForward.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down Expand Up @@ -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 = [];
Expand Down

0 comments on commit 90d1439

Please sign in to comment.