Skip to content
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

fix(core): Always try to generate some kind of preview #50622

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

provokateurin
Copy link
Member

Summary

Instead of providing the option to generate fallback previews this PR changes it to always generate some kind of preview if possible.
I don't see a reason why we shouldn't ever fallback to the mimetype or symbolic icon in case we are not able to generate a proper preview or it's a folder.
This also improves the UX, in case developers forget to manually request the mimeFallback, as now the users still see some preview.

Checklist

@provokateurin provokateurin added enhancement 3. to review Waiting for reviews labels Feb 3, 2025
@provokateurin provokateurin added this to the Nextcloud 32 milestone Feb 3, 2025
@provokateurin provokateurin changed the title chore(core): Deprecate PreviewController::getPreview() endpoint fix(core): Always try to generate some kind of preview Feb 3, 2025
@provokateurin provokateurin force-pushed the fix/core/preview-generation branch from 2aef985 to c75fba9 Compare February 3, 2025 09:59
Copy link
Contributor

@come-nc come-nc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PHP changes are legit, but I do not know enough about this to judge the API change implied here.

@provokateurin
Copy link
Member Author

The API change itself is backwards compatible, since the removed parameters are just ignored now. Any client still sending them will not notice that they are not used anymore.

@susnux
Copy link
Contributor

susnux commented Feb 4, 2025

The API change itself is backwards compatible, since the removed parameters are just ignored now. Any client still sending them will not notice that they are not used anymore.

It will change the behavior as you now get the 303 for the mimetype even if you do not request it.
Meaning for files e.g. you get a "preview" even if there is none and instead should display the inline svg.

Not sure if this is bad or not. But a safer approach would be to reduce this to only the folder mime type change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants