Crazy bool logic in settings.xml
#1
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|Latinske|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
Reply
#2
(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|Latinske|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
Reply
#3
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.
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#4
Welcome back Nuka1195!
Reply
#5
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.
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#6
Still I can't combine AND(+) & OR(|) on settings.xml Sad
Reply

Logout Mark Read Team Forum Stats Members Help
Crazy bool logic in settings.xml0