[haiku-development] MIME types.

  • From: Bruno Albuquerque <bga@xxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Thu, 21 Aug 2008 10:29:09 -0300

As we all know, Haiku relies in a MIME-based system to identify file types. This was a really smart thing Be did and we, of course, adopted in Haiku. Still, this system is a bit awkward and under-utilized and I have two specific pet-peeves that I think could improve the situation:


1 - There are duplicate MIME types for representing a single type. One good example is "WAV Audio File" which could be represented either by audio/x-wav and audio/wav (I imagine the first one is deprecated but as we get files from the internet with specific MIME types associated with them, we have to handle both). This makes the Filetypes application show a very cluttered list after you spend, say, 1 year downloading stuff from the internet through email or http (both supporting mime types).

I guess one way to minimize it would be to have "MIME type aliases" in a way that one specific MIME type is the preferred one (when files are created, they will be created with this type) and the others are just aliases that map to this one. Those aliases could be partially created through some heuristics like type/x-subtype = type/subtype but also by allowing the user to configure this. An interface to allow that would be required (probably in the Filetypes preference panel).

2 - There is no full inheritance from the super-type to the sub-type. It is partial in the sense that the icon, for example, is inherited by the sub-type from the super-type (if the sub-type does not have its own). But this should also extend for other fields like, for example, the attribute list. Audio files are a very good example of this. Right now if you want to see specific attributes in Tracker for audio/wav and audio/mp3 files, you have to add the attributes to both sub-types (considering a directory that has only wav or only mp3 files) So you would have to add, say, Audio:Title to wav and also to mp3 file types while it is obvious that all Audio:* attributes should be assigned to the super-type.

For example, we could have something like this:

audio ---------------------------| wav
  |                              |  |
  |                              |  |
Audio:Title                      | Audio:WavSpecific1
Audio:Author                     | Audio:WavSpecific2
Audio:AnyGenericAudioAttribute   | ...
...                              |
                                 | mp3
                                    |
                                    |
                                   Audio:Mp3Specific1
                                   Audio:Mp3Specific2
                                   ...

And I would expect Tracker to show, in folders with only was or MP3 files, all the super-type attributes plus the attributes for any specific sub-type in the list.

I am not sure this is a Alpha 1 thing (probably not), but I guess it is something we should look into at some point in time. It would probably involve changes in how the MIME database is handled (including a clean-up), in Tracker and in the Filetypes preferences.

-Bruno


Other related posts: