xbmc/xbmc — pull request #1602 by Montellese (2012-10-11 12:09:00+00:00)
Title: custom library nodes: allow optional <path> tag in filter nodes

@jmarshallnz this is more of a work around than a proper fix.

The problem is that since we switched the recentlyadded XML nodes to a filter and therefore doing the retrieval through CSmartPlaylistDirectory and not through CVideoDatabaseDirectory as before we get a different path for the list of items (e.g. videodb://2/2/-1/-1/ instead of videodb://5/ for recently added episodes) which results in the media window logic picking the "wrong" GUI view state. The recentlyadded-specific GUI view state doesn't allow any extra sorting whereas the media-specific GUI view states allow sorting and don't contain the Sort By Playlist functionality which results in the list of recently added items being re-sorted (By Name by default) after retrieval and not being in the proper order anymore.

With this fix we retrieve the tag also for filter nodes (if it's set) and assign it to the list of items. This will still result in going through CSmartPlaylistDirectory instead of CVideoDatabaseDirectory but the media windows logic will be able to determine the proper GUI view state based on the path of the items.

Let me know if anyone has another idea/approach to solve this problem.