2007-09-12, 03:02
First, I know that no developer is going to want to take this on, since it's so deeply embedded into a lot of the current code, but perhaps it will inspire someone in some way.
I think a complete reworking of the library system would help XBMC a lot. I've used a lot of different HTPC applications and found that Meedio's library system worked extremely well, although there were a few problems with it. My ideas are based on Meedio, but will make note of the main deficiencies of it.
The library system in Meedio allowed users to create any type of library they wanted, with any number of definable fields (called keys). There were a few default keys, like id, filepath, etc, but I'd prefer that a unique id field be the only predefined key for a library. In reality, each library was just a SQLite table and the keys were the fields, which makes the most sense.
Each library could also have any number of importers that could work on it. These should be able to be applied in a specific order so file imports can be done before metadata lookups. For XBMC, each library could have any number of python script importers that would work on the data. An example: for a movie library, the first importer could simply copy all of the movie file data into the database based on the file/dir name. It could also pull in the path to folder.jpg or folder.tbn if it exists. The second importer could be an IMDB.com importer, which would first create all of the possible fields it can fill, and then loop through every record and do an IMDB lookup using the movie name. The third importer could use that data to hunt down a trailer for the movie and fill the trailer path accordingly.
The benefits are already clear: each importer only needs to do what it was specifically designed for and may be applied only to a specific library. This opens up the ability to have a library that holds any information we want: photos with exif info, apple movie trailers, sports scores, emulator games, phone book, etc. It makes it so the importers and library can handle all of the backend stuff while allowing the frontend to simply worry about displaying the information properly.
The final part of Meedio's library system that I liked was its ability to define views. This is similar to the movie library where you can select "By genre", "By actor", etc. Each of these would be a view with any number of steps in them. For example: the genre view would have steps of genre, title. An emulator view could have steps of consolesystem, genre, year, title, etc. These could be defined in advancedsettings to override the defaults for that specific library.
Like I said, it would be a lot of work switching everything over, but I think the benefits of having any information we want in a database table would be really cool. I only bring this up now because the switch to linux could actually make some of this possible since there's no memory restrictions at that point. I don't know if each additional database table takes additional ram on the xbox, but that would be one possible limitation.
The main drawback to this system in Meedio is that it was relatively complicated for users to set up their libraries and apply the proper importers for each, with the proper settings for each of those. If it could be automated to some extent by having the python importers automatically create the library, fields, and default views, then I don't think that would be as big of a deal.
Ok... time for me to duck while spiff, jm, and others throw stuff at me.
I think a complete reworking of the library system would help XBMC a lot. I've used a lot of different HTPC applications and found that Meedio's library system worked extremely well, although there were a few problems with it. My ideas are based on Meedio, but will make note of the main deficiencies of it.
The library system in Meedio allowed users to create any type of library they wanted, with any number of definable fields (called keys). There were a few default keys, like id, filepath, etc, but I'd prefer that a unique id field be the only predefined key for a library. In reality, each library was just a SQLite table and the keys were the fields, which makes the most sense.
Each library could also have any number of importers that could work on it. These should be able to be applied in a specific order so file imports can be done before metadata lookups. For XBMC, each library could have any number of python script importers that would work on the data. An example: for a movie library, the first importer could simply copy all of the movie file data into the database based on the file/dir name. It could also pull in the path to folder.jpg or folder.tbn if it exists. The second importer could be an IMDB.com importer, which would first create all of the possible fields it can fill, and then loop through every record and do an IMDB lookup using the movie name. The third importer could use that data to hunt down a trailer for the movie and fill the trailer path accordingly.
The benefits are already clear: each importer only needs to do what it was specifically designed for and may be applied only to a specific library. This opens up the ability to have a library that holds any information we want: photos with exif info, apple movie trailers, sports scores, emulator games, phone book, etc. It makes it so the importers and library can handle all of the backend stuff while allowing the frontend to simply worry about displaying the information properly.
The final part of Meedio's library system that I liked was its ability to define views. This is similar to the movie library where you can select "By genre", "By actor", etc. Each of these would be a view with any number of steps in them. For example: the genre view would have steps of genre, title. An emulator view could have steps of consolesystem, genre, year, title, etc. These could be defined in advancedsettings to override the defaults for that specific library.
Like I said, it would be a lot of work switching everything over, but I think the benefits of having any information we want in a database table would be really cool. I only bring this up now because the switch to linux could actually make some of this possible since there's no memory restrictions at that point. I don't know if each additional database table takes additional ram on the xbox, but that would be one possible limitation.
The main drawback to this system in Meedio is that it was relatively complicated for users to set up their libraries and apply the proper importers for each, with the proper settings for each of those. If it could be automated to some extent by having the python importers automatically create the library, fields, and default views, then I don't think that would be as big of a deal.
Ok... time for me to duck while spiff, jm, and others throw stuff at me.