metadb_display_hook API deprecated
Reply #15 – 2008-05-11 19:43:53
The problem with the metadb_display_hook API is that it was designed assuming that people who use the SDK read the documentation/specifications and think about consequences of what they create. Clearly that was a horrible mistake. Nearly all the people implementing this API haven't read the documentation at all or are intentionally ignoring what the documentation says and creating halfworking crap to keep users requesting new title formatting functions happy. In my opinion, title formatting has became a disease that eats people's brains out. Nuking of component-provided title formatting functions is necessary so we can evaluate what it is that people need those functions for and perhaps provide properly working means to achieve the same, without halfworking hacks such as title formatting functions to control playback / playlist switching / etc involved (clearly forbidden by the metadb_display_hook specification but implemented by circulating components anyway). I see that some features of Panels UI depend on metadb_display_hook too. This is another example of component author's incompetence and ignoring what the specification says - metadb_display_hook is not meant for implementing context-specific features such as variables, for an example, Columns UI is completely unaffected by this change just because its author knows what he is doing. Finally, I'd like to point that it's very easy to add entirely new APIs to foobar2000's component interaction model. Component authors could have easily created a new API for providing extensible script-like functions as well as dealing with the refreshability problem and set the rules regarding what is legit and what is not themselves BUT NOOO it's so much more fun to bend the existing thing and break the rules, creating security holes or other possible crashes on invalid user input etc. EDIT: Having lots of metadb_display_hook implementations murders title formatting performance, even for components that don't care about provided functionality. No metadb_display_hook installed: Album List refreshed in: 0:00.131706 Playback Statistics component only: Album List refreshed in: 0:00.134599 Playback Statistics component + 10 stub metadb_display_hooks that perform random strcmps: Album List refreshed in: 0:00.221873 This isn't exactly news, the documentation said to stay away from installing display hooks whenever possible because of performance issues. There's no such problem with the new API, impact on performance of title formatting operations that don't reference added fields is nonexistent.