Crazy bool logic in settings.xml

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
kiler129 Offline
Junior Member
Posts: 28
Joined: Apr 2012
Reputation: 0
Post: #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|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
find quote
giftie Offline
Skilled Python Coder
Posts: 2,330
Joined: Mar 2010
Reputation: 53
Location: Calgary, Alberta
Post: #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|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

[Image: e4f63e45ba34fe4695b3bb08eb2499d8e4ee484e...4c076g.jpg]
For troubleshooting and bug reporting please make sure you read this first you can also use XBMC Log Uploader Script.
Cinema Experience
Cinema Experience Wiki
cdART Manager
fanart.tv


find quote
Nuka1195 Offline
Skilled Python Coder
Posts: 3,910
Joined: Dec 2004
Reputation: 18
Post: #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/
(This post was last modified: 2012-04-30 04:59 by Nuka1195.)
find quote
giftie Offline
Skilled Python Coder
Posts: 2,330
Joined: Mar 2010
Reputation: 53
Location: Calgary, Alberta
Post: #4
Welcome back Nuka1195!

[Image: e4f63e45ba34fe4695b3bb08eb2499d8e4ee484e...4c076g.jpg]
For troubleshooting and bug reporting please make sure you read this first you can also use XBMC Log Uploader Script.
Cinema Experience
Cinema Experience Wiki
cdART Manager
fanart.tv


find quote
Nuka1195 Offline
Skilled Python Coder
Posts: 3,910
Joined: Dec 2004
Reputation: 18
Post: #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/
find quote
queeup Offline
Posting Freak
Posts: 762
Joined: Feb 2009
Reputation: 16
Post: #6
Still I can't combine AND(+) & OR(|) on settings.xml Sad
find quote