In all the discussion about local and network media shared between clients (which is a cool thing) - don't forget to take user accounts into account that might be supported some day (like in Boxxee). So the DB needs to store two more additional informations per media:
- username
- access (public/private/specific usergroup ID)
public media can be seen from any other user - private media only for the user that added it to the library. And if usergroups would get supportet - only members of the given usergroup could see the items.
------------------------------------------------------------
Another feature that might be taken into account in the DB-schema is content rating for children etc - so maybe another db-field needs to be added
- pgr (or how that is called in america)
That way XBMC would be able to list only media within certain pgr ranges (for kids "0-12" years, or for adults that don't want to see their kids stuff "12-*").
------------------------------------------------------------
As for the mapping tables I'd suggest the following structure (naming is just a draft and could be changed):
- uid_local
- uid_foreign
- table_local
- table_foreign
- match_field
- sorting
That way you can use one mapping table (with optimized indexes) to link between various tables and get a much cleaner db schema - although queries get blown up a bit.
------------------------------------------------------------
As for the merging of tables. I also favor merged tables for all incommon fields (title,path,media-type,tags,rating,username,access,pgr,...) and have separate tables for media specific data.
Just some suggestions from a newbie