QueryVideoDatabase problem
#1
Can someone tell me why this call will not accept multiple db elements in the select statement?

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

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

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

driving me crazy, can someone tell me if I am doing something wrong? :confused2:
Reply
#2
I found the same problem also while working on a Movie & TV Show Renamer.

After searching I found that this works:
Code:
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
Reply
#3
thanks, but is quote_plus locally defined? when I run that syntax it is telling me that quote_plus is not defined?
Reply
#4
figured it out, you have to import quote_plus from urllib

thanks again!
Reply
#5
Glad I could help..
Reply

Logout Mark Read Team Forum Stats Members Help
QueryVideoDatabase problem0