Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
sg_youtube
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TYPO3
sg_youtube
Commits
15eb101e
Commit
15eb101e
authored
4 months ago
by
Georgi
Browse files
Options
Downloads
Patches
Plain Diff
[BUGFIX] Fix duration filter being applied when it shouldn't
parent
156d3f0e
No related branches found
Branches containing commit
Tags
8.1.1
Tags containing commit
1 merge request
!15
[TASK] move flexform field down, add max-height for shorts videos, add backend...
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Classes/Filter/DurationFilter.php
+10
-2
10 additions, 2 deletions
Classes/Filter/DurationFilter.php
with
10 additions
and
2 deletions
Classes/Filter/DurationFilter.php
+
10
−
2
View file @
15eb101e
...
...
@@ -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
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment