• 1
  • 222
  • 223
  • 224(current)
  • 225
  • 226
JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC
Hi,

I'm having an ugly little problem with the server responses using websocket.

I'm using a websocket connection to communicate to Kodi server, but I cannot handle the responses depending on what they are responding for. I was able to implement a workaround to handle the requests synchronously, but it's not a gentle solution and it doesn't work perfect. I can't relay on the server response to parse the received data because I don't know what server it's responding for.

For example, if I send a request to the server by using the api method "Application.GetProperties", I can receive the response to that call. But I can receive any other response (like a notification for OnStop, for example) between that method call and its response.

It would be perfect that the Kodi server includes in the response what method is responding for. If you invoke the "Application.GetProperties" method, the server response will include a param with: "method":"Application.GetProperties". I wonder why this was not contemplated when websocket connection were added.

Of course using HTTP there is no problem at all, because of the connection protocol. This problem occurs only when using a websocket connection.

Thank you all!
Reply
(2016-07-07, 19:49)frostering Wrote: Hi,

I'm having an ugly little problem with the server responses using websocket.

I'm using a websocket connection to communicate to Kodi server, but I cannot handle the responses depending on what they are responding for. I was able to implement a workaround to handle the requests synchronously, but it's not a gentle solution and it doesn't work perfect. I can't relay on the server response to parse the received data because I don't know what server it's responding for.

For example, if I send a request to the server by using the api method "Application.GetProperties", I can receive the response to that call. But I can receive any other response (like a notification for OnStop, for example) between that method call and its response.

It would be perfect that the Kodi server includes in the response what method is responding for. If you invoke the "Application.GetProperties" method, the server response will include a param with: "method":"Application.GetProperties". I wonder why this was not contemplated when websocket connection were added.

Of course using HTTP there is no problem at all, because of the connection protocol. This problem occurs only when using a websocket connection.

Thank you all!

That's what the "id" property is for. Returning the requested method isn't bullet proof because you could send multiple requests to the same method before receiving a response. Just put a unique ID into every request and then you can easily match the response to the request you made. Notifications like Player.OnStop do not contain any "id" property.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
(2016-07-07, 20:00)Montellese Wrote: That's what the "id" property is for. Returning the requested method isn't bullet proof because you could send multiple requests to the same method before receiving a response. Just put a unique ID into every request and then you can easily match the response to the request you made. Notifications like Player.OnStop do not contain any "id" property.

Oh, I missed that param... Perfect, problem solved. Thank you¡
Reply
Is there a way to limit or filter the data returned or video cast information?

I send the following JSON command to get movie details:
{"jsonrpc":"2.0","method":"VideoLibrary.GetMovieDetails","params":{"movieid":38,"properties":["title","genre","year","rating","director","plot","thumbnail","cast"]},"id":55}

All informations is returned correctly but the cast information is very long. The cast information includes:
Name
Order
Role
Thumbnail

Because I will am not going to show the cast thumbnails within my GUI it would be helpful not to receive this information. Is there a way to filter this and if so, how?
I am still learning how to use the JSON and I am getting better in it, but it is a pretty steep learning curve.
Reply
(2016-07-11, 12:53)BasJaspers Wrote: Is there a way to limit or filter the data returned or video cast information?

I send the following JSON command to get movie details:
{"jsonrpc":"2.0","method":"VideoLibrary.GetMovieDetails","params":{"movieid":38,"properties":["title","genre","year","rating","director","plot","thumbnail","cast"]},"id":55}

All informations is returned correctly but the cast information is very long. The cast information includes:
Name
Order
Role
Thumbnail

Because I will am not going to show the cast thumbnails within my GUI it would be helpful not to receive this information. Is there a way to filter this and if so, how?
I am still learning how to use the JSON and I am getting better in it, but it is a pretty steep learning curve.

Unfortunately this is not supported. You can only filter the "main" properties like you're already doing.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
Is there a way to set / get chapter / bookmark info (chapter number / time / picture / ...)?

Can't seem to find it...

Thanks!
Add-on : Bluray iso utils Rewrite of BR_iso_enhancements
Add-on : BR_iso_Enhancements Give theatrical & directors cut from the same bluray iso each their own library entry, use bluray iso's of tv shows as if they are already ripped.
Reply
Is there a way to get the audio languages and subtitles that are available for a movieID. I can get the information while playing the movie, but not before.

Code:
{"jsonrpc":"2.0","method":"Player.GetProperties","params":{"playerid":1,"properties":["subtitles","audiostreams"]},"id":122}
Reply
(2016-07-28, 15:33)BasJaspers Wrote: Is there a way to get the audio languages and subtitles that are available for a movieID. I can get the information while playing the movie, but not before.

Code:
{"jsonrpc":"2.0","method":"Player.GetProperties","params":{"playerid":1,"properties":["subtitles","audiostreams"]},"id":122}
No, this needs to be in an NFO (so that stream details are added to the library during scanning) or the stream details will be added to the library only when the item is first played.
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply
(2016-07-28, 15:33)BasJaspers Wrote: Is there a way to get the audio languages and subtitles that are available for a movieID. I can get the information while playing the movie, but not before.

Code:
{"jsonrpc":"2.0","method":"Player.GetProperties","params":{"playerid":1,"properties":["subtitles","audiostreams"]},"id":122}

(2016-07-28, 18:21)Milhouse Wrote:
(2016-07-28, 15:33)BasJaspers Wrote: Is there a way to get the audio languages and subtitles that are available for a movieID. I can get the information while playing the movie, but not before.

Code:
{"jsonrpc":"2.0","method":"Player.GetProperties","params":{"playerid":1,"properties":["subtitles","audiostreams"]},"id":122}
No, this needs to be in an NFO (so that stream details are added to the library during scanning) or the stream details will be added to the library only when the item is first played.

Depends what type of file. If it's an ISO you'll need to play it at least once. For any other file going to the Kodi library view triggers a background scan to get this data from the files. Best would be that some one adds a lazy loading trigger that once update library it done it will also trigger the background scan.
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
The data is save in NFO files, but how can i access those?
Reply
(2016-07-29, 13:09)BasJaspers Wrote: The data is save in NFO files, but how can i access those?

You access the NFO files using a scraper. Set the content on a folder then scrape (scan) your library. Assuming the content of the NFO files is valid then it will be loaded for each movie/tvshow/episode. If the NFO file includes a <streamdetails> tag with relevant information then you should have video codec, audio codec and possibly subtitle information added to the library automatically.
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply
I will give it a test next week. Tank you for your help.
Reply
-removed-
Reply
I am trying to make a two way remote with photo viewer. I can show the pictures on my remote and can see the directories.
I am using "GUI.ActivateWindow" to navigate into a directory to search for the picture files.

{"jsonrpc":"2.0","method":"GUI.ActivateWindow","params":{"window":"pictures","parameters":["smb://Server/Pictures/"]},"id":254}

The problem is when I go deeper into subdirectory that I am not able to go back with the GUI.ActivateWindow command.
So when I am in the following folder:

{"jsonrpc":"2.0","method":"GUI.ActivateWindow","params":{"window":"pictures","parameters":["smb://Server/Pictures/Folder 1"]},"id":254}

I am not able to navigate back to the root of Pictures by calling the command:

{"jsonrpc":"2.0","method":"GUI.ActivateWindow","params":{"window":"pictures","parameters":["smb://Server/Pictures/"]},"id":254}

Am I doing something wrong? Or is this a limitation of Kodi?
I could use the back button function but if a user navigates back by using a D-pad I do not know in which directory I am because there is no current directory command.

Could someone help me out with this "problem". Thank you.
Reply
Nobody who ever had the above problem en came up with an fix?
Reply
  • 1
  • 222
  • 223
  • 224(current)
  • 225
  • 226

Logout Mark Read Team Forum Stats Members Help
JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC8