xbmc/xbmc — pull request #1631 by Montellese (2012-10-16 11:02:58+00:00)
Title: media library: only allow "new" items after filtering into a list if they were part of a previously listed movie set

Up until now when the user is in a list and starts a filter and that filter happens to return items that were not part of the original list, we just appended those items to the list. The only use case where this can actually happen is if the unfiltered list contains movie sets and the applied filter reduces that set down to a single movie from within that set. That movie is a valid item for the active filter but not part of the unfiltered list.
Blindly adding all the additional items to the end of the list results in odd behaviour when e.g. in "Recently Added Movies" where we only list 25 movies. Applying a filter will result in filtering through all the items (not just the available 25) and appending all the new ones to the list.

With this change we check every new/unknown item against all the items in the unfiltered list and see if it was part of a previously listed set. To be future-proof I've introduced a new virtual method in CGUIMediaWindow which can be overriden by whatever class inherits CGUIMediaWindow. For the use case of movies in a set CGUIWindowVideoBase does this.