-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Description
Hey,
as an application/plugin developer I want an API to fully, properly and easily manage mimetypes. That is
-
Creating a new mimetype
I think this should be enough if it's on install, but a general API wouldn't hurt. Adding a new mimetype would trigger a background rescan of the database to associate any files with the new type.
-
Removing a mimetype
Probably also enough on uninstall. Perhaps apps could just declare these in their manifest. Again this would update the file database accordingly.
-
Associating custom callbacks to handle mimetype opening
This sort of exists with
OCA.Files.fileActions.register, but was completely undocumented last time I checked. It probably also could use some cleanup and convenience APIs for common cases.
Making this easy probably also requires nextcloud/viewer#2393 as we then would likely get competing apps for the same mimetypes.
While reworking the mimetype registry it could also be considered to not base it (solely) on file extensions but also check magic headers and provide APIs to register them based on those. Likewise the API should consider multiple filetypes and headers to map to a single mimetype and probably allow to set up all these mappings in a single call.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status