Skip to content

Commit

Permalink
fix loading json-rpc results
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick-klein committed Apr 19, 2018
1 parent f406705 commit 71f8bd7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions context2.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

if __name__ == '__main__':
#TODO: add recursive option
#TODO: fix for empty directories
#TODO: let user name/rename directory label

addon = xbmcaddon.Addon()
Expand Down Expand Up @@ -83,7 +82,7 @@
'{"jsonrpc": "2.0", "method": "Files.GetDirectory", \
"params": {"directory":"%s"}, "id": 1}' % dir_path))
# halt if results don't load
if not (result.has_key('result') and result["result"].has_key('files')):
if not (results.has_key('result') and results["result"].has_key('files')):
#TODO: add notification that directory was added but no items
sys.exit()
dir_items = results["result"]["files"]
Expand Down

0 comments on commit 71f8bd7

Please sign in to comment.