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

Generate previews only for files that can have a preview #5079

Closed
labkode opened this issue May 7, 2021 · 10 comments · Fixed by #5159
Closed

Generate previews only for files that can have a preview #5079

labkode opened this issue May 7, 2021 · 10 comments · Fixed by #5159

Comments

@labkode
Copy link
Member

labkode commented May 7, 2021

Only send previews for known mimetypes that can have them and app allows for that.

The logic should be:

  1. Check what apps are installed
  2. Get list of mimetypes handled by apps
  3. Check if for each mime type the app can generate a preview
  4. Send the preview (and cache in browser)
@kulmann
Copy link
Contributor

kulmann commented May 12, 2021

Needs a product decision @tbsbdr
In my opinion the web ui should not assume which files can have previews. That's up to the backend. Especially when we implement a grid view (planned for Q2 or Q3 2021) and when we show file details in the right sidebar (planned for the current sprint, by end of May 2021) we will have a bigger version of previews without going into any extension. Would be a pity to hide previews just because we don't have an extension for that specific file type.

@labkode
Copy link
Member Author

labkode commented May 17, 2021

If the client does not have the knowledge that a particular mime type can have a preview means you will be sending N requests for N objects and most of the time (from experience) you won't get a preview, therefore you're waisting resources.

@pascalwengerter
Copy link
Contributor

pascalwengerter commented May 18, 2021

@labkode we discussed this internally and would suggest the following:

The admin provides a previewFileExtensions option in the config.json file. If it is present, previews only get fetched for the file types that are registered there. If the list is not present it falls back to the current behaviour and tries to fetch previews for every filetype.

What do you think of this approach?

Note: Handling the "Get list of mimetypes handled by apps" doesn't make sense for now since displaying previews for media files (as an example) is handled independently of the files-app-media-viewer communicating the ability to handle certain file extensions

@labkode
Copy link
Member Author

labkode commented May 19, 2021

@pascalwengerter I think is a good compromise.

@fschade
Copy link
Contributor

fschade commented May 27, 2021

@labkode, pr created. Happy to get your feedback #5159

@diocas
Copy link
Contributor

diocas commented Sep 5, 2022

@kulmann I'm re-opening this ticket because the option previewFileExtensions is no longer honoured and web tries to load previews for all file types.

@diocas diocas reopened this Sep 5, 2022
@kulmann
Copy link
Contributor

kulmann commented Sep 6, 2022

@diocas has been changed to mime types, see

"previewFileMimeTypes" : [

@kulmann
Copy link
Contributor

kulmann commented Sep 6, 2022

Please close again if that works for you

@diocas
Copy link
Contributor

diocas commented Sep 6, 2022

Sorry! I saw that but didn't realise it was replacing the old config. Thanks

@diocas diocas closed this as completed Sep 6, 2022
@kulmann
Copy link
Contributor

kulmann commented Sep 6, 2022

Sorry! I saw that but didn't realise it was replacing the old config. Thanks

Well, we failed to announce it properly...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants