Repository navigation
Preview provider registration in manager - #14857
Conversation
There was a problem hiding this comment.
\OCP\Image extends \OC_Image and getPreview() returns \OC_Image so this wrong.
However there is no \OCP\IImage (and it looks stupid), so I'd suggest to:
- Add an interface
\OCP\IImage - Make
\OC_Imageimplement\OCP\IImageand ignore\OCP\Image(which then still implements the interface) - Change all type references from
\OC_Imageand\OCP\Imageto\OCP\IImage
Opinions? @DeepDiver1975
There was a problem hiding this comment.
Opinions? @DeepDiver1975
sounds reasonable .. go for it - thx
|
Good move! Thanks 🚀 Generally speaking we should drop all not officially supported providers and have the community handle them. We just cannot at the moment enable them without security impact etc. – And that whole "ffmpeg" magic and Co. drives me crazy :) |
There was a problem hiding this comment.
remove from the template?
There was a problem hiding this comment.
from an API perspective I'd move all these load methods to a factory
There was a problem hiding this comment.
The contacts app also calls them atm. I'd love to do that in a different PR then.
But I guess we can remove the load* from the interface and if someone needs them, they just continue to ignore the public interface for now, until the factory has been created.
We shall add a factory for that in the future
50d4dc1 to
8f06353
Compare
|
The inspection completed: No issues found |
|
Refer to this link for build results (access rights to CI server needed): |
|
The inspection completed: 7 new issues, 7 updated code elements |
|
Also, for this to work, at least all the methods described in #12772 have to be included, otherwise apps will stop working because providers will be in an object they can't use and the one they can use doesn't include any providers. |
|
these methods are on \OCP\IImage, not on the preview manager. |
|
Nope, they're on Preview used both before generating the preview |
|
Execatly, the Preview, not the PreviewManager. So this is a seperate thing and should be done in a separate PR ;) |
|
No, not on the returned preview which is an \OC\Image, but in \OC\Preview itself. PreviewManager is the public interface to Preview, already providing methods such as isMimeSupported() and createPreview(), so that's the class all apps should use and that's the only class which will have access to providers once they all move outside of core, so that class needs to have all the methods of Preview in order to be a proper replacement. |
|
|
|
What's missing are all the public methods. We can't possibly know of all their use. I can already give you three examples of files which are not compatible with the PreviewManager:
All these methods are listed in #12772 It might not be the responsibility of this PR to include them all, but you can't disable providers in core without offering access to them the same way they're accessed to today. |
|
Sorry, but you seem to mix up the preview providers with what is done on the preview/image later on. |
|
EDIT: I've looked at the code and see what you mean now. We can still use Preview like we always have and it will be using the PreviewManager to get access to the providers. All good in this case. By reading the comments, I thought the functionality was removed from Preview and apps would have to use the PreviewManager exclusively. |
|
@oparoz @nickvergessen Is this now the way we want to have it? does it work already? Can we start reviewing? What about @LukasReschke comments? |
|
The overall plan works for me What's left is to convert all providers into AppFramework apps and have something like this
but if I'm not mistaken, this can be done in another PR. |
Yes |
|
Just tested with a bunch of files and all previews still work 👍 |
|
yes, this PR is complete. |
|
👍 |
…-in-manager Preview provider registration in manager
As per #13648 (comment)
@MorrisJobke @DeepDiver1975 @LukasReschke