xbmc/xbmc — pull request #5198 by jmarshallnz (2014-08-11 09:42:25+00:00)
Title: [videodb] table formatting cleanup

This starts the proposed videodb table cleanup, focusing on the link tables (and their sources). The format used is:
```
table(table_id INTEGER PRIMARY KEY, name TEXT)
table_link(table_id INTEGER, media_id INTEGER, media_type TEXT)
```
In cases where multiple links are defined on the same table, we use
```
field_link(table_id INTEGER, media_id INTEGER, media_type TEXT)
```
i.e. the first field is named after the table that it is sourced from (it's a foreign key after all).

I've also changed the views to be movie_view for consistency, but have not yet renamed their content. I'm in two minds as to whether to have them use `movie_view.media_id` or `movie_view.movie_id`. There'd be a minor saving with the former, but mostly where we have the same routines run on multiple media tables (i.e. in format strings).

I've kept a couple of tables as they are: tvshowlinkpath and movielinktvshow. The latter could conceivably be a `media_link(media_id, media_type, media_id2, media_type2)` style link table.

There is a LOT of duplication in the existing videodatabase - I've cleaned up some minor stuff, but there's 50 line functions left that do the same thing save one or two minor differences. No point cleaning them up until we get some idea that this is the direction to go in.

NOTE: I'll pop an additional commit with the version bump at the end.