Solved Why doesn't this work?

Trying to teach myself some python programming and am trying to get information from the video db with no success. Could someone have a look at this query and perhaps let me know if they see anything wrong? It doesn't seem to work in either Kodi 17 or 18.

Thank you!

# import the kodi python modules we are going to use
# see the kodi api docs to find out what functionality each module provides
import xbmc
import xbmcgui
import xbmcaddon
import json

def log(txt, mylevel=xbmc.LOGNOTICE):

    Logs to Kodi's standard logfile
    message = '%s : %s' % ("testwindow", txt)
    xbmc.log(msg=message, level=mylevel)

json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "VideoLibrary.GetMovies", "params": {"filter": {"field": "playcount", "operator": "is", "value": "1"}, "properties" : ["file"], "id": "libMovies"}} ')    

log("Raw json returned was %s" % json_query, xbmc.LOGINFO)
log("This is a test line to test logging")

The only entry I get in the log is this: 16:31:45.022 T:6536  NOTICE: testwindow : This is a test line to test logging

Thank you,
you have one misplaced bracket in your query.

this should work
{"jsonrpc": "2.0", "method": "VideoLibrary.GetMovies", "params": {"filter": {"field": "playcount", "operator": "is", "value": "1"}, "properties" : ["file"]}, "id": "libMovies"}
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Thank you for your help Ronie!

Thread marked solved.
Got a Kodi problem? Provide us with a full Debug log (wiki) || Usefull pages: First time user (wiki) || Troubleshooting (wiki) || Free content (wiki) || Forum rules (wiki) || VPN policy (wiki)
Thread Rating:
  • 0 Vote(s) - 0 Average

Logout Mark Read Team Forum Stats Members Help
Why doesn't this work?00