2011-01-20, 08:21
topfs2 Wrote:Anyone having access to the database can both read, edit and completely destroy the database at a there leisure. This is something which is not at all good, something which should be sandboxed and impossible for a client to do unless explicitly allowed to do, which is what jsonrpc sets out the fix.
The database is either in a sqlite db file or in mysql. The client has access to it.
Quote:It is, but why should a client need to do this at every release. i.e. it needs to first parse out what version XBMC is then it needs to create the select statement. XBMC handles this perfectly in the GUI code and a client should ideally be able to just ask "Get all movies" and the it should get them, no matter what version the database is. This is why jsonrpc is design how it is.
I used perl via http GET like so
xbmc.pl?genre=horror&type=moviesbygenre
xbmc.pl?type=moviesbydate
And format the output in a way that is readily split on a delimeter and parsed w/ a regex by the controller. Having the response formatted how I need it outweighs any effort required to tweak my select statements should XBMC change the DB table structures around.
Not sure how that exposes the database to mre risk than a json call.
I'm strictly pulling metadata
I could just as well use a JSON library in Perl and translate responses from XBMC into something readily parsable in iViewer.