xbmc/xbmc — pull request #1642 by Montellese (2012-10-18 15:56:30+00:00)
Title: media library: avoid empty listings after an update/refresh by going one level up in the hierarchy

This is a fix for something that has bugged me ever since I use XBMC. When I'm e.g. in the tvshow view and have "Hide Watched" enabled and there's only a single episode left in a season (or the whole show) and I either watch that episode or mark it as watched, the item is removed from the list leaving me with an empty view. With this change we go to the parent folder until we find a list that is not empty. It also solves the problem described in #634 but in a more general approach (i.e. not tvshow/season specific).

A few notes:
* This does not apply when "Show parent folder items" is enabled because then the list is not empty. I wasn't sure how to handle this so I'm open to suggestions but I'm sure 50% of the people want it this way and the other 50% the other way ;-)
* This does not apply if the list is already empty when opening it.
* This does not apply when a filter is active i.e. when the user specifies filter conditions that have no match, the list will be empty but we will stay in the same list/view/window.