xbmc/xbmc — pull request #3777 by Montellese (2013-12-07 09:51:07+00:00)
Title: videolibrary: move logic for tvshow/season flattening from filesystem to GUI (fixes #14723)

As reported in http://trac.xbmc.org/ticket/14723 I noticed that for some tvshows the UPnP server would provide a list of seasons and for some it would just list all episodes (even if there are episodes from multiple seasons).

After taking a look at the code I realized that the problem lies in CDirectoryNodeSeasons::GetContent() which first retrieves all seasons and then makes some flattening checks based on the watched mode in the GUI and the tvshow flattening settings. While this works OK for GUI listings it obviously completely screws up any other listing that just wants to get all seasons for a specific path (independent of any GUI mode/settings).

I have moved the logic from the filesystem (i.e. CDirectoryNodeSeason) into CGUIWindowVideoNav::GetDirectory() so that it will only be applied when browsing tvshows through the GUI but not through UPnP et al.