Allow Access to ListItem Properties via JSON-RPC
#3
(2020-06-16, 01:07)Lunatixz Wrote:
(2020-06-15, 21:56)drinfernoo Wrote: As the title states, this is a request to make ListItem Properties (as set by xbmcgui.ListItem.SetProperty(...)) available via a request to the JSON-RPC API.

Not being able to, as is the case now, has a number of implications for inter-addon communication, including, but not limited to, un/watched counts, resume points, extra item metadata, and even context menu items.

My proposed solution (albeit not one I'm prepared to tackle myself, as I'm not primarily a C++ developer, nor am I familiar in any way with Kodi's main codebase) would be to have available properties on a ListItem be included in the response from Files.GetDirectory, either as a separate object, or as part of the pre-existing properties object from the response. Provided someone with a bit more knowledge on the codebase could lend some guidance on where in the project these changes may be relevant, I could certainly take a whack at it!

I've also considered various workarounds to this issue, and detailed them in a different thread (along with an example add-on that basically serves to show that they are not reasonable approaches), but have not really made any headway, nor have I gotten any response. It is my belief that the correct way to handle this is to include them in the JSON-RPC response, so as to make this a standard operation, and not one that different developers will have to each find their own workaround for.
On the surface this seems like a minor request; however, the work required to register and store custom properties for a future JSON response is complex. I'm not sure the memory impact of your request; I'd assume the team would have to go the route of storing locally to the DB; which then would require additional code for sql maintenance.

It would be a neat feature, but I don't see it happening anytime soon. I personally hijack lesser-used listitem keys for passing custom entries.
For what it's worth, I believe the impact would be minimal, though I could be wrong.

When a call to Files.GetDirectory is made, the entire code at that endpoint is executed, including log statements, external calls, properties being set, etc... which leads be to believe that they can be read "in the same breath" as all of the other InfoLabels. I'm not saying this isn't a non-trivial change, but rather that I don't expect it would be a major one.

EDIT: I'm open to criticism on my code, I'm still learning Wink
Reply


Messages In This Thread
RE: Allow Access to ListItem Properties via JSON-RPC - by drinfernoo - 2020-06-16, 01:15


Logout Mark Read Team Forum Stats Members Help
Allow Access to ListItem Properties via JSON-RPC0
This forum uses Lukasz Tkacz MyBB addons.