2024-03-20, 02:57
Hello all. I am trying to fill a container with dynamic data. I've read through all https://kodi.wiki/view/Skinning and Add-on Development for days but i can't find the solution. I've also read through this very old Thread: https://forum.kodi.tv/showthread.php?tid=176864&page=11 named "HEADS UP: Filling a list from a directory/plugin".
This is how far i came up to now:
Inserted a new "Menu Point" in Home.xml to <control type="fixedlist" id="9000"> and added a new <control type="group" id="31000"> section to it with a list: <control type="list" id="52">.
This list with ID 52 is filled by a plugin that i wrote via <content target="videos" limit="20">plugin://plugin.video.mybox/</content>.
This works. This works very well, i can see all my content The problem is, it is only filled once at Kodi startup when the Home.xml is rendered. And so i searched for days for a solution to periodically/dynamically update it.
So the simple question is, what is the best/normal way to update such a Container/List?
What i tried so far:
Extending my Plugin with point="xbmc.service" that runs in background and updates the data. The service works well, gets the data from the API, but i tried two ways to update that List with ID 52, both failed:
First i tried to set properties with xbmcgui.Window(10000).setProperty(....) because i found an other old post: https://forum.kodi.tv/showthread.php?tid...ight=panel.
Here, in the XML File the content is included via these "environment" variables that you set with setProperty to a Window. He is using:
to bind these "environment" variables with a count. Thats great, i just don't know if my <itemlayout> has only 2 pictures with <texture> tags how to address them:
The other thing i tried is to use the Service to edit the List with ID 52 and xbmcgui:
Trying to edit (delete first item) from the Home.xml List. But Kodi crashes trying to do this.
Would it be possible if i used xbmcgui.addControl() to add the List instead of using the Home.xml to create the List that was filled by <content>PluginUrl</content> before?
If anyone could help me out, i would be very thankful Thanks for any hint or direction to go. I've just started developing Kodi Addons.
This is how far i came up to now:
Inserted a new "Menu Point" in Home.xml to <control type="fixedlist" id="9000"> and added a new <control type="group" id="31000"> section to it with a list: <control type="list" id="52">.
This list with ID 52 is filled by a plugin that i wrote via <content target="videos" limit="20">plugin://plugin.video.mybox/</content>.
This works. This works very well, i can see all my content The problem is, it is only filled once at Kodi startup when the Home.xml is rendered. And so i searched for days for a solution to periodically/dynamically update it.
So the simple question is, what is the best/normal way to update such a Container/List?
What i tried so far:
Extending my Plugin with point="xbmc.service" that runs in background and updates the data. The service works well, gets the data from the API, but i tried two ways to update that List with ID 52, both failed:
First i tried to set properties with xbmcgui.Window(10000).setProperty(....) because i found an other old post: https://forum.kodi.tv/showthread.php?tid...ight=panel.
Here, in the XML File the content is included via these "environment" variables that you set with setProperty to a Window. He is using:
Code:
<content>
<item id="11">
<label>$INFO[Window.Property(RecommendedAlbum.1.Title)]</label>
Code:
<itemlayout height="220" width="500">
<control type="image">
...
<texture>[HOW to address this field with $INFO ?]</texture>
/control>
<control type="image">
...
<texture>[HOW to address this field with $INFO ?]</texture>
/control>
The other thing i tried is to use the Service to edit the List with ID 52 and xbmcgui:
Code:
list_control = xbmcgui.Window(10000).getControl(52)
list_control.removeItem(0)
Trying to edit (delete first item) from the Home.xml List. But Kodi crashes trying to do this.
Would it be possible if i used xbmcgui.addControl() to add the List instead of using the Home.xml to create the List that was filled by <content>PluginUrl</content> before?
If anyone could help me out, i would be very thankful Thanks for any hint or direction to go. I've just started developing Kodi Addons.