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)



- vasikgreif - 2011-12-21

Montellese Wrote:Uhm Files.GetDirectory is returning directories AND files for me and I didn't do any fundamental changes to it for quite a while (only fixed the bug reported by Mizaki) so please provide specific details on what is not working including your JSON-RPC request, the result and what you would expect to be present in the response.

I send:

Code:
{"jsonrpc": "2.0", "method": "Files.GetDirectory", "params": {"directory": "smb://user:pass@server3/movies/","media":"video"}, "id": 1}

And it returns:
Code:
{"id":1,"jsonrpc":"2.0","result":{"files":null,"limits":{"end":0,"start":0,"total":0}}}

In the directory there are movies, which even are in the XBMC library. The same goes with music, when I use "media":"music". So, for me, it returns only directories, not files inside...


- Montellese - 2011-12-21

Uhm you don't get directories either as the "files" property of your result is empty.

Could you execute Files.GetDirectory with a path to a local directory containing directories and files? I don't have access to an SMB share so I can't test it myself and see if the problem is with SMB or if it is a general problem.


- vasikgreif - 2011-12-21

I do get directories, sorry for the first example, which was obviously wrong chosen. On a directory with folder and files inside I get:

Code:
{"id":1,"jsonrpc":"2.0","result":{"files":[{"file":"smb://server3/movies/moan/","filetype":"directory","label":"moan"}],"limits":{"end":1,"start":0,"total":1}}}



- Mizaki - 2011-12-21

Thanks for the fix on the smart music playlist. That should make life much easier.


- Montellese - 2011-12-21

vasikgreif Wrote:I do get directories, sorry for the first example, which was obviously wrong chosen. On a directory with folder and files inside I get:

Code:
{"id":1,"jsonrpc":"2.0","result":{"files":[{"file":"smb://server3/movies/moan/","filetype":"directory","label":"moan"}],"limits":{"end":1,"start":0,"total":1}}}

Okay but that's still with a remote directory and not a local one.

Mizaki Wrote:Thanks for the fix on the smart music playlist. That should make life much easier.

Glad to hear that.


player.open - wuench - 2011-12-22

I am having trouble with player.open on a file path to a bluray ISO (not sure if that matters). Basically if I send the following I get an OK response but no movie plays and I see the below log entries:

Code:
{"jsonrpc":"2.0","id":1,"method":"Player.Open","params":{"item":{"path":"smb://AV-NAS/media/Movies/A-Team/A-Team.bluray.ISO"}}}
{"id":1,"jsonrpc":"2.0","result":"OK"}

09:35:40 T:4268 WARNING: JSONRPC: Missing property "playlistid" in type
09:35:40 T:4268 WARNING: JSONRPC: Missing property "file" in type
09:35:40 T:4268 WARNING: JSONRPC: Missing property "directory" in type
09:35:40 T:4268 WARNING: JSONRPC: Missing property "movieid" in type
09:35:40 T:4268 WARNING: JSONRPC: Missing property "episodeid" in type
09:35:40 T:4268 WARNING: JSONRPC: Missing property "musicvideoid" in type
09:35:40 T:4268 WARNING: JSONRPC: Missing property "artistid" in type
09:35:40 T:4268 WARNING: JSONRPC: Missing property "albumid" in type
09:35:40 T:4268 WARNING: JSONRPC: Missing property "songid" in type
09:35:40 T:4268 WARNING: JSONRPC: Missing property "genreid" in type
09:35:40 T:4268 WARNING: JSONRPC: Value in type Playlist.Item does not match any of the union type definitions
09:35:40 T:6264   ERROR: XFILE::CDirectory::GetDirectory - Error getting smb://AV-NAS/media/Movies/A-Team/A-Team.bluray.ISO

If however I use playlists the following works ok for the same movie...

Code:
{"jsonrpc":"2.0","id":1,"method":"Playlist.Add","params":{"playlistid":1,"item":{"file":"smb://AV-NAS/media/Movies/A-Team/A-Team.bluray.ISO"}}}
{"id":1,"jsonrpc":"2.0","result":"OK"}
{"jsonrpc":"2.0","id":1,"method":"Player.Open","params":{"item":{"playlistid":1,"position":0}}}

I read that the player.open is asynch and so returns a response based on parsing, not on if the movie actually plays. But I was curious why the playlist does work...


- Montellese - 2011-12-22

The JSONRPC warnings are misleading. They should probably be downgraded to DEBUG level. and the GetDirectory error files because you passed a path to a file and not a directory. The "path" property should only be used for slideshows (which is why it also has "random" and "recursive" properties). What you want is the "file" property (as you use it in Playlist.Add) and then it should work fine.


- wuench - 2011-12-22

Sweet. That worked, thanks for the quick response. BTW, I didn't see that in the schema on the web page, but I may be reading it wrong...


- Montellese - 2011-12-22

It's part of the Playlist.Item type which can be used for the "item" parameter.


- Mizaki - 2011-12-23

I'm not sure were this lies, JSONRPC or not.

I had a failed to play message for an episode (Aeon-nox skin if it makes any difference). Until I used the keyboard to clear the message, JSONRPC would not respond. Events:

Try to play episode via player.open.
Message on screen "playback failed".
Player.Open is still awaiting reply.
JSONRPC unresponsive.
Clear message with keyboard.
Player.Open responds "ok".
Back to normal.


- Montellese - 2011-12-24

Mizaki Wrote:I'm not sure were this lies, JSONRPC or not.

I had a failed to play message for an episode (Aeon-nox skin if it makes any difference). Until I used the keyboard to clear the message, JSONRPC would not respond. Events:

Try to play episode via player.open.
Message on screen "playback failed".
Player.Open is still awaiting reply.
JSONRPC unresponsive.
Clear message with keyboard.
Player.Open responds "ok".
Back to normal.

I'm pretty sure this is related to http://trac.xbmc.org/ticket/11213
The problem is that all the methods in the Player namespace first check which players are active (because you can only interact with those). During that check we also need to check if a slideshow is running. That check involves the need to gain exclusive access to the XBMC GUI system but if there is already a dialog active it is impossible to get that exclusive access and JSON-RPC has to wait till the dialog is closed and it can finally get exclusive access to the XBMC GUI.


- Mizaki - 2011-12-24

Shall I add to that one about on screen dialogues or make a new ticket? It looks like no one has touched that one for a good while and is down for Dharma.


- Montellese - 2011-12-25

Please add it to the existing ticket. The reason why nobody really "worked" on it is because it might require a whole re-write of how slideshows are currently handled within XBMC which is far from being a simple task.


- null_pointer - 2011-12-25

Is there any way to get the "Exclude from scan" setting for the source using the JSON-RPC Files.GetSources or any other RPC call or approach for that matter?

I just want a list of sources that should be included in the scanning for library items.

Question originally posted here:
http://forum.xbmc.org/showthread.php?tid=117595


- Montellese - 2011-12-26

null_pointer Wrote:Is there any way to get the "Exclude from scan" setting for the source using the JSON-RPC Files.GetSources or any other RPC call or approach for that matter?

I just want a list of sources that should be included in the scanning for library items.

Question originally posted here:
http://forum.xbmc.org/showthread.php?tid=117595

That's not possible right now but it's a good idea. Can you create a feature request ticket for it and CC me? We could either return an additional property "excluded" for every source or we could add a parameter with which you can specify wether to provide the excluded sources as well.