-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
perf: Allow filtering the directory content by mimetype #57891
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
base: master
Are you sure you want to change the base?
Conversation
2179cf1 to
5fe15da
Compare
5fe15da to
c3eba5b
Compare
b554ad8 to
ec2a77e
Compare
|
|
||
| if ($mimetype_filter) { | ||
| $files = array_filter($files, function (FileInfo $file) use ($mimetype_filter) { | ||
| if (strpos($mimetype_filter, '/')) { | ||
| return $file->getMimetype() === $mimetype_filter; | ||
| if ($mimeTypeFilter) { | ||
| $files = array_filter($files, function (FileInfo $file) use ($mimeTypeFilter) { | ||
| if (strpos($mimeTypeFilter, '/')) { | ||
| return $file->getMimetype() === $mimeTypeFilter; | ||
| } else { | ||
| return $file->getMimePart() === $mimetype_filter; | ||
| return $file->getMimePart() === $mimeTypeFilter; | ||
| } | ||
| }); | ||
| } |
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.
Is this even needed anymore?
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.
actually still needed to filters the mounts added later on in this method. I need to see what makes more sense, filter the mounts in MountManager::findIn or afterward
ec2a77e to
e963419
Compare
e963419 to
b8a657b
Compare
b8a657b to
e01e2ec
Compare
Signed-off-by: Carl Schwan <carlschwan@kde.org>
e01e2ec to
084ef83
Compare
provokateurin
left a comment
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.
Sorry I found some more 🙈
Signed-off-by: Carl Schwan <carlschwan@kde.org>
ab02e3f to
ce34d55
Compare
provokateurin
left a comment
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.
Sorry that it took so many rounds 😅
Thanks for the quality review :) |
Summary
Likely too late for 33
Optimize a bit the /ocs/v2.php/apps/files/api/v1/folder-tree as it means we have less entry to fetch which takes around 30s to execute on prod
TODO
Checklist
3. to review, feature component)stable32)