Allow Access to ListItem Properties via JSON-RPC
#4
(2020-06-16, 01:15)drinfernoo Wrote:
(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.
I don't see how it would be a minimal impact, I believe you are thinking solely of your plugin and not Kodi as a whole with multiple plugins storing their own respective properties of varying size and type (ie not all values will be strings).
(2020-06-16, 01:15)drinfernoo Wrote: 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.

Currently, GetDirectory can only return a finite amount of keys; custom properties could be near infinite.
You're more than welcome to give it a shot: https://github.com/xbmc/xbmc ... otherwise, it can only be suggested in hopes someone takes on the work.
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply


Messages In This Thread
RE: Allow Access to ListItem Properties via JSON-RPC - by Lunatixz - 2020-06-16, 01:23
Logout Mark Read Team Forum Stats Members Help
Allow Access to ListItem Properties via JSON-RPC0