xbmc/xbmc — pull request #1258 by Montellese (2012-08-07 14:52:14+00:00)
Title: smartplaylist extensions & basic filtering in JSON-RPC

This PR contains two commits which add two features (the second requiring the first):

1. adds support for nested AND/OR rules in smartplaylists. Currently it is only possible to either do AND or OR (and then a nested OR on a single rule which I added as part of my GSoC work). With these changes it is possible to specify any combination of nested rules combined with AND or OR. Because there's no sane way to represent this in the GUI (or I'm too stupid to think of it) this feature is limited to C++ object based and CVariant based representations of a smartplaylist. XML still uses the same old representation.
2. adds basic XSP based filtering to the following JSON-RPC methods in the VideoLibrary and AudioLibrary namespaces: GetMovies, GetTVShows, GetEpisodes, GetMusicVideos, GetAlbums and GetSongs (once #1249 has been merged I can add it to GetArtists as well). To use XSP based filtering clients can specify rules and their combination type (AND or OR) in JSON and pass them in the "filter" parameter. Currently only one level of nested combination is possible (same as in the GUI) because I haven't figured out yet how to represent the recursive nature of nested AND/OR combinations of smartplaylist rules in JSON schema yet (I know that it's possible but it will require changes to our JSON schema parser). The current JSON schema definition contains automatic validation of the fields used in the rules i.e. it's not possible to e.g. specify a rule with a "artist" field in GetMovies. But there's no value/type/operator checking (probably not possible at all with the current JSON schema definition etc).