I am currently trying to read my way into addon development for XBMC and I got a little confused with the bulk of (partly fresh, partly deprecated) info that is out there. I was hoping that someone could give me some pointers as to where to read next.

I am planning to implement an addon which reacts whenever an item was added to the XBMC library (I guess this should be a Python Script - Service plugin?).

Is it possible to access the xbmc database (read and write) from the Python script? Also, are there event-like structures to trigger the script (I found an OnUpdate somewhere in the documentation).

Also I wasn't able to find some kind of doxygen like API documentation for the Python methods, could someone please point me to a link for this?

Thanks alot!

taalas

(2012-05-03 19:47)taalas Wrote: Also I wasn't able to find some kind of doxygen like API documentation for the Python methods, could someone please point me to a link for this?

Currently, you can still use the http api which will let you query the db, but that's technically depreciated in Eden (it still works now, but will be removed in Frodo). Team-xbmc has decided to not allow direct sql execution on the db, but rather they want to move everything to the JSONRPC. Currently, not everything is implemented in the JSONRPC, so even though it's technically depreciated, you still need to use the httpapi.

So there is no way of accessing the DB in the current version of the JSON RPC API? The only way (currently) is to use the HTTP API to make changes or query the DB? No built-in functions do this? (I haven't found any)

rows is now a list of records of movies released after 2010. If you make any changes (like INSERT or DELETE statements), You need call db.commit() afterward or the changes will be discarded. When you're finished, call db.close() to unlock the db (only one process can access it at a time).

Thank you both for taking the time to explain the situation. I do understand the reason behind not wanting direct DB access and I would be happy to try out (upcoming) functionality in the JSON-RPC API. That said, could you elaborate on what I would have to do to request additional functionality in the JSON-RPC API?

The script I would like to implement is for a feature I wanted to have in XBMC for a long time:

On library update check video item path -> if similar filename already exists ask user whether to add a new item or "correct" the existing item

I often move lot's of files between share (from a NAS to an unRAID server) and I would love to have path autocorrection (to me this seemed like a feature that would benefit a lot of people, but after having asked in different threads I seem to be one of the few that have this "problem" )

rows is now a list of records of movies released after 2010. If you make any changes (like INSERT or DELETE statements), You need call db.commit() afterward or the changes will be discarded. When you're finished, call db.close() to unlock the db (only one process can access it at a time).

Thank you, thank you, thank you!

I wanted to fetch Video bookmarks from DB and I couldn't find a way to do it using JSON (I believe JSON doesn't have API for this yet). I was using executehttpi, which is no longer supported, but your example saved me!