-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FINNA-2579] & [FINNA-2875] Add file size to LIDO resource and fix resource play buttons for sr #3118
base: dev
Are you sure you want to change the base?
Conversation
…ms with resource links and player.
* | ||
* @return array | ||
*/ | ||
protected function getModel( | ||
string $url, | ||
string $format, | ||
string $type, | ||
\SimpleXmlElement $measurements = null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tämän tyypin pitäisi olla ?\SimpleXmlElement
* | ||
* @return array | ||
*/ | ||
protected function getAudio( | ||
string $url, | ||
string $format, | ||
string $description | ||
string $description, | ||
\SimpleXmlElement $measurements = null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tämän tyypin pitäisi olla ?\SimpleXmlElement
@@ -923,6 +951,9 @@ protected function getAudio( | |||
'codec' => $format, | |||
'type' => 'audio', | |||
'embed' => 'audio', | |||
'data' => $this->formatResourceMeasurements( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ei voi kutsua formatResourceMeasurements-metodia varmistamatta, ettei $measurements ole null.
@@ -955,6 +988,9 @@ protected function getVideo( | |||
'url' => $url, | |||
'embed' => 'iframe', | |||
'format' => $format, | |||
'data' => $this->formatResourceMeasurements( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ei voi kutsua formatResourceMeasurements-metodia varmistamatta, ettei $measurements ole null.
@@ -966,6 +1002,9 @@ protected function getVideo( | |||
'src' => $url, | |||
'type' => $mediaType, | |||
], | |||
'data' => $this->formatResourceMeasurements( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ei voi kutsua formatResourceMeasurements-metodia varmistamatta, ettei $measurements ole null.
@siiriylonen Saisiko saamen käännöksen myös? |
* @param string $url Model url | ||
* @param string $format Model format | ||
* @param string $type Model type | ||
* @param \SimpleXmlElement $measurements Measurements SimpleXmlElement |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kysymysmerkki tähänkin tyypin eteen. Jälkimmäinen SimpleXmlElement
on turha – sehän on jo parametrin tyypissä.
@@ -1,8 +1,13 @@ | |||
<!-- START of: finna - RecordDriver/DefaultRecord/audio-information.phtml --> | |||
<?php | |||
if ($fileSize = $url['data']['size'] ?? '') { | |||
$fileSize = !empty($fileSize['value']) && $fileSize['unit'] === 'byte' ? '(' . $this->fileSize(preg_replace('/[^0-9]/', '', $fileSize['value'])) . ')' : ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Miksi yksikön pitää olla byte? Jos tietueessa on koko vaikka kilotavuina, niin jää näyttämättä, eikö?
@@ -1,7 +1,7 @@ | |||
<!-- START of: finna - RecordDriver/DefaultRecord/audio-information.phtml --> | |||
<?php | |||
if ($fileSize = $url['data']['size'] ?? '') { | |||
$fileSize = !empty($fileSize['value']) && $fileSize['unit'] === 'byte' ? '(' . $this->fileSize(preg_replace('/[^0-9]/', '', $fileSize['value'])) . ')' : ''; | |||
$fileSize = !empty($fileSize['value']) ? '(' . $this->fileSize(preg_replace('/[^0-9]/', '', $fileSize['value'])) . ')' : ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eihän tämä kuitenkaan näin voi mennä. Jos unit on jotain muuta kuin byte, niin ei fileSize anna sille oikeaa arvoa. Toisin sanoen pitää joko konvertoida tavuiksi SolrLido:ssa, välittää myös yksikkö fileSize:lle tai näyttää koko jotenkin vaihtoehtoisesti.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lisäksi pitää huomioida, että muu kuin tavu voi olla desimaaliluku, vaikka "3.5", jolloin ei voi suoraan vain poistaa ei-numeroita stringistä. Muuten olisi kyllä parempi tehdä siivous SolrLidon puolella, jotta sitä ei tarvitse erikseen tehdä monessa paikassa templaateissa.
…x-focus-for-resource-btn
No description provided.