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 - Tolriq - 2012-10-08

Yes I know that Smile

But my problem is the opposite finding the media type from an arbitrary item.

The user add a path to browse, or adds a path to favorite and we don't know the kind of media so not possible to add it to playlist Smile


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Bara - 2012-10-09

Hello!
I have a question about method Files.GetDirectory.

This works and returns all files in directory
Code:
{"jsonrpc":"2.0","method":"Files.GetDirectory","params":{"directory":"/home/user/Pictures/","media":"pictures"},"id":"id00"}

And if i want to get only files from 0 to 10
Code:
{"jsonrpc":"2.0","method":"Files.GetDirectory","params":{"directory":"/home/user/Pictures","media":"pictures","limits":{"start":0,"end":10}},"id":"id00"}

i get:
Code:
{"error":{"code":-32602,"data":{"message":"Too many parameters","method":"Files.GetDirectory","stack":{"name":"media","type":"string"}},"message":"Invalid params."},"id":"id00","jsonrpc":"2.0"}

Does it supports "limits" and "sort" parameters?




RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-10-09

(2012-10-09, 08:14)Bara Wrote: Does it supports "limits" and "sort" parameters?

As you can see in the wiki (http://wiki.xbmc.org/index.php?title=JSON-RPC_API/v5#Files.GetDirectory) there's no "limits" parameter only a "sort" parameter.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Tolriq - 2012-10-09

That would make a good Feature request to allow dynamic loading without out of memory for big directories Smile


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Bara - 2012-10-09

(2012-10-09, 08:20)Montellese Wrote:
(2012-10-09, 08:14)Bara Wrote: Does it supports "limits" and "sort" parameters?

As you can see in the wiki (http://wiki.xbmc.org/index.php?title=JSON-RPC_API/v5#Files.GetDirectory) there's no "limits" parameter only a "sort" parameter.

Are there any plans to support limits in Files.GetDirectory?



RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - yallah - 2012-10-10

Hi,

Sorry but since commit 8b9f91d3f765f370fd479ac64229a9be805f2dd1 (https://github.com/xbmc/xbmc/pull/1480), I have some problems to get thumbnail or fanart with JSON (can't get any images for musics and videos...). I use exactly same command methods, with same computer(on windows 7), same db, same mysql, same library,....

just before commit 8b9f91d3f765f370fd479ac64229a9be805f2dd1: http://xbmclogs.com/show.php?id=10314
with commit 8b9f91d3f765f370fd479ac64229a9be805f2dd1 : http://xbmclogs.com/show.php?id=10315

thx


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Tolriq - 2012-10-10

This is because you're still using the /vfs handler to get the images.

You should have switched to /image to get images as stated a few weeks / month before.

But I suspect that there's still a problem with the new vfs security things since :
webserver: request received for /vfs/image://smb%253a%252f%252fDISKSTATION%252fvideo%252fCloclo.2012.FRENCH.1080p.BluRay.x264-ULSHD%252fulshd-cloclo.1080p.tbn

seems to be inside one of your source, perhaps the smb:// path or image:// check is not correctly handled and need some special attention like rar


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-10-10

Yup I didn't consider image://. These should be handled special as they always point to an image that has been cached by XBMC and is therefore save to access.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-10-10

As an FIY I pushed a commit that should improve retrieval of properties for lists with lots of items. The old implementation was a bit stupid and ran through all the properties twice for every item. Now every property is only handled once which should speed things up a bit.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - yallah - 2012-10-10

Oh Thx working but only if I map network, no with smb protocol inside XBMC.

http://xbmc:@192.168.2.31:8080/image/image://Z%3a%5cThe.Expatriate.2012.STV.MULTi.1080p.BluRay.x264-ULSHD%5culshd-theexpat.1080p.tbn
(/image/image://Z)

working but no :

http://xbmc:@192.168.2.31:8080/image/image://smb%253a%252f%252fDISKSTATION%252fvideo%252fCloclo.2012.FRENCH.1080p.BluRay.x264​-ULSHD%252fulshd-cloclo.1080p.tbn

(/image/image://smb)




RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-10-10

Which path do you receive from XBMC through JSON-RPC? I don't have samba so can't test right now but the idea is that you url-encode whatever you get from JSON-RPC and append it to /image/ and make your HTTP request.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - yallah - 2012-10-10

humm sorry I restart scan and it's working now!!

Thx all for your nice help!!!


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-10-11

Wednesday, October 10th 2012:
Commits: 27639ee9759381732b9c
  • added Player.OnPropertyChanged notification whenever "shuffled", "repeat" or "partymode" changes for an active player



RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Mizaki - 2012-10-11

Star!


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Mizaki - 2012-10-11

To keep things tidy. Would it be a major hassle to change { "type": "shuffle/repeat" } to { "method": "Player.Shuffle/Repeat" }? And possibly move "value" to params->data? I appreciate you did this last minute Smile