previewgenerator icon indicating copy to clipboard operation
previewgenerator copied to clipboard

Use `isAvailable()` instead of `isMimeSupported()`?

Open jonnykl opened this issue 1 year ago • 1 comments

First I have to note that I didn't work with the Nextcloud code or the code of any of its apps. Maybe I just don't unterstand things right.

The drawio app always returns the supported mimetypes and returns false in the isAvailable() function if previews are disabled in the settings. Therefore it might be better to use that function instead of isMimeSupported() to check whether a preview should be generated or not (assuming the way the drawio app is implemented is correct)?

Code references:

  • drawio app: https://github.com/jgraph/drawio-nextcloud/blob/main/lib/Preview/DrawioPreview.php
  • previewgenerator: Generate.php and PreGenerate.php

jonnykl avatar Apr 25 '24 11:04 jonnykl

I had a look at the code and don't quite understand the use case yet. Could you please explain what exactly is broken or doesn't work by using isMimeSupported()?

st3iny avatar May 12 '24 09:05 st3iny