Automatically add mimetype on app install

This is a vast question. I’m developing GpxPod and GpxEdit apps.

I would like to know if it is possible to automatically add a mimetype to Nextcloud on app install. What i want to automate is more or less the actions described here :

I know, even though i didn’t try, that it is possible to add a pre-install hook in info.xml (How to set app dependency on another app). I guess what i would like to do is something that has the same effect as running occ maintenance:mimetype:update-js and occ files:scan --all inside the class called by the pre-install hook.

Bad idea ? Feasible ? Any workaround ?

1 Like