Kodi Community Forum
Crazy bool logic in settings.xml - Printable Version

+- Kodi Community Forum (http://forum.kodi.tv)
+-- Forum: Development (/forumdisplay.php?fid=32)
+--- Forum: Python Add-on Development (/forumdisplay.php?fid=26)
+--- Thread: Crazy bool logic in settings.xml (/showthread.php?tid=130304)



Crazy bool logic in settings.xml - kiler129 - 2012-04-30 00:13

Hi! I'm trying to figure out whats wrong with this code:
Code:
        <setting id="source" label="30101" type="labelenum" default="YouSee.tv" values="YouSee.tv|DR.dk|TVTID.dk|XMLTV|ONTV.dk|JSON-URL" />
        
        <setting id="youseetv.category" label="30102" type="labelenum" default="Danske" values="Danske|Filmkanaler|Grundpakken|Mellempakken|Fuldpakken|Nordiske|Engelske|Tyske|L​atinske|Slaviske|Tyrkiske|Kurdiske|Arabiske|Asiatiske" visible="eq(-1,0)" />
        
        <setting id="youseewebtv.playback" label="30111" type="bool" default="true" visible="eq(-2,0)" enable="System.HasAddon(plugin.video.yousee.tv)" />
        <setting id="danishlivetv.playback" label="30113" type="bool" default="true" visible="eq(-3,0)+eq(-1,false) | eq(-3,1) | eq(-3,2)" enable="System.HasAddon(plugin.video.dr.dk.live)" />

"danishlivetv.playback" is displayed incorrectly.
It should be visible when:
- source is YouSee.tv and youseewebtv.playback is disabled
- source is DR.dk
- source is TVTID.dk

Unfortunately in my case only first condition works as expected: rolleyes:
Can someone more expirenced take a look and help to resolve this problem? Smile


RE: Crazy bool logic in settings.xml - giftie - 2012-04-30 01:08

(2012-04-30 00:13)kiler129 Wrote:  Hi! I'm trying to figure out whats wrong with this code:
Code:
        <setting id="source" label="30101" type="labelenum" default="YouSee.tv" values="YouSee.tv|DR.dk|TVTID.dk|XMLTV|ONTV.dk|JSON-URL" />
        
        <setting id="youseetv.category" label="30102" type="labelenum" default="Danske" values="Danske|Filmkanaler|Grundpakken|Mellempakken|Fuldpakken|Nordiske|Engelske|Tyske|L​atinske|Slaviske|Tyrkiske|Kurdiske|Arabiske|Asiatiske" visible="eq(-1,0)" />
        
        <setting id="youseewebtv.playback" label="30111" type="bool" default="true" visible="eq(-2,0)" enable="System.HasAddon(plugin.video.yousee.tv)" />
        <setting id="danishlivetv.playback" label="30113" type="bool" default="true" visible="eq(-3,0)+eq(-1,false) | eq(-3,1) | eq(-3,2)" enable="System.HasAddon(plugin.video.dr.dk.live)" />

"danishlivetv.playback" is displayed incorrectly.
It should be visible when:
- source is YouSee.tv and youseewebtv.playback is disabled
- source is DR.dk
- source is TVTID.dk

Unfortunately in my case only first condition works as expected: rolleyes:
Can someone more expirenced take a look and help to resolve this problem? Smile

The problem I think is that you can not mix ANDs(+) and ORs(|) in system. I believe that there is only the order of flow to the logic, as there are not any separators(I don't think there are logic separators ie () available in settings)

so the test would be the following:

eq(-3,0) + eq(-1, false) - can be true
eq(-3,0) + eq(-3,1) - never can be true
eq(-3,0) + eq(-3,2) - never can be true


RE: Crazy bool logic in settings.xml - Nuka1195 - 2012-04-30 04:59

currently you can't mix and + and or |. this is being worked on. and the natural visible/enable conditions enable="System.HasAddon(plugin.video.dr.dk.live)" are not supported. this is also what i'm working on.


RE: Crazy bool logic in settings.xml - giftie - 2012-04-30 05:40

Welcome back Nuka1195!


RE: Crazy bool logic in settings.xml - Nuka1195 - 2012-04-30 07:46

Thanks It's going slow but I should have a patch in a week or so. Then to get it approved.

Looks like I have a lot of read for CE.


RE: Crazy bool logic in settings.xml - queeup - 2014-01-18 16:38

Still I can't combine AND(+) & OR(|) on settings.xml Sad