Kodi Community Forum
JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93)
+---- Forum: JSON-RPC (https://forum.kodi.tv/forumdisplay.php?fid=174)
+---- Thread: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC (/showthread.php?tid=68263)



RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Lunatixz - 2014-01-20

Will this be a feature? allowing addon_data paths to query json, or do I have to rewrite my addon??


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2014-01-22

(2014-01-20, 19:36)Lunatixz Wrote: Will this be a feature? allowing addon_data paths to query json, or do I have to rewrite my addon??

See PR4065.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Tolriq - 2014-01-22

Playing with AudioLibrary.SetSongDetails and it seems that modifying for example rating have not impact on currently playing media.

And if the song is part of a playlist moving in the playlist does not either refresh the data. Old one is shown until a stop / start of the player.

Is there a way from JSON to force a refresh so user does see the change he does to currently playing media ?


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2014-01-22

(2014-01-22, 20:08)Tolriq Wrote: Playing with AudioLibrary.SetSongDetails and it seems that modifying for example rating have not impact on currently playing media.

And if the song is part of a playlist moving in the playlist does not either refresh the data. Old one is shown until a stop / start of the player.

Is there a way from JSON to force a refresh so user does see the change he does to currently playing media ?

This was implemented once but had to be removed because there are addons that make hundreds of calls to the FooLibrary.SetBarDetails methods in quick succession which lead to refreshing the current screen after every such call which in the end made the GUI unusable while the script was running. Therefore this logic was removed again even though it has drawbacks as well, it's just that they are not as bad as XBMC becoming unusable.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Tolriq - 2014-01-22

Sad

Would it be possible for post Gotham to have an added parameter to allow this behavior ?
Or a new command in CGUIOperations ?

I guess in the meantime I can cheat with IncreaseRating / DecreaseRating


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Milhouse - 2014-01-27

Is there any possibility of the Textures.GetTextures method supporting limits so that rows can be retrieved in chunks, as supported by other methods?


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Lunatixz - 2014-01-27

(2014-01-22, 19:39)Montellese Wrote:
(2014-01-20, 19:36)Lunatixz Wrote: Will this be a feature? allowing addon_data paths to query json, or do I have to rewrite my addon??

See PR4065.

I'm still having read issues from addon_data folders using latest night... Wasn't it merged?


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2014-01-27

(2014-01-27, 09:21)MilhouseVH Wrote: Is there any possibility of the Textures.GetTextures method supporting limits so that rows can be retrieved in chunks, as supported by other methods?
Might be added in the future.

(2014-01-27, 20:53)Lunatixz Wrote:
(2014-01-22, 19:39)Montellese Wrote:
(2014-01-20, 19:36)Lunatixz Wrote: Will this be a feature? allowing addon_data paths to query json, or do I have to rewrite my addon??

See PR4065.

I'm still having read issues from addon_data folders using latest night... Wasn't it merged?

Please provide the specific request (with parameters) that you are having problems with. I only did some quick tests with Files.GetDirectory.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Lunatixz - 2014-01-27

(2014-01-27, 20:59)Montellese Wrote:
(2014-01-27, 09:21)MilhouseVH Wrote: Is there any possibility of the Textures.GetTextures method supporting limits so that rows can be retrieved in chunks, as supported by other methods?
Might be added in the future.

(2014-01-27, 20:53)Lunatixz Wrote:
(2014-01-22, 19:39)Montellese Wrote: See PR4065.

I'm still having read issues from addon_data folders using latest night... Wasn't it merged?
Please provide the specific request (with parameters) that you are having problems with. I only did some quick tests with Files.GetDirectory.

Code:
sendJSON command: {"jsonrpc": "2.0", "method": "Files.GetDirectory", "params": {"directory": "D:\\XBMC_Gotham\\portable_data\\userdata\\addon_data\\script.pseudotv.live\\cache\\generated\\movies_Action.xsp", "media": "video", "properties":["season","episode","playcount","duration","runtime","tagline","showtitle","album","artist","plot","plotoutline"]}, "id": 1}
the directory is translated from: special://profile/addon_data


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2014-01-27

It only works with "special://profile/addon_data/some/path". Using the real path doesn't work and wouldn't be cross-platform safe anyway.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Lunatixz - 2014-01-27

I'm not the above... is a print from my log. The actual path is translated by the plugin to be multiplatform safe.
Im using xbmc.translate /path special profile /addon_data/ plugin directory / file


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Milhouse - 2014-01-28

It's working for me (latest OpenELEC/XBMC master build from git about 30 minutes ago):
Code:
# ./texturecache.py directory special://profile/addon_data
DIR : special://profile/addon_data/os.openelec.settings
DIR : special://profile/addon_data/plugin.video.SportsDevil
DIR : special://profile/addon_data/plugin.video.iplayer
DIR : special://profile/addon_data/plugin.video.missingmoviescanner
DIR : special://profile/addon_data/plugin.video.youtube
DIR : special://profile/addon_data/script.artwork.downloader
DIR : special://profile/addon_data/script.common.plugin.cache
DIR : special://profile/addon_data/script.module.simple.downloader
DIR : special://profile/addon_data/script.moviesetart
DIR : special://profile/addon_data/service.openelec.settings
DIR : special://profile/addon_data/service.skin.widgets
DIR : special://profile/addon_data/weather.wunderground
DIR : special://profile/addon_data/xbmc.debug

2014-01-27 22:45:53.549990:MainThread: libDirectory.JSON SOCKET REQUEST: [{"jsonrpc": "2.0", "params": {"directory": "special://profile/addon_data", "media": "files", "properties": ["file"]}, "method": "Files.GetDirectory", "id": "libDirectory"}]
2014-01-27 22:45:53.568238:MainThread: libDirectory.BUFFER RECEIVED (len 1890)
2014-01-27 22:45:53.568368:MainThread: libDirectory.PARSING JSON DATA: {"id":"libDirectory","jsonrpc":"2.0","result":{"files":[{"file":"special://profile/addon_data/xbmc.debug/","filetype":"directory","label":"xbmc.debug","type":"unknown"},{"file":"special://profile/addon_data/weather.wunderground/","filetype":"directory","label":"weather.wunderground","type":"unknown"},{"file":"special://profile/addon_data/service.skin.widgets/","filetype":"directory","label":"service.skin.widgets","type":"unknown"},{"file":"special://profile/addon_data/service.openelec.settings
<snip>
"label":"os.openelec.settings","type":"unknown"}}],"limits":{"end":13,"start":0,"total":13}}}

I'm also able to drill down into those directories too.

Is there any reason why attempting to download files in these directories fails with httplib.UNAUTHORIZED? I'm assuming it's a security restriction, as I can download the content of files in my sources (nfo's etc.)


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Lunatixz - 2014-01-28

(2014-01-28, 00:48)MilhouseVH Wrote: It's working for me (latest OpenELEC/XBMC master build from git about 30 minutes ago):
Code:
# ./texturecache.py directory special://profile/addon_data
DIR : special://profile/addon_data/os.openelec.settings
DIR : special://profile/addon_data/plugin.video.SportsDevil
DIR : special://profile/addon_data/plugin.video.iplayer
DIR : special://profile/addon_data/plugin.video.missingmoviescanner
DIR : special://profile/addon_data/plugin.video.youtube
DIR : special://profile/addon_data/script.artwork.downloader
DIR : special://profile/addon_data/script.common.plugin.cache
DIR : special://profile/addon_data/script.module.simple.downloader
DIR : special://profile/addon_data/script.moviesetart
DIR : special://profile/addon_data/service.openelec.settings
DIR : special://profile/addon_data/service.skin.widgets
DIR : special://profile/addon_data/weather.wunderground
DIR : special://profile/addon_data/xbmc.debug

2014-01-27 22:45:53.549990:MainThread: libDirectory.JSON SOCKET REQUEST: [{"jsonrpc": "2.0", "params": {"directory": "special://profile/addon_data", "media": "files", "properties": ["file"]}, "method": "Files.GetDirectory", "id": "libDirectory"}]
2014-01-27 22:45:53.568238:MainThread: libDirectory.BUFFER RECEIVED (len 1890)
2014-01-27 22:45:53.568368:MainThread: libDirectory.PARSING JSON DATA: {"id":"libDirectory","jsonrpc":"2.0","result":{"files":[{"file":"special://profile/addon_data/xbmc.debug/","filetype":"directory","label":"xbmc.debug","type":"unknown"},{"file":"special://profile/addon_data/weather.wunderground/","filetype":"directory","label":"weather.wunderground","type":"unknown"},{"file":"special://profile/addon_data/service.skin.widgets/","filetype":"directory","label":"service.skin.widgets","type":"unknown"},{"file":"special://profile/addon_data/service.openelec.settings
<snip>
"label":"os.openelec.settings","type":"unknown"}}],"limits":{"end":13,"start":0,"total":13}}}

I'm also able to drill down into those directories too.

weird, I'll make sure paths are correct. Did any of the properties i'm using change/


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Milhouse - 2014-01-28

(2014-01-28, 01:02)Lunatixz Wrote: Did any of the properties i'm using change/

You're specifying "media": "video", when it should be "media": "files". Unless you've got video files stored in your addons settings folders, of course... Smile


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Lunatixz - 2014-01-28

This is my code, is there a break down in xbmc translation were the paths are no longer valid? Looks correct to me...

Code:
SETTINGS_LOC = 'special://profile/addon_data/' + ADDON_ID
CHANNELS_LOC = xbmc.translatePath(os.path.join(SETTINGS_LOC, 'cache')) + '/'
MADE_CHAN_LOC = os.path.join(CHANNELS_LOC, 'stored') + '/'
fle = MADE_CHAN_LOC + os.path.split('somefilename')[1]
fle = xbmc.translatePath(fle)