2023-11-27, 09:47
I’m stuck. I am trying to add an InfoLabel to the System category that returns an integer and I need some help.
I am able to extract all of the data that I need from Kodi, that is not the problem. My problem is that I am only able to return this value as a string, never an integer. I would prefer an integer because it will make skin conditional testing easier.
I could chain together a couple of ‘!String.IsEqual(System.MyNewLabel,X)’ statements in the condition and keep it as a string, but that just seems wasteful and inelegant.
I put a logger entry in the CSystemGUIInfo::GetInt() method and it only ever seems to get called for ‘container’ category items, not ‘system’ category items.
Looking at the InfoLabel documentation, the ‘System’ category does not return any integer properties, only ‘string’ and ‘boolean’.
At some point during the InfoLabel extract and display process, some method somewhere needs to determine whether to call CSystemGUIInfo::GetLabel() or CSystemGUIInfo::GetInt() or CSystemGUIInfo::GetBool() for a particular item. It’s probably in some parent class somewhere but I am having problems locating that place.
Any help and/or guidance would be appreciated.
I am able to extract all of the data that I need from Kodi, that is not the problem. My problem is that I am only able to return this value as a string, never an integer. I would prefer an integer because it will make skin conditional testing easier.
Code:
<variable name="MyNewVariable">
<value condition="Integer.IsGreater(System.MyNewInteger,1)">$INFO[BlaBla.MyNewString]</value>
</variable>
I could chain together a couple of ‘!String.IsEqual(System.MyNewLabel,X)’ statements in the condition and keep it as a string, but that just seems wasteful and inelegant.
I put a logger entry in the CSystemGUIInfo::GetInt() method and it only ever seems to get called for ‘container’ category items, not ‘system’ category items.
Looking at the InfoLabel documentation, the ‘System’ category does not return any integer properties, only ‘string’ and ‘boolean’.
At some point during the InfoLabel extract and display process, some method somewhere needs to determine whether to call CSystemGUIInfo::GetLabel() or CSystemGUIInfo::GetInt() or CSystemGUIInfo::GetBool() for a particular item. It’s probably in some parent class somewhere but I am having problems locating that place.
Any help and/or guidance would be appreciated.