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 - Milhouse - 2014-02-24

Just to be clear about this hard coding, if I physically delete movie files from my NAS, and then I run a VideoLibrary.Clean which has "keep" as the default, will the deleted movie items be removed from the library or not? I normally run a clean after I've removed items from the NAS, so if "missing" items are retained (with "keep") I can't see how that benefits my use case - I understand the problem of the NAS being offline, but if items are kept by default I don't see what a clean is achieving?

Or maybe I've misunderstood this whole remove/keep thing! Smile
(2014-02-24, 08:57)Montellese Wrote: AudioLibrary.Clean is not affected as I've only adjusted the videolibrary cleaning to handle whole sources being offline.

OK, but in this case the whole source wasn't offline - it was online although about 20 movies out of 650 had been removed and so I was prompted to remove/keep the missing movies (only about 4 prompts though, the 20 movies were split across 4 folders so it appears to have been one prompt per folder).


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

It cleans any items that are removed as long as the source they belonged to is still accessible. So if you remove a single item from one of your sources but the source still exists, that will work just fine. If the whole source is however offline XBMC will think that the whole source is probably offline and will not remove any of its items.


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

OK that sounds fine - thanks for the clarification. If it's possible to suppress the prompts when performing the clean via JSON, that would be great! Thanks.


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

@Montellese Is there ways to get additionnal debug information from webserver ?

I'm currently working with chromecast and the webserver serving /vfs on Windows seems to be quite problematic but I can't really debug Sad

What I see in chromecast logs are things like : [115:120:ERROR:ffmpeg_demuxer.cc(148)] Format conversion failed.
And some errors about invalid Content-Lenght.

But nothing in Xbmc logs Sad

The same media on the same Xbmc served by the webserver of UPNP do not have those problems and works perfectly. (2014/02/21 build)

It also seems from some early users tests that this problem does not touch rpi.

Perhaps linked to the too old httpd lib, maybe pushing on https://github.com/xbmc/xbmc/pull/2262 for Gotham would help ?


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

(2014-02-26, 14:20)Tolriq Wrote: @Montellese Is there ways to get additionnal debug information from webserver ?

I'm currently working with chromecast and the webserver serving /vfs on Windows seems to be quite problematic but I can't really debug Sad

What I see in chromecast logs are things like : [115:120:ERROR:ffmpeg_demuxer.cc(148)] Format conversion failed.
And some errors about invalid Content-Lenght.

But nothing in Xbmc logs Sad

The same media on the same Xbmc served by the webserver of UPNP do not have those problems and works perfectly. (2014/02/21 build)

It also seems from some early users tests that this problem does not touch rpi.

Perhaps linked to the too old httpd lib, maybe pushing on https://github.com/xbmc/xbmc/pull/2262 for Gotham would help ?

The only thing there is a
Code:
#define WEBSERVER_DEBUG
which I've added when I refactored the whole webserver. But you need to change the code in xbmc/network/WebServer.cpp and build your own XBMC binary to be able to make use of that. And it only enables a few (like 4) log messages about ranged requests. The problem is that most HTTP related logic is handled by libmicrohttpd itself which has logging disabled in our build (because it increases the size of the library from a few KB to several MB).

Furthermore the UPnP file server is completely independent from the webserver integrated into XBMC and is part of the Platinum UPnP SDK.

Linux builds should use almost the same version of libmicrohttpd as Windows. Both are 0.4.6. So mergin PR 2262 would mean that Windows would use a completely different version of libmicrohttpd than Linux. But then again on linux there's no way to know what version is really used because of being able to build against system libraries.


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

Well I did know both servers where different that why I tested the other Sad

I'll try to find time to add the debug part but if it's limited I doubt I'll find a solution Sad

Is there a way to know the version built against on linux ?


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

After some search it appears Windows seems to be using 0.4.5 Sad

Linux without system libs seems to be using 0.4.5 seeing the Changelog in /lib/libmicrohttpd

Old linux distrib seems to embed 0.4.6 and most modern one at least a 0.9 version (This is the case of all rpi builds).

And it seems Darwin is using a more recent one ?

Seeing that rpi httpd correct most of the windows problems (http keepalive, frequent disconnect, and now bugs with chromecast) and that there's lot's of difference in other libs version depending on OS, is there really no way to have this bump for windows, seeing from another thread that Windows seems to be 70% of your users ?


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Martijn - 2014-02-26

Nope. We are in feature freeze and nothing gets bumped.
Maybe after Gotham the windows build system get changed so we just can get the source and compile it ourselves instead of relying on pre-compiled libs


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

What's the relation between feature freeze and correct some major flaws in http server ?

This would not change functions or adding / removing anything, just correct bugs before going beta


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Martijn - 2014-02-26

(2014-02-26, 15:23)Tolriq Wrote: What's the relation between feature freeze and correct some major flaws in http server ?

This would not change functions or adding / removing anything, just correct bugs before going beta
Freeze=Freeze. Period.

Bumping libs can bring their own issues of new bugs and no one wants that. You just need to accept it will not happen.
If we are lucky version 15 won't take that long and would have several bumped libs.


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

@Tolriq: One of the reasons we are so hesitant about updating libmicrohttpd is that we've done it before (about a year ago) to some 0.9.x version and it resulted in lots of crashes in XBMC. So it's not like updating a library will make everything better. It may result in some fixes but it can also introduce more severe problems. That's why we usually try to update a library just after a release. That gives us enough time to properly test the new version and work around any new issues. In feature freeze there's just not enough time.


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

No problem I'll use upnp Smile

It's just too bad since it's a 11 month old PR Sad


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Regss - 2014-03-03

Code:
{"jsonrpc": "2.0", "method": "VideoLibrary.GetTVShows", "params": {"properties": ["playcount"], "filter": {"operator": "greaterthan", "field": "playcount", "value": "0"}}, "id": 1}

{u'jsonrpc': u'2.0', u'id': 1, u'result': {u'limits': {u'start': 0, u'total': 6, u'end': 6}, u'tvshows': [{u'playcount': 1, u'tvshowid': 1, u'label': u'Boso przez \u015bwiat'}, {u'playcount': 1, u'tvshowid': 4, u'label': u'E sk\u0142adniki'}, {u'playcount': 1, u'tvshowid': 17, u'label': u'Gotowe na wszystko'}, {u'playcount': 1, u'tvshowid': 26, u'label': u'Joymii'}, {u'playcount': 1, u'tvshowid': 14, u'label': u'Seks w wielkim mie\u015bcie'}, {u'playcount': 1, u'tvshowid': 11, u'label': u'Wojciech Cejrowski Boso'}]}}



{"jsonrpc": "2.0", "method": "VideoLibrary.GetTVShowDetails", "params": {"properties": ["playcount", "lastplayed", "dateadded"], "tvshowid": 26}, "id": "1"}

{u'jsonrpc': u'2.0', u'id': u'1', u'result': {u'tvshowdetails': {u'lastplayed': u'', u'playcount': 0, u'dateadded': u'', u'tvshowid': 26, u'label': u'Joymii'}}}

Why the results for tvshow playcount (ID: 26) differ from each other.


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

(2014-03-03, 16:19)Regss Wrote:
Code:
{"jsonrpc": "2.0", "method": "VideoLibrary.GetTVShows", "params": {"properties": ["playcount"], "filter": {"operator": "greaterthan", "field": "playcount", "value": "0"}}, "id": 1}

{u'jsonrpc': u'2.0', u'id': 1, u'result': {u'limits': {u'start': 0, u'total': 6, u'end': 6}, u'tvshows': [{u'playcount': 1, u'tvshowid': 1, u'label': u'Boso przez \u015bwiat'}, {u'playcount': 1, u'tvshowid': 4, u'label': u'E sk\u0142adniki'}, {u'playcount': 1, u'tvshowid': 17, u'label': u'Gotowe na wszystko'}, {u'playcount': 1, u'tvshowid': 26, u'label': u'Joymii'}, {u'playcount': 1, u'tvshowid': 14, u'label': u'Seks w wielkim mie\u015bcie'}, {u'playcount': 1, u'tvshowid': 11, u'label': u'Wojciech Cejrowski Boso'}]}}



{"jsonrpc": "2.0", "method": "VideoLibrary.GetTVShowDetails", "params": {"properties": ["playcount", "lastplayed", "dateadded"], "tvshowid": 26}, "id": "1"}

{u'jsonrpc': u'2.0', u'id': u'1', u'result': {u'tvshowdetails': {u'lastplayed': u'', u'playcount': 0, u'dateadded': u'', u'tvshowid': 26, u'label': u'Joymii'}}}

Why the results for tvshow playcount (ID: 26) differ from each other.

What version of XBMC are you running? IIRC this problem has been reported before and has been fixed in the Gotham nightly builds.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Regss - 2014-03-04

OK, I have XBMC 12.2.