xbmc/xbmc — pull request #4843 by jmarshallnz (2014-06-02 02:30:32+00:00)
Title: Support multiple paths per tvshow

To date we've supported multiple paths per tvshow via either:

1. Multipaths (which didn't work very well, particularly when altering them).
2. Multiple rows in the tvshow table, with a bunch of code to stack them down afterwards.

This has caused several problems, primarily that the episode counts could often be wrong depending on how you made it into the video info dialog, but there's also been issues on how such shows update and the like.

This fixes it so that the tvshowlinkpath table is a real link table, linking multiple paths to a show.

There's some TODO's noted in the code:
1. We seem to be removing things like stream details, bookmarks etc. when we probably shouldn't be.
2. We seem to be invalidating path hashes when we probably shouldn't be (removing a movie from the database need not invalidate the hash on the path, except for the case we're we are rescanning the movie).

Note that I've allowed the path of the tvshow returned from the database to be the path passed in (as part of the query) if reasonable to do so. This applies in files views for example, where if you have a multipath show, the path for that show is the one you're in. This allows refreshing of just one of the paths of the show in case two paths were assigned to the same show when they shouldn't have been (e.g. Battlestar Galactica 1978 versus 2003)

@Montellese is probably best for review.