PDA

View Full Version : QueryVideoDatabase problem


troutbum
2008-10-15, 07:24
Can someone tell me why this call will not accept multiple db elements in the select statement?

This works fine
xbmc.executehttpapi("QueryVideoDatabase(select tvshow.idShow from tvshow)")

but this errors out??
xbmc.executehttpapi("QueryVideoDatabase(select tvshow.idShow, tvshow.c00 from tvshow)")
the debug error is
<li>Error:SQL error or missing database
Query:select tvshow.idShow

to further complicate things, the second block works fine through the httpapi as:
http://127.0.0.1/xbmcCmds/xbmcHttp?command=QueryVideoDatabase(select%20tvsho w.c00,%20tvshow.idShow%20from%20tvshow)

driving me crazy, can someone tell me if I am doing something wrong? :confused2:

MPauley73
2008-10-15, 13:54
I found the same problem also while working on a Movie & TV Show Renamer.

After searching I found that this works:

new_sql = "SELECT path.strPath, files.strFileName FROM movie JOIN files ON files.idFile=movie.idFile JOIN path ON files.idPath=path.idPath;"

records = xbmc.executehttpapi( "QueryVideoDatabase(%s)" % ( quote_plus( new_sql ), ) )


Hope this helps

troutbum
2008-10-15, 17:10
thanks, but is quote_plus locally defined? when I run that syntax it is telling me that quote_plus is not defined?

troutbum
2008-10-15, 17:19
figured it out, you have to import quote_plus from urllib

thanks again!

MPauley73
2008-10-15, 22:44
Glad I could help..