Skip to content
Snippets Groups Projects
Commit 15eb101e authored by Georgi's avatar Georgi
Browse files

[BUGFIX] Fix duration filter being applied when it shouldn't

parent 156d3f0e
No related branches found
Tags 8.1.1
1 merge request!15[TASK] move flexform field down, add max-height for shorts videos, add backend...
......@@ -50,7 +50,11 @@ class DurationFilter implements FilterInterface {
*/
public function modifyRequest(array &$parameters): void {
$this->originalParameters = $parameters;
if (isset($this->filterValues['duration']) && !empty($this->filterValues['duration'])) {
if (isset($this->filterValues['duration'])
&& in_array($this->filterValues['duration'], [
'1',
'2'
], TRUE)) {
// fetch the details to read the video duration
$parameters['maxResults'] += 100;
}
......@@ -61,7 +65,11 @@ class DurationFilter implements FilterInterface {
* In this case, we won't filter the results, as we're modifying the query.
*/
public function modifyResponse(array &$data): void {
if (!(isset($this->filterValues['duration']) && !empty($this->filterValues['duration']))) {
if (!(isset($this->filterValues['duration'])
&& in_array($this->filterValues['duration'], [
'1',
'2'
], TRUE))) {
return;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment